LeanCTX CLI
A local context layer for coding agents: it understands the task, routes and compresses context and tracks the cost
- 3,942 ★ on the repository
- Last commit
- Apache-2.0
Extended access
Why this level
- Reads the repository and runs development commands alongside the agent
- Mediates the context sent to the model
Install
- Works in
In your terminal, with SkillFoxx CLI
npx skillfoxx add cli/leanctxDetects the agents on your machine, shows the access level and pins the version.
Other ways to install
Access and checks
How we reviewExtended accessThe tool runs code or makes network calls and only reads external data.
- Reads the repository and runs development commands alongside the agent
- Mediates the context sent to the model
This is third-party code. Review the repository files before installing.
What it does
LeanCTX runs locally alongside a coding agent and helps it read the repository, run development commands and send the model focused context. It understands the task, routes the right context to it, compresses what it sends and records cost and outcome in a local savings ledger. A shadow mode compares against a baseline. It installs as a binary and connects to different agents, with an additional skill and MCP integration. No config is required by default and all data stays on the machine.
Who it is for. For developers who want to cut the context volume and cost of coding agents without losing accuracy.
Good fit when
- The agent sends the model too much irrelevant context
- You need to measure and cut token spend on real work
- You want one local context layer across several agents
Not a fit when
- The project is small and context fits without loss anyway
- You cannot run a local service alongside the agent
Example request
Hook up LeanCTX and show how much context it compressed on this taskLimitations
Savings depend on the workload and enabled modes; the real effect is shown by the local ledger and shadow mode. LeanCTX does not install declared tools for you: fetching stays your step. The project is young and evolving, so interfaces may change.
How to disable. Disconnect LeanCTX from the agent and remove the binary (for example brew uninstall lean-ctx or npm rm -g lean-ctx-bin). Delete the MCP server from your client config if you added it.
FAQ
Does LeanCTX install external tools itself?
No. By project rule, fetching declared tools stays your step; LeanCTX does not run the install for you.
Where does the data go?
LeanCTX runs locally; the savings ledger and shadow mode are computed on the machine, and no config is required by default.
Discussion
No questions or reviews yet.
Related
CLI toolsContextLattice: a local context layer for agents
ContextLattice
A local memory and context layer: a session's goal, decisions and evidence are gathered into a compact packet an agent reopens
A local context store for coding agents that captures project knowledge and reuses it across Codex, Claude Code and OpenCode
An MCP server that keeps large tool output out of the agent's context window and stores session memory in SQLite
A plugin marketplace for agents: reflexion, code and PR review, git, TDD, DDD, specs and subagent-driven development
Indexes project files and composes a short task context into a file so the agent is not buried in noise
A local proxy and plugin for Claude Code and Codex that trims tool output, keeps the prompt cache warm and shows the savings
README in short
The README describes LeanCTX as a local context-engineering and cost-control layer for coding agents. It understands the task, routes and compresses context, tracks cost and outcome, and a shadow mode compares against a baseline. It stresses that the tool does not install dependencies for the user and runs locally with no required config. It shows install via script, Homebrew and npm, wiring to different agents, a skill and MCP. Apache-2.0 licensed.