lean-ctx 3.1.3

Context Runtime for AI Agents with CCP. 42 MCP tools, 10 read modes, 90+ compression patterns, cross-session memory (CCP), persistent AI knowledge with temporal facts + contradiction detection, multi-agent context sharing + diaries, LITM-aware positioning, AAAK compact format, adaptive compression with Thompson Sampling bandits. Supports 24 AI tools. Reduces LLM token consumption by up to 99%.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# lean-ctx — Token Optimization

lean-ctx is configured as an MCP server. Always use lean-ctx MCP tools instead of built-in tools:

- Read files → `ctx_read(path, mode)` instead of built-in Read
- Shell commands → `ctx_shell(command)` instead of built-in Shell
- Search code → `ctx_search(pattern, path)` instead of built-in Grep
- List directories → `ctx_tree(path, depth)` instead of ls/find

ctx_read modes: full (cached, for files you edit), map (deps+API, context-only), signatures, diff, aggressive, entropy.

For shell commands without MCP equivalents, prefix with `lean-ctx -c`:
- `lean-ctx -c git status` instead of `git status`
- `lean-ctx -c cargo test` instead of `cargo test`
- `lean-ctx -c npm install` instead of `npm install`

Write, StrReplace, Delete have no lean-ctx equivalent — use them normally.