AI coding tools send raw, uncompressed context to LLMs — full file reads, verbose CLI output, repeated content. That's where your tokens go. LeanCTX intercepts everything between your AI tool and the LLM. It compresses file reads (10 modes, re-reads cost ~13 tokens), shell output (90+ patterns), and session context — automatically. 42 MCP tools. Works with Cursor, Claude Code, Copilot, Windsurf & 20+ more. Single Rust binary. Installs in 60 seconds. No account. No cloud. No telemetry. Ever.
No reviews yetBe the first to leave a review for LeanCTX
Maker
📌
Hey Product Hunt! 👋
I'm Yves, a developer from Switzerland. I built LeanCTX because I was burning through $200+/month on AI coding API costs — and couldn't figure out why.
When I finally looked at the token logs, I was stunned: my AI tools were reading the same files over and over, completely uncompressed. A 300-line TypeScript file costs ~2,000 tokens. Read it 15 times in a session? That's 30,000 tokens — for ONE file. Multiply by every git command, every directory listing, every shell output... a single coding session burns ~90,000 tokens on context alone.
So I built a fix. LeanCTX is a single Rust binary that sits transparently between your AI tool and the LLM. Three compression layers:
→ Shell Hook: 90+ CLI patterns (git, npm, cargo, docker, kubectl…) compressed before the output reaches the LLM. 60-95% savings.
→ Context Server: 42 MCP tools with smart caching, 10 read modes, delta updates, entropy filtering, and cross-session memory. Re-reads cost ~13 tokens instead of 2,000.
→ Intelligence Protocols: CEP, CCP, and TDD make the AI respond more efficiently too. 8-25% extra savings on top.
What makes it different from alternatives:
• Works with 24+ AI tools — not just one editor
• One-command setup: `lean-ctx setup` auto-detects everything
• tree-sitter AST parsing for 18 languages — not regex hacks
• Zero telemetry. No analytics. No network requests. Not now, not ever.
• Cross-session memory — your AI remembers context across chats
Install in 60 seconds:
curl -fsSL https://leanctx.com/install.sh | sh && lean-ctx setup
It's fully open source (Apache 2.0), free forever, no account required. I believe developer tools should respect your privacy and your wallet.
Check your actual savings with `lean-ctx gain` — most devs see 70-90% token reduction from day one.
Would love your feedback. Happy to answer any questions!