Parallel tasks multiply the bill
Codex runs many tasks against the same repository, and each one rereads the same files from scratch.
LeanCTX for OpenAI Codex
LeanCTX reduces OpenAI Codex token usage by 60–90%: the MCP integration serves AST-aware compressed reads, ~13-token cached re-reads and 88–99% smaller command output. lean-ctx setup auto-detects Codex and writes the configuration. Agents keep their workflow; the context gets lean.
The problem
Codex runs many tasks against the same repository, and each one rereads the same files from scratch.
Whether tasks run in the cloud sandbox or locally, raw file dumps and verbose logs inflate every single run.
Instructions shape behavior, but they can't shrink a 4,200-token file. Volume needs a context layer, not a prompt.
Your stack. Your agent. Better context.
The integration
lean-ctx setup registers the MCP server in Codex's configuration. Reads, searches and shell calls route through the compression engine.
Setup adds the tool-preference block so Codex agents call ctx_read and ctx_shell by default.
Parallel tasks share the same local session cache. The second task to touch a file pays ~13 tokens instead of the full read.
Setup
$ curl -fsSL https://leanctx.com/install.sh | sh$ lean-ctx setup$ lean-ctx doctor$ lean-ctx gainWhat changes
Task one explored the repo; task two hits the cache. Shared context across parallel runs is where the savings compound.
Test and build output arrives as errors plus result. Codex's reasoning stays on the diff instead of the scrollback.
lean-ctx benchmark report . reproduces the savings on your own repository, methodology included.
Install LeanCTX and run lean-ctx setup. Codex gets MCP tools serving compressed AST-aware reads (60–90% fewer tokens), ~13-token cached re-reads and compact shell output, across all tasks on the machine.
Yes. Any Codex surface that loads the MCP configuration uses the same local server: CLI, IDE extension and locally executed tasks.
No. LeanCTX runs entirely on your machine with zero telemetry. It sits between Codex and your filesystem. Nothing new leaves the machine.
Team gives your whole org one shared, audited context plane, and the ledger proves the savings to finance. Local use stays free forever, enforced by CI.
Cookie preferences
We use analytics to understand how our site is used. You choose what's allowed — no tracking runs until you decide.
Essential
Site functionality, security, preferences
Analytics
Pageviews & usage patterns · PostHog EU (Frankfurt) · No cross-site tracking
Read our Privacy Policy for full details. You can change your preferences anytime.