
Token Optimizer MCP
Cut what your AI coding agent costs without cutting what it gets done.
Hooks, a proxy, and an MCP server for Claude Code, Codex, Copilot, Gemini and 12 more clients.
Quick start ·
How it works ·
Benchmarks ·
All 16 clients ·
Reference ·
Changelog
On SWE-bench Verified, Claude Code with the plugin in its default mode solved the
same tasks as Claude Code without it, at 0.71× the cost (7 of 7 resolved in
both arms; across nine runs, 84 tasks resolved without the plugin and 83 with
it). It gets there by stopping the waste agents make on their own: re-reading
files that have not changed, dumping whole files to see three lines, unbounded
searches, and re-deriving what an earlier session already worked out. Everything
runs locally. No account, no hosted service, and telemetry is off unless you
opt in twice.
The local dashboard: one ledger for every agent, every saving, and what the optimizer itself cost.
Quick start
Claude Code. Install the plugin rather than the bare MCP server: the plugin's
hooks do the saving, while the server alone only offers tools the model can ignore.
/plugin marketplace add ooples/token-optimizer-mcp
/plugin install token-optimizer@token-optimizer
/reload-plugins
You need Node.js 22.18+ (or 24.11+) on Claude Code's PATH, and Claude Code 2.1.139 or
later. Then check it works:
npx token-optimizer-doctor
The doctor feeds a synthetic payload to the real hook and confirms a large read is
handled. Every failure names its own fix.
Codex, Copilot CLI, Gemini CLI, Cursor and the rest. Every client runs the
same server, npx -y @ooples/token-optimizer-mcp@latest. Ready-made configuration
for each one is in src/integrations/, and
docs/INSTALLATION.md walks through all sixteen.
Requirements and what happens without them
- Node.js 22.18.0+ on Node 22, or 24.11.0+, for the hooks and the MCP server.
node must be on
the PATH of the client process. If you just installed Node.js or Git, start the
client again from a new terminal so it picks up the new PATH.
- Claude Code 2.1.139 or later. The hooks use the exec form
(
"command": "node", "args": [...]). An older Claude Code ignores args, so the
hooks silently do nothing; the doctor reports it.
- If
node cannot start, the hooks let the tool call through
("onFailure": "continue"): you lose the savings, not the session. The MCP server
shows as disconnected in /mcp until Node is reachable.
Full details: docs/INSTALLATION.md.
Does it pay for itself?
Each mode was run on the same 10 SWE-bench Verified instances, paired against a
control session with no plugin. Resolution is graded by the official evaluator.
off lands at 1.00×, which is what it should do: with the hooks and the proxy
off, the product costs nothing extra and saves nothing.