Re-reading the same files
Each turn, your agent reads files it saw a minute ago — and you pay full price for that context again.
For builders
LeanCTX is the local binary that makes your coding agent read less and remember more: 60–90% fewer tokens, re-reads that cost about 13 tokens, and project memory that survives restarts. Free forever, no account, runs on your machine.
The cost
On a personal project, every wasted token is your money. Three quiet leaks add up fast.
Each turn, your agent reads files it saw a minute ago — and you pay full price for that context again.
As the context window fills, agents quietly drop what they read and answers get worse without warning (Claude Code #42542).
The more you build, the more raw output, search results and file reads flood the window, and the bigger your monthly bill.
From solo builders to regulated fleets.
How it works
One small Rust binary runs the same loop on every read, command and search, locally, with no change to your editor.
Every read, search and shell command your AI runs passes through lean-ctx first, on your machine. Your editor, agent and workflow stay exactly the same.
tree-sitter parses the file across 26 languages and returns a map or signatures, the shape the model actually needs. Ten read modes pick the right depth per task.
Every read is cached by content hash, so an unchanged file comes back in about 13 tokens instead of thousands.
Findings, decisions and touched files are saved and auto-restored into your next session, so you never re-explain context after a restart.
See it run
No config files, no account. Install it, point your tools at it, and watch the tokens drop.
$ curl -fsSL https://leanctx.com/install.sh | sh$ lean-ctx init && lean-ctx setup→ detected Cursor, Claude Code, Copilot, Codex … configured$ lean-ctx read src/server.ts→ 4,200 → 920 tokens · 78% saved$ lean-ctx read src/server.ts→ cache hit · ~13 tokens$ lean-ctx benchmark report .What you get
Four outcomes you feel from the first session: measured, local, and free.
Per read, every read, measured on your own repo with lean-ctx benchmark, not estimated.
The window fills with signal, so long sessions stop drifting and silently degrading mid-task.
One local binary. Your code and prompts never reach a third-party service.
Every local feature ships under Apache-2.0: open, inspectable, and yours to keep.
Every local feature is free forever, enforced by a public CI gate. Building with others? See LeanCTX for teams or compare the plans.
Yes. Every local feature is Apache-2.0 and free forever, and a public CI gate fails the build if any local capability moves behind a paywall. Paid plans only add optional cloud sync.
No. LeanCTX runs entirely on your machine: no signup, no API key, and no telemetry unless you turn it on.
No. tree-sitter parses structure before anything is dropped, and compressed output is only used when a composite quality score stays at or above 95% (AST, identifier and line preservation). Run lean-ctx benchmark report . to verify on your own repo.
Anything that speaks MCP (Model Context Protocol), 30+ today, plus a shell hook for the rest. One lean-ctx setup detects and configures them.
Choose the LeanCTX path that matches how you build.
One Rust binary. No cloud, no account, Apache-2.0. Your next session reads leaner, and the ledger keeps the receipt.
Cookie preferences
We use analytics to understand how our site is used. You choose what's allowed — no tracking runs until you decide.
Essential
Site functionality, security, preferences
Analytics
Pageviews & usage patterns · PostHog EU (Frankfurt) · No cross-site tracking
Read our Privacy Policy for full details. You can change your preferences anytime.