mrkeyoor.com_
Sat 17 Oct 13:33 UTC
LLM Toolsevaluationupdated 01 Sept 2026

lean-ctx review

LeanCTX is a local Rust layer between AI coding agents and the code, shell output, and model requests they consume. Its MCP server, shell hooks, session store, and optional provider proxy try to send less repeated material while preserving a route back to the original content. It also records context budgets, token use, and accepted outcomes.

+8stars / 7d
Verdict

Our LeanCTX install took 59 seconds and the 537-second build passed, but tests exited 101 after another 196 seconds, so source adopters do not yet have a clean result from our sandbox. It is worth a controlled trial for heavy Claude Code or Codex use in a large repository, especially when repeated reads and command output are the problem. Keep raw tools available, test recovery on your own files, and wait for a passing local suite before making it a team default.

We ran it

Lab card: what happened when we ran lean-ctxScreenshot of lean-ctx (leanctx.com)
Install✓ · 21s520 packages
Build✗ timed out · 900s
Tests✗ · 209sran, no count parsed
Repo4391 files~1,020,363 lines of source · 61.8 MB · 17 CI workflows · tests dir

Answers from our run

Does lean-ctx build from source?

Dependencies installed in 21 seconds (520 packages), and the build failed. We cloned commit 3afe2bb into a clean Debian container with 3 CPUs and no project-specific setup.

Do lean-ctx's tests pass?

No. The project's own test command exited unsuccessfully after 209 seconds, and its output did not expose an individual test count.

Who should not use lean-ctx?

Developers who mostly work in tiny repositories or always need unfiltered logs: the README says the payoff is lower for both cases.

What are the alternatives to lean-ctx?

Context Mode, Headroom, Repomix. Our LeanCTX install took 59 seconds and the 537-second build passed, but tests exited 101 after another 196 seconds, so source adopters do not yet have a clean result from our sandbox.

Setup2/5Build passed in 537 seconds; tests exited 101
Docs4/5Setup, rollback, privacy, and proxy behavior are explained
Community4/5Pushed September 2026 with 9 active issues
Maturity3/5v3.10.0 is active, but our source test run failed

Who it’s for

Developers who use Claude Code, Codex, Cursor, or another MCP client throughout the day.
Teams working in large repositories where agents repeatedly read the same files and noisy command output.
Engineers who want local session memory and an inspectable record of context use.
Careful adopters willing to compare compressed results with raw source during a trial.

Who it’s NOT for

Developers who mostly work in tiny repositories or always need unfiltered logs: the README says the payoff is lower for both cases.
Teams that require a clean source test run before evaluation: our sandbox test command exited 101 after 196 seconds.
Product builders seeking a stable embedded Rust SDK or managed hosted service: the v3.10.0 notes say this release provides neither.
Users who depend on surrounding lines in compressed MCP searches without checking their installed version: issue 1648 reports that ctx_grep dropped those lines and inflated match counts on LeanCTX 3.9.17.
Developers unwilling to let setup change agent registration, shell hooks, local state, and a daemon: the documented wrap command does all four.

Setup reality

Our sandbox install succeeded in 59 seconds and installed 492 packages. The Rust build under ./rust/ succeeded in 537 seconds. Tests failed with exit 101 after 196 seconds. The supplied log tail ends inside a clipped Rust linker command and gives no test summary, so it does not identify the failed test or its cause.

The local MCP and shell path is documented as local-first, with telemetry off by default. The optional request proxy must match the model provider used by the agent. Cloud sync is optional; enabling it changes the data boundary.

lean-ctx wrap registers MCP, adds shell and agent hooks, starts a daemon, and keeps local state. The README provides unwrap, a raw-command bypass, and agent-only shell activation. Source contributors also face a 3,712-file, roughly 783,861-line checkout with no Dockerfile.

One Rust binary controls two paths into the model

LeanCTX v3.10.0 combines a local MCP server, shell hooks, session memory, a repository graph, cost records, and an optional request proxy. The MCP and shell path changes what a coding agent reads from files and commands. The proxy path can change the full request sent to OpenAI, Anthropic, or Gemini. That is a much wider job than trimming a long log, and it gives one program influence over most of an agent's working context.

Our commit 8910171 checkout makes that breadth visible: 3,712 files, roughly 783,861 lines of source, and 50.1 MB before the build. LeanCTX can cache reads, select file views, search code, remember sessions, track budgets, and expose a dashboard. Those parts may replace several smaller utilities for a frequent agent user. They also create more behavior to verify before the binary sits between a team and its repositories.

Recovery is the condition that makes compression acceptable

LeanCTX v3.10.0 documents several ways to retrieve original material after a shorter view is returned. Handles, explicit read modes, and reference endpoints are meant to let an agent fetch omitted bytes when the detail matters. That contract deserves more attention than any savings percentage in the README. A coding tool must know when context is absent and be able to recover it before editing, reviewing, or reporting a result.

Open issue 1648 shows one current reason to check that contract. On LeanCTX 3.9.17, a compressed multi-file ctx_grep request reportedly turned 40 real matches into 160 and removed every requested context line. The reporter supplies a reproduction and says narrowing the path or using plain grep avoids the faulty path. That report concerns an older version than our commit 8910171, so test it on the exact release you plan to deploy.

What happened when we ran it

Our sandbox installed 492 packages in 59 seconds, then built the Rust project under ./rust/ in 537 seconds. Tests ran for another 196 seconds and failed with exit 101. The provided tail contains a clipped Rust linker invocation ending among tree-sitter libraries, followed by no test summary. It does not name a failing test, compiler diagnostic, or missing system package, so the only defensible finding is that the command did not pass.

The measured checkout had 3,712 files, about 783,861 source lines, and occupied 50.1 MB. We ran commit 8910171 in an unprivileged Debian container with 3 CPUs, 12 GB of RAM, and no secrets. The repository had 14 CI workflow files and a tests directory, but no Dockerfile. Those are useful coverage and packaging signals; they do not turn our failed test command into a pass or explain its cause.

Wrap changes agent registration, hooks, and a daemon

The documented lean-ctx wrap <agent> command registers the MCP server, installs shell and agent hooks, starts the daemon, and verifies the connection. That is convenient for an individual trial, though it changes state outside the checked-out repository. The README also documents unwrap, a current-shell off switch, a raw-command path, and agent-only shell activation. Use those controls deliberately, and record the original agent configuration before wrapping it.

A packaged binary avoids the 537-second source build we measured, with shell, Homebrew, npm, and Cargo routes documented. The core MCP and shell features run locally with telemetry disabled by default. Provider traffic still follows the service used by the agent, and the optional request proxy sits directly on that path. Cloud sync is another opt-in boundary. Teams handling private code should inspect both settings before assuming that local state means every byte stays local.

September activity is strong, while source confidence is incomplete

GitHub recorded a push on September 1, 2026, and release v3.10.0 was published on August 29. The repository had 3,694 stars when fetched. A separate GitHub search found 9 open issues and 0 open pull requests, including issue 1648 filed and answered on September 1. That mix shows current maintenance and prompt response to a detailed bug report. It cannot substitute for reproducing the affected search path or passing the source tests.

Release v3.10.0 also draws useful boundaries: its Rust embedding work is preview material, not a stable public SDK, and the release does not add a hosted service. Those statements help competent buyers walk away early if they need an embeddable contract or managed control plane. For everyone else, the failed exit 101 remains the larger caution because the supplied tail is too thin to separate a project defect from an undocumented environment requirement.

Context Mode and Headroom cover narrower parts of the job

Context Mode keeps large tool results in local SQLite and returns selected material through MCP. Headroom concentrates on compression through libraries, a proxy, and MCP. Repomix prepares a static repository bundle without requiring a long-running daemon or session store. Each alternative gives up part of LeanCTX's combined graph, memory, shell, and cost-accounting surface, which can be an advantage when the missing part is outside your requirement.

LeanCTX earns a trial when repeated context loss is already costing time in a large codebase, and when one owner can inspect what the layer removes. Our 59-second install shows that obtaining its 492 packages is manageable; the 537-second build and 196-second failed test run make source adoption a more serious commitment. Start with one disposable profile and a representative repository. Keep it only if recovered source stays exact and the accepted work improves on your own tasks.

Alternatives

ProjectWhat it isPick it when
Context Mode gh↗A local MCP server that keeps bulky tool output in SQLite and returns selected results.pick this instead when tool-output isolation and session recovery are the main jobs, and you do not need a provider proxy.
Headroom gh↗A compression library and local proxy for tool output, retrieved text, files, and conversation history.pick this instead when you want compression inside an application or proxy without LeanCTX's repository graph and agent setup.
Repomix gh↗A focused tool that packs a repository into one AI-readable document.pick this instead when a predictable repository snapshot is enough and you do not want hooks, a daemon, or persistent memory.

What people are saying

  1. [github-trending] yvgude/lean-ctx

Sources

  1. LeanCTX repository and README
  2. LeanCTX v3.10.0 release
  3. Compressed ctx_grep context loss report

More llm tools reviews

GLM-5.3-Flash-EXL3-2x-DGX-Sparks-TensorFold · livenerf · scion · opencode2api · IQuest-Q1 · iCode · the whole board →