Claude Code is brilliant.
Its token bill isn't.
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.
Where Claude Code spends your tokens.
Plan limits arrive mid-task
Long agentic sessions burn through usage limits because every file read and bash call lands raw in the window.
Compaction loses the plot
When the window fills, compaction summarizes away details you still need. Then the agent re-reads what it just forgot.
Bash output dominates the transcript
A single test run or install can cost more tokens than the code change itself.
How LeanCTX plugs into Claude Code.
MCP server in claude config
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.
CLAUDE.md guidance installed
Setup writes tool-preference rules so Claude Code reaches for compressed reads first. Automatically, in every session.
Session memory across restarts
Findings, decisions and progress persist in a local knowledge store and are restored into new sessions: less re-explaining, less re-reading.
One command. Auto-detected.
Three moments you'll notice.
The session that doesn't compact
Reads arrive 60–90% smaller, so the window fills 5–10× slower. Long tasks finish before compaction ever triggers.
The memory that survives
Tomorrow's session starts knowing what yesterday's learned, restored from the local knowledge store instead of re-read from disk.
The verifiable receipt
Every saving lands in an Ed25519-signed ledger. lean-ctx gain is a number you can audit.
Claude Code + LeanCTX, answered.
How do I reduce Claude Code token usage and costs?
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.
Does LeanCTX interfere with Claude Code's own context management?
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.
Does it work with both the CLI and the VS Code extension?
Yes. Any Claude Code surface that reads the same configuration uses the same MCP server, cache and ledger.
Can I adapt the context to different kinds of tasks?
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.
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.