Control what your AI can see. LeanCTX (Lean Context) is the context intelligence layer for AI agents — one local Rust binary that decides what they read, remembers what they learn, guards what they touch, and proves what they save. 60–90% fewer tokens as the receipt. 76 MCP tools, 30+ agents, local-first.
3.2k
Stars
295
Forks
8
Open issues
30
Contributors
AI Analysis
LeanCTX is a local Rust binary that sits between AI agents and their environment to intelligently filter, compress, and cache context—reducing token usage by 60–90% while maintaining a verifiable ledger of what the AI reads and writes. It is purpose-built for AI developers and agentic teams who need to optimize LLM context costs and governance; it is not a general-purpose framework and requires explicit integration into agent workflows.
Inferred from signals mentioned in the README (tests, CI, type safety) — not a review of the actual code.
AI's overall editorial judgment — not an average of the bars above, can weigh other factors too.
Rust-based context compression layer for AI agents; saves 60–90% tokens via local caching and intelligent filtering.
LeanCTX is a local Rust binary positioned as a context engineering middleware for AI coding agents (Claude Code, Cursor, Copilot, etc.). It intercepts and compresses reads, shell output, and chat history—claiming 60–90% token reduction—while maintaining session memory and audit trails. Target audience: developers running AI agents who want lower API costs and longer usable context windows. Real-world adoption evidence is sparse; the project is 3 months old with rapid GitHub growth (154 stars/week, 2,982 total) but no documented case studies or production telemetry.
Created March 2026, LeanCTX emerged in the context-optimization wave following explosive AI agent adoption in coding workflows. The name reflects a lean/efficiency positioning. Available on crates.io, npm, AUR, and Pi.dev—indicating rapid distribution infrastructure setup. No predecessor or prior art acknowledgment visible in README.
Strong GitHub velocity (3 months, 2,982 stars, 286 forks) and multiplatform packaging adoption suggest community interest in context cost problems. The 154-star/week rate over last 7 days indicates sustained or accelerating attention. However, growth appears driven by positioning and narrative (token savings metrics, multi-agent compatibility claims) rather than documented production wins. Distribution channels (npm, AUR, crates.io) suggest the creator prioritized accessibility over initial user validation.
Adoption not verified. README lists claimed compatibility with 'Cursor, Claude Code, Copilot, Windsurf, Codex, Gemini and 30+ other agents' but provides no links to user testimonials, case studies, or production metrics. No documented companies, teams, or projects using it. Discord community exists but member count not disclosed. No public benchmarks beyond internal demo GIFs. No npm download metrics or crates.io usage data mentioned. Optionally-telemetry badge suggests telemetry was added, implying awareness of adoption tracking, but no public dashboard or usage report visible.
Based on README: runs as a local binary that acts as an intermediary (proxy) between agents and underlying systems (files, shell, model APIs). Appears to use caching, compression algorithms, and a 'signed ledger' for audit trails. Implements 'map-mode' reads (inferred as file scope limiting). Claim of prompt-cache compatibility suggests it understands LLM token semantics. Likely architecture is: agent ↔ LeanCTX proxy ↔ filesystem/shell/APIs. No details on protocol, storage format, or compression algorithms in README.
Not documented in README. CI/CD badges present (CI, security-check workflows) but specific coverage metrics absent. Presence of security-check workflow suggests security-focused testing, but depth unknown.
Last push 2026-06-28 (same as evaluation date, indicating active work). Repository created 2026-03-23 (~3 months old). Consistent commit activity visible in velocity metrics. Appears actively maintained, not stagnant. However, very young project—long-term stability unproven.
ADOPT IF: you run multiple AI agents locally, want to audit/control what they access, and have high API-cost sensitivity where token savings justify operational overhead of running an additional service. AVOID IF: you rely on cloud-hosted agents without local proxy capability, need battle-tested production stability (project is 3 months old), or use only Claude API native prompt caching (which provides similar benefits for free). MONITOR IF: you believe context optimization is a real cost problem and want to track whether LeanCTX gains documented production users and stable APIs over the next 6–12 months.
Independent dimensions
Mainstream potential
4/10
Technical importance
6/10
Adoption evidence
2/10
- No documented production usage: Claims of token savings and multi-agent compatibility lack third-party validation or case studies.
- Project immaturity: 3 months old; long-term maintenance, API stability, and security posture unproven.
- Potential redundancy with API-native features: Claude prompt caching and OpenAI's cache control provide similar functionality without additional infrastructure.
- Adoption barrier: Requires local proxy deployment; agents must be configured to route through it; UX/integration friction not documented.
- Compression metric verification: Claims of 60–90% token savings based on internal benchmarks (reproducible VHS demos); no independent audit or production telemetry.
If LeanCTX gains documented production users and publishes case studies in next 6 months, it could establish a niche in high-volume agent orchestration (e.g., multi-agent workflows, cost-sensitive research labs). Without such evidence by Q4 2026, adoption will likely stall as users discover simpler alternatives (native API caching, cheaper models). Rust implementation may limit adoption vs JavaScript/Python competitors.
Newsletter
Get analyses like this every Monday
Free weekly digest of the most interesting open-source discoveries.
Languages
Information
- Website
- https://leanctx.com
- Language
- Rust
- License
- Apache-2.0
- Last updated
- 16h ago
- Created
- 4mo ago
- Analyzed with
- anthropic/claude-haiku-4-5
Stars over time
Contributors over time
Top 100 contributors only — repos with more will plateau at 100.
Open issues
bug: agent_wrapper detection misses no-redirect eval+pwd variant (regression re: #595)'
Unified Distribution Phase 4: one publisher identity — signing + commerce consolidation
Experiment: vision-token encoding for bulk context (pxpipe research)
Open pull requests
feat: integrate lean-md as an external lean-ctx addon (+ LSP formatter routing)
fix(addons): #727 follow-up fixes — pack_dir expansion, declared deps, min_lean_ctx preflight
fix(embeddings): resolve libonnxruntime in NixOS per-user profile paths
Top contributors
Recent releases
Similar repos
mksglu/context-mode
Context Mode optimizes context windows for AI coding agents through sandboxing...
greyhaven-ai/autocontext
autocontext is a recursive self-improving harness for AI agents that runs tasks...
Houseofmvps/codesight
Codesight is an AI context generator that creates optimized project summaries...
zilliztech/claude-context
Claude Context is an MCP plugin that integrates semantic code search into...
| Repository | Stars | Week Δ | Language | Score | Updated |
|---|---|---|---|---|---|
|
|
3.2k | +129 | Rust | 8/10 | 16h ago |
|
|
18.8k | — | TypeScript | 7/10 | 19h ago |
|
|
1.2k | — | Python | 7/10 | 11h ago |
|
|
1.2k | — | TypeScript | 8/10 | 3d ago |
|
|
12.1k | — | TypeScript | 8/10 | 3w ago |
|
|
1.2k | — | TypeScript | 8/10 | 4d ago |
8.6× larger star count; TypeScript vs Rust; LeanCTX claims 60–90% compression via caching; context-mode appears broader context-engineering framework. Direct comparison not possible without context-mode code inspection.
4× larger adoption; likely Claude-specific. LeanCTX positions as multi-agent. Functional overlap unclear from metadata alone.
Similar scale (~1.2k stars). LeanCTX in Rust; likely different implementation approach. Context-focused, codebase-intelligence angle. Both young relative to category.
Nearly same star count as LeanCTX. Broader 'engineering kit' positioning vs LeanCTX's 'proxy layer' focus. LeanCTX claims token compression; kit likely offers abstractions.
LeanCTX competes with *free* prompt caching features in Claude 3.5, GPT-4o. Unclear if LeanCTX adds value beyond orchestration and UI when API-native caching exists. May complement rather than replace.