lean-ctx
lean-ctx is a single Rust binary that combines a shell hook and an MCP context server to reduce the tokens that coding agents spend on files and command output. It works with Claude Code, Cursor, Copilot and other editors. The README's headline claim is savings of up to 99%. The idea: instead of an agent reading a whole file (about 2,000 tokens), a cached read through lean-ctx costs about 13 tokens; instead of raw `git status` output (about 800 tokens), compressed output is much shorter, using 90+ patterns for common commands.
Its savings table, based on a typical session with a medium TypeScript or Rust project, shows file reads from cache saving about 99%, map-mode reads 90%, git and grep output about 70%, build output 80% and test runners 90%, for an estimated session total of 88%. It offers 28 tools and three "intelligence protocols" (CEP, CCP and TDD). Install with a curl script, Homebrew, npm or cargo, then run `lean-ctx setup` to configure the shell and detected editors and `lean-ctx doctor` to verify. Safety nets are documented: `lean-ctx-off` fixes the current session, `lean-ctx uninstall` removes all hooks, aliases fall back to the original commands if the binary is missing, and `init --global --dry-run` previews changes. It is MIT licensed.
Features
Why choose it
Trade-offs
Maintenance check
- Last commit
- 2026-11-09
- Commits, last 90 days
- 100+
- Releases, last 90 days
- 16
- Latest release
- v3.12.2 (2026-11-05)
- Open issues
- 6
- Recent issues with at least one comment
- 23/26
Oldest week on the left; the latest four weeks are orange. Source: GitHub commit activity.
Status rule: archived on GitHub = Archived; last commit within 90 days = Active; 91 to 365 days = Slowing; older = Stale. All figures come from the GitHub API on the date shown.
Most discussed open issues
- #703 Experiment: vision-token encoding for bulk context (pxpipe research)4 comments · 2026-07-04
- #2166 Request CVE IDs for four advisories fixed in 3.12.03 comments · 2026-10-31
- #2186 bug: Unable to link device to LeanCTX Pro: 'lean-ctx login' not found2 comments · 2026-11-04
- #1722 Feature request: MCP Tasks support for background ctx_shell jobs with polling fallback and standardized status notifications2 comments · 2026-09-06
- #796 Feature: Discord bot for GitHub issue submissions [low priority]2 comments · 2026-07-12
Issue titles are quoted from GitHub. Open the link to check whether a problem still applies to the version you use.
Compatibility
Quick start
Use cases
Alternatives
Comments
No comments yet. Be the first!