lean-ctx: local AI Value Gate with withdrawn benchmark

lean-ctxmcptoken-optimizationrustopen-sourceclaude-code+1high-risk claims
GitHub OpenGraph social preview for yvgude/lean-ctx showing the LeanCTX ASCII logo and repository description
Source: https://github.com/yvgude/lean-ctx · Credit: GitHub OpenGraph / yvgude · License: Apache-2.0

yvgude/lean-ctx is an Apache-2.0 single-binary local “AI Value Gate” that sits between an AI coding agent and the model. It compresses reads, shells output, proxies requests, persists memory, and tracks costs — all in one Rust binary (GitHub, 2026-09-12).

The project’s maintainer just withdrew its headline benchmark numbers. That matters more than the compression percentages.

What happened

As of 2026-09-12, lean-ctx sits at 3,800+ stars, 345 forks, 8,032 commits on main, and 257 tagged releases (GitHub, 2026-09-12). Apache-2.0 license. One Rust binary, no telemetry by default.

The capability surface spans five areas: read compression (10 modes), shell-output compression (95+ patterns), an optional request proxy, session memory, and a knowledge graph with a CPAO ledger. It works with 30+ AI coding agents — Cursor, Claude Code, Codex, Gemini CLI, OpenCode, Copilot, Windsurf, Aider, Zed, JetBrains, and more — as a standard MCP server with optional shell hooks (README, 2026-09-12).

Install: one command via curl, brew, npm, cargo, or AUR. One-command setup per agent: lean-ctx wrap cursor, wrap claude, wrap codex. Undo with lean-ctx unwrap.

Why it matters

The local-first context layer is now a category. lean-ctx, Headroom (AIN-372, 2026-06-24), context-mode (AIN-546, 2026-07-29), and Ratel (2026-07-11) all attack context-window cost from different angles. lean-ctx is the most ambitious in scope: a wire-level proxy, 30+ agent coverage, one Rust binary.

The maintainer just withdrew the headline benchmark. The README still shows historical 98.1% map-mode compression and ~13-token cached re-read figures. The project’s own BENCHMARKS.md on main labels those numbers a “withdrawn historical snapshot” and restates the quality gate. A serious project pulling back its headline number to defend its methodology is rare — and it changes how the project should be summarised.

What lean-ctx ships

The benchmark and its withdrawal

The README’s “Benchmarks” section still shows a table: raw read 533.2K tokens, map 8.0K (98.1% reduction, 78% quality), signatures 14.0K (96.7%, 96%), cached re-read ~13 tokens (README, 2026-09-12).

BENCHMARKS.md on main opens with a different message (BENCHMARKS.md, 2026-09-12):

“LeanCTX Benchmarks — Withdrawn Historical Snapshot. Historical / not current evidence. The benchmark figures, competitor comparisons, versions, hardware measurements, and calculated savings that previously appeared here are withdrawn. They are not a current LeanCTX claim and must not be used in product copy, sales material, release notes, or technical decisions.”

The project’s quality gate: a gain is valid only when the same workload has “a known baseline and treatment, a declared quality threshold, and visible methodology.” The file adds: “A cheaper failed task is not a win.” Current direction: “Research, not a generally available or universal proof of savings.”

Honest framing: lean-ctx ships a real capability surface. Its current public benchmark posture is “withdrawn historical numbers + a methodology-first research programme.”

Proxy mode — what it does, what it doesn’t

lean-ctx proxy enable puts a local proxy between the agent and the model provider. It compresses every request — system prompt, full history, tool results — with prompt-cache-safe rewrites and a byte-stable contract (README, 2026-09-12).

Claude Pro/Max cannot use a custom ANTHROPIC_BASE_URL (OAuth restriction). lean-ctx wrap claude adds no proxy redirect while still enabling the ctx_* tools and shell-output compression; wire-level compression for Claude requires an ANTHROPIC_API_KEY.

The proxy also offers effort and verbosity knobs: proxy.effort pins one reasoning-effort level across OpenAI, Anthropic, and Gemini without breaking cache; verbosity is a cache-safe steer with a measured holdout.

Risks and caveats

Sources

SourceWhat it confirmsDate accessed
yvgude/lean-ctxRepo stats (3.8k★, 345 forks, Apache-2.0, 8,032 commits, 257 releases)2026-09-12
BENCHMARKS.md”Withdrawn Historical Snapshot” — figures withdrawn, must not be used in product copy2026-09-12
README.mdBenchmarks table, proxy docs, agent matrix, feature surface2026-09-12
Headroom coverageComplementary context-engineering coverage (AIN-372, 2026-06-24)2026-09-12
context-mode coverageComplementary context-engineering coverage (AIN-546, 2026-07-29)2026-09-12