LeanCTX
Reduces token costs for Claude, Cursor & Copilot by up to 99%
AI Summary
LeanCTX is an open-source tool that sits between AI coding tools and LLMs and intelligently compresses the sent context. Through AST parsing, shell output optimization, and specialized protocols, 60-99% of tokens are saved without information loss. The tool works transparently in the background and requires no configuration.
✓ Pros
- + Open source and MIT licensed, all data remains local
- + Zero-config installation works with 34+ AI tools out-of-the-box
- + Massive token and cost savings (60-99%) while maintaining code quality
- + Intelligent protocols (CEP, CCP, TDD) additionally optimize AI communication
✗ Cons
- − Requires Rust installation and basic technical understanding for setup
- − Still in active development, beta status for some features like LeanCTL
Use Cases
- → Automatic compression of file reads in Cursor, Claude Code and other AI IDEs
- → Reduction of shell command output for git, npm, docker and kubectl by up to 99%
- → Session caching for repeated file reads with minimal token costs
- → AST-based code analysis to extract only relevant signatures and types
Who is it for?
Developers who regularly use AI coding tools like Cursor, Claude Code or GitHub Copilot and want to drastically reduce their token costs.