These two are mostly complementary, and the honest headline is that running both is the best configuration on this page. LeanCTX is a gate on everything flowing into the model — file reads, shell output, the request itself. TokenSave is depth on one thing: the structure of your code. They meet at the edges and compete almost nowhere.
TokenSave v7.12.1 · LeanCTX / lean-ctx v3.10.2 (crates.io, Sep 2026)
There is real overlap, and pretending otherwise would be dishonest: both do impact analysis, both keep a
local savings ledger with a live dashboard (lean-ctx gain and tokensave gain are
near-namesakes), and LeanCTX's map and signatures read modes cover some of what
tokensave_module_api does. That overlap is a thin slice of either tool.
cargo install lean-ctx, Apache-2.0, same shape, same
no-runtime install story. LeanCTX is also ahead on adoption — roughly 3,800 GitHub stars against 640, and
about 17,600 crates.io downloads against 5,400.
| Dimension | TokenSave | LeanCTX |
|---|---|---|
| Implementation | Rust, single static binary | Rust, single static binary |
| Runtime deps | None | None |
| License | MIT | Apache-2.0 |
| Adoption | ~640 stars, ~5,400 crates downloads | ~3,800 stars, ~17,600 downloads |
| Centre of gravity | Symbol-level code graph | Context runtime for all agent I/O |
| MCP tools | 87 | ~56, plus 95+ shell-hook patterns |
| File reads | Symbol and module API queries | Mode-aware reads: full, map, signatures, diff, entropy |
| Shell output | Out of scope — pair with RTK | 95+ compression patterns |
| Search | FTS5 + graph proximity, deterministic | Hybrid with embeddings |
| Persistent facts | Decisions, code areas, FTS recall | Knowledge facts with categories |
| Portable bundles | Per-branch DBs | .lctxpkg, SHA-256 stamped |
| Graph depth | Call edges, type hierarchy, complexity, DSM, Gini, test-risk | Graph and impact analysis |
| Multi-branch | Per-branch graphs, cross-branch diff | No |
| Edit primitives | 4 atomic writers, re-index in place | Read-oriented |
map, signatures, diff, entropy — as a replacement for raw Read. On a real session, Bash results and large-file reads are a large share of the budget, and TokenSave simply does not address them.keywords argument as a manual workaround for conceptual queries. On "where do we handle retries?", where the code says backoff, LeanCTX wins..lctxpkg bundles — SHA-256 stamped knowledge, graph subset and session state — so context moves between machines, teammates and CI. TokenSave has per-branch databases but no portable export.tokensave_metrics: before=N after=M, with an append-only ledger and tokensave gain to price it.Both projects are free, local and open source, and neither is metered. The difference is scale of contribution: LeanCTX has more people around it.
the agent is reading too much: it re-reads unchanged files, drags raw cargo and
git output into the window, and burns the budget before it gets to thinking. That is an I/O
problem, and LeanCTX is built for it.
the agent does not understand the code: it greps, guesses, misses callers, and breaks things that depended on the symbol it just changed. That is a structure problem, and compression will not fix it.
Every TokenSave figure on this page was verified against the source at origin/master
(v7.12.1), not taken from its own README:
test_tool_definitions_complete in src/mcp/tools/handlers/mod.rs; 86 when the optional ast-grep binary is absent from PATH.[features] tiers in Cargo.toml: 11 lite, 9 medium, 40 full. The README's "50+" is conservative.real time for a complete tokensave status invocation, best of repeated runs on an Apple Silicon Mac. Your hardware and repo size will differ.otool -L on the released binary; system frameworks only.yvgude/lean-ctx repository metadata, and the lean-ctx-bin npm README, September 2026. Tool and pattern counts are from TokenSave's own feature review (docs/LEAN-CTX-COMPARE.md) and were not re-counted against the current release.