Lean Ctx

Hook-oriented context engineering layer for AI dev — compress, remember, route, guard, and verify what crosses the agent/model boundary; upstream currently claims 60–90% token reduction, 81 MCP tools, and 30+ supported coding agents.

Repository: yvgude/lean-ctx (3,028 stars on 2026-06-30). Single local Rust binary vs rereading files, noisy shell output, repeated history, and session amnesia. The saved bookmark image captured v3.4.5, 49 tools, and "Open Source MCP Server" framing; current upstream is v3.8.17 with a broader request-proxy/addon/context-observability story. Source: yvgude/lean-ctx README, 2026-06-30

What it does

Function Effect
Compress Trim redundant context before it hits the model
Remember Persist session memory across turns
Route Direct agent to relevant files/tools
Verify Gate outputs before they compound

Upstream claims 60–90% token reduction, cached re-reads near 13 tokens, prompt-cache-safe request compression, opt-in telemetry only, signed savings ledgers, and 80+ MCP tools. Benchmark on your repo before trusting the percentage; treat token reduction as a receipt, not a correctness guarantee. Source: X/@tom_doerr, 2026-05-08; Source: yvgude/lean-ctx README, 2026-06-30

Version snapshot

Field Snapshot
GitHub release v3.8.17, published 2026-06-30.
npm lean-ctx-bin@3.8.17 (latest), registry modified 2026-06-30 08:27 UTC.
GitHub yvgude/lean-ctx, 3,028 stars, default branch main, HEAD 4c5393ce1712e62e676e0b44bd21258d0d155bfb, pushed 2026-06-30.
crates.io Badge exists upstream, but crates.io API returned 403 during this review; use GitHub/npm as the verified snapshot and re-check crates when installing from Rust.
Current scope README references 81 MCP tools, 30+ supported AI coding agents, shell hook, MCP server, request proxy, addons, memory, and observability.

Complementary: rtk

@sdusteric's rtk (Rust CLI) strips git/test/lint/kubectl output via pre-bash hook (60–90% claim on shell boundary). rtk filters tool output; lean-ctx trims standing context — they stack. Source: X/@sdusteric, 2026-05-27

Stack fit (Kevin) — ENFORCED

Per CSS UI Enforcement: evaluate lean-ctx at repo bootstrap on every Kevin project before prompt tuning.

When Action
New repo enrollment agent-docs init → install lean-ctx hooks → measure baseline vs trimmed sessions
Long agent loops Pair with Browser Testing Skills — cheaper validate passes when context is lean
Dedalus monorepo High file count = highest ROI; verify no hook hides critical architecture docs

Install: follow README on github.com/yvgude/lean-ctx.


Timeline