Agent mode rereads everything
Every agent run re-feeds the same files into the window. A 4,200-token module costs 4,200 tokens. Every single time.
LeanCTX for Cursor
LeanCTX reduces Cursor token usage by 60–90% by serving compressed, AST-aware context through MCP: ctx_read returns maps and signatures instead of full files, cached re-reads cost ~13 tokens, and shell output shrinks by 88–99%. Run lean-ctx setup once and Cursor is auto-detected and configured.
The problem
Every agent run re-feeds the same files into the window. A 4,200-token module costs 4,200 tokens. Every single time.
As the context window fills with raw file dumps, completions get slower and less accurate. Context-rot research measures accuracy falling from 98% to 64%.
Cargo builds, npm installs and test runs flood the conversation with progress bars the model never needed.
Your stack. Your agent. Better context.
The integration
lean-ctx setup writes the MCP entry into Cursor's configuration. Cursor's agent then calls ctx_read, ctx_search and ctx_shell instead of raw reads.
Setup installs a .cursor/rules mapping so the agent prefers the compressed tools automatically. No prompting discipline required.
Files Cursor already read return as ~13-token cache hits. The cache invalidates on modification, so the agent never sees stale code.
Setup
$ curl -fsSL https://leanctx.com/install.sh | sh$ lean-ctx setup$ lean-ctx doctor$ lean-ctx gainWhat changes
Your agent revisits a file it explored an hour ago. Instead of 4,200 tokens: a 13-token cache hit. The window stays lean all day.
cargo build output arrives as errors plus result: 847 tokens become 42. Your conversation stays about the code.
lean-ctx gain shows exactly what today saved, from a signed local ledger rather than an estimate.
Install LeanCTX and run lean-ctx setup. Cursor is auto-detected: the agent gets MCP tools that return compressed, AST-aware context (60–90% fewer tokens per read) and ~13-token cached re-reads. No workflow change required.
Yes. Any Cursor surface that speaks MCP uses the same lean-ctx server: agent mode, background agents and chat all benefit from the same cache and compression.
Typically the opposite: AST-aware modes keep signatures and structure while dropping noise, and context-rot research shows accuracy falls as windows fill. Every original stays retrievable via ctx_retrieve when full detail is needed.
Team gives your whole org one shared, audited context plane, and the ledger proves the savings to finance. Local use stays free forever, enforced by CI.
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.