yvgude

yvgude/lean-ctx

Rust Apache-2.0 AI & ML

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
active
GitHub +129 / week

3.2k

Stars

295

Forks

8

Open issues

30

Contributors

v3.9.5 10 Jul 2026

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.

AI & ML Developer Tool Discovery value: 6/10
Documentation 8/10
Activity 10/10
Community 9/10
Code quality 7/10

Inferred from signals mentioned in the README (tests, CI, type safety) — not a review of the actual code.

Overall score 8/10

AI's overall editorial judgment — not an average of the bars above, can weigh other factors too.

context-optimization mcp-server token-reduction ai-agents local-proxy
Actively maintained Well documented Niche/specialized use case Popular Production ready
Deep Analysis · Based on README and public signals
2w ago

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.

Origin

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.

Growth

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.

In production

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.

Code analysis
Architecture

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.

Tests

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.

Maintenance

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.

Honest verdict

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

Risks
  • 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.
Prediction

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.

0 found this helpful

Newsletter

Get analyses like this every Monday

Free weekly digest of the most interesting open-source discoveries.

Languages

Rust
91.1%
JavaScript
3.3%
Python
1.4%
Kotlin
1.2%
TypeScript
1%
HTML
0.6%
Shell
0.5%
CSS
0.5%

Information

Language
Rust
License
Apache-2.0
Last updated
16h ago
Created
4mo ago
Analyzed with
anthropic/claude-haiku-4-5

Stars over time

Loading…

Contributors over time

Top 100 contributors only — repos with more will plateau at 100.

Loading…

Similar repos

mksglu

mksglu/context-mode

Context Mode optimizes context windows for AI coding agents through sandboxing...

18.8k TypeScript AI & ML
greyhaven-ai

greyhaven-ai/autocontext

autocontext is a recursive self-improving harness for AI agents that runs tasks...

1.2k Python AI & ML
Houseofmvps

Houseofmvps/codesight

Codesight is an AI context generator that creates optimized project summaries...

1.2k TypeScript Dev Tools
zilliztech

zilliztech/claude-context

Claude Context is an MCP plugin that integrates semantic code search into...

12.1k TypeScript AI & ML
NeoLabHQ

NeoLabHQ/context-engineering-kit

Context Engineering Kit is a curated collection of TypeScript-based prompt...

1.2k TypeScript AI & ML
vs. alternatives
context-mode (mksglu, TypeScript, 18,266 stars)

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.

claude-context (zilliztech, TypeScript, 11,982 stars)

4× larger adoption; likely Claude-specific. LeanCTX positions as multi-agent. Functional overlap unclear from metadata alone.

codesight (Houseofmvps, TypeScript, 1,188 stars)

Similar scale (~1.2k stars). LeanCTX in Rust; likely different implementation approach. Context-focused, codebase-intelligence angle. Both young relative to category.

context-engineering-kit (NeoLabHQ, TypeScript, 1,176 stars)

Nearly same star count as LeanCTX. Broader 'engineering kit' positioning vs LeanCTX's 'proxy layer' focus. LeanCTX claims token compression; kit likely offers abstractions.

Generic context caching in Claude/OpenAI APIs

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.