AgentIndex icon
AgentIndex
ToolsMCP ServersHOTCategoriesTrendingNewBest ListsCompareGuides
Submit Tool
ToolsMCP ServersHOTCategoriesTrendingNewBest ListsCompareGuides
Home/
Memory & Context/
lean-ctx
lean-ctx logo

lean-ctx

Active·★ 4.0k·MIT·Updated 2026-11-24

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.

This write-up is based on the project's README and public repository data. We have not hand-tested the tool. Data as of 2026-11-08.

License
Apache-2.0
Latest release
v3.12.2 · 2026-11-05
Last commit
2026-11-08
Contributors
62
Forks
364
Open issues and PRs
9
First published
2026-03-23
npm package
lean-ctx-bin 3.12.2 · 1,162 downloads last week

Source: GitHub, npm and PyPI public APIs.

#agentic-coding#ai#ai-coding#claude-code#context-engineering#copilot#cursor#developer-tools
$ Install
$ curl -fsSL https://leanctx.com/install.sh | sh && lean-ctx setup && lean-ctx doctor
↗ Visit site★ GitHub
01

Features

01Transparent shell hook for CLI output compression
02Context server with 28 intelligent tools
03One-command integration for AI coding agents
04Adaptive LLM communication with Cognitive Efficiency Protocol
05Cross-session memory for context continuity
02

Why choose it

+Caches file reads and compresses command output, claiming about 88% token savings on a typical session.
+Works as both a shell hook and an MCP server with 28 tools, in one Rust binary.
+Installs via curl, Homebrew, npm or cargo, with `setup` and `doctor` commands.
+Documents escape hatches: `lean-ctx-off`, `uninstall`, fallback to original commands and a dry-run preview; MIT licensed.
03

Trade-offs

!The savings numbers (up to 99%, 88% per session) come from the project's own estimate for typical sessions, so your results will vary.
!It installs shell hooks and rewrites how commands behave, and the README's troubleshooting list (broken commands, garbled piped output) shows it can interfere with your shell if misconfigured.
!Compressing command output means the agent sees a summary, which can hide detail you need in some debugging cases.
04

Maintenance check

ActiveChecked: 2026-11-10
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
Commits per week, last 12 weeks
Commits per week, last 12 weeks: 126, 102, 44, 40, 41, 138, 83, 63, 20, 16, 20, 18

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.

05

Compatibility

Cursor
Auto-configured
Verified via docs
Claude Code
Auto-configured
Verified via docs
GitHub Copilot
Auto-configured
Verified via docs
VS Code
Auto-configured
Verified via docs
JetBrains IDEs
Auto-configured
Verified via docs
06

Quick start

1
$ curl -fsSL https://leanctx.com/install.sh | sh
2
$ lean-ctx setup
3
$ lean-ctx doctor
07

Use cases

↳Reducing token costs for Claude Code, Cursor, and Copilot
↳Optimizing MCP server performance
↳Saving $30-100+ per month on AI coding API costs
08

Alternatives

⚡Top VS:
VSagent-tool★26→VSclaude-soul★94→VSAiDex★50→VSagent-shadow-brain★38→
entroly logo
entroly★ 489
The Context Engineering Engine. Your AI sees 5% of your codebase — Entroly shows it everything. 78% fewer tokens. Works with Cursor, Claude Code, Copilot, OpenClaw.
agent-tool logo
agent-tool★ 26
MCP tool server for AI coding agents -- encoding-aware file tools, binary analysis, DAP debugger, SSH/SFTP, process memory, and more
VSCompare→
claude-soul logo
claude-soul★ 94
Self-correcting learning engine for Claude Code — persistent identity, behavioral pattern tracking, and cross-session memory
VSCompare→
AiDex logo
AiDex★ 50
MCP Server for persistent code indexing. Gives AI assistants (Claude, Gemini, Copilot, Cursor) instant access to your codebase. 50x less context than grep.
VSCompare→
agent-shadow-brain logo
agent-shadow-brain★ 38
🧠 v6.0 Hive Mind — One open-source brain every AI coding agent can share (Claude Code, Cursor, Cline, Codex, Copilot, Windsurf). 22 novel features. Free. Local-first. MIT.
VSCompare→
DeepSleep-beta logo
DeepSleep-beta★ 36
Local-first AI memory for developers. Watches your files, dreams while you code, answers what was I working on — free forever. Ollama · VS Code sidebar · MCP · Neural Link.
VSCompare→
Hoofy logo
Hoofy★ 16
Hoofy — AI development companion MCP server. Persistent memory, spec-driven development, adaptive change pipeline, Clarity Gate. 32 tools, single Go binary, zero deps.
sverklo logo
sverklo★ 83
The local-first MCP server for code intelligence — symbol graph, blast-radius, git-pinned memory. Open-source alternative to Greptile/Sourcegraph for Claude Code & Cursor.
VSCompare→
See all alternatives →

Comments

Log in to leave a comment

No comments yet. Be the first!

On this page
01Features02Why choose it03Trade-offs04Maintenance check05Compatibility06Quick start07Use cases08Alternatives
yvgude /
lean-ctx
↗

Rust shell hook and MCP server that cuts AI coding token use by caching and compressing

4.0k364MIT
Last commit2d ago
StatusActive
CategoryMemory & Context
Contributors62
Latest releasev3.12.2
Links
Documentation↗Discussion↗Issues↗Releases↗
Cloud Infrastructure
Ad

Deploy on DigitalOcean

Host your MCP servers, Docker containers, and AI agents with $200 free credit over 60 days.

Claim $200 Free Credit
© 2026 AgentIndex.app|Built by a 10-year iOS Developer.
Best by use caseAboutContactAdvertisePrivacy PolicyTerms of UseQYSGitHubBuy me a coffee ☕

Browse by Category

MCP ServersCode AssistantWorkflow AutomationRAG / Knowledge BaseMulti-AgentBrowser AutomationLLM InfraDev ToolingObservability

Not affiliated with Anthropic, OpenAI or Microsoft.