Cursor reads your repo
like it costs nothing.
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.
Where Cursor spends your tokens.
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.
Long sessions degrade
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%.
Terminal output is dead weight
Cargo builds, npm installs and test runs flood the conversation with progress bars the model never needed.
How LeanCTX plugs into Cursor.
MCP server, auto-configured
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.
Rules file included
Setup installs a .cursor/rules mapping so the agent prefers the compressed tools automatically. No prompting discipline required.
Session cache underneath
Files Cursor already read return as ~13-token cache hits. The cache invalidates on modification, so the agent never sees stale code.
One command. Auto-detected.
Three moments you'll notice.
The re-read that costs nothing
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.
The build that stays readable
cargo build output arrives as errors plus result: 847 tokens become 42. Your conversation stays about the code.
The gain report
lean-ctx gain shows exactly what today saved, from a signed local ledger rather than an estimate.
Cursor + LeanCTX, answered.
How do I reduce Cursor token usage?
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.
Does LeanCTX work with Cursor's agent mode and background agents?
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.
Will compressed context make Cursor's answers worse?
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.
Using this at work?
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.