Plan limits arrive mid-task
Long agentic sessions burn through usage limits because every file read and bash call lands raw in the window.
LeanCTX for Claude Code
LeanCTX cuts Claude Code token costs by 60–90% with MCP tools and shell hooks: compressed AST-aware reads, ~13-token cached re-reads, and 88–99% smaller command output. Sessions stay sharp longer because the window fills with signal instead of noise. Setup is one command: lean-ctx setup.
The problem
Long agentic sessions burn through usage limits because every file read and bash call lands raw in the window.
When the window fills, compaction summarizes away details you still need. Then the agent re-reads what it just forgot.
A single test run or install can cost more tokens than the code change itself.
Your stack. Your agent. Better context.
The integration
lean-ctx setup registers the MCP server for Claude Code. You get ~13 lean-core tools by default (ctx_read, ctx_search, ctx_shell, …), with the full 81-tool catalog available on demand via ctx_call / ctx_expand.
Setup writes tool-preference rules so Claude Code reaches for compressed reads first. Automatically, in every session.
Findings, decisions and progress persist in a local knowledge store and are restored into new sessions: less re-explaining, less re-reading.
Setup
$ curl -fsSL https://leanctx.com/install.sh | sh$ lean-ctx setup$ lean-ctx doctor$ lean-ctx gainWhat changes
Reads arrive 60–90% smaller, so the window fills 5–10× slower. Long tasks finish before compaction ever triggers.
Tomorrow's session starts knowing what yesterday's learned, restored from the local knowledge store instead of re-read from disk.
Every saving lands in an Ed25519-signed ledger. lean-ctx gain is a number you can audit.
Run lean-ctx setup after installing LeanCTX. Claude Code gets MCP tools that compress reads by 60–90%, cache re-reads at ~13 tokens and shrink bash output by 88–99%, typically extending plan limits several-fold.
No. LeanCTX works upstream: it shrinks what enters the window in the first place, so compaction triggers later or not at all. Claude Code's own mechanisms keep working unchanged.
Yes. Any Claude Code surface that reads the same configuration uses the same MCP server, cache and ledger.
Yes. Built-in Context Personas (coding, research, support, data-analysis, lead-gen) reshape the whole context surface per domain: tool set, read mode, compression and intent taxonomy. A research session and a coding session get different, tuned context from the same install. Switch with one setting (LEAN_CTX_PERSONA), no re-prompting.
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.