Listed from the MCP registry; nobody on Odel publishes it.
Context-window optimization: caching, compression & smart file tools that cut tokens 60-90%.
Runs on your machine from its package; the steps are below.

At most: moves money, runs code or commands, deletes data, or sends messages for you.
Odel charges nothing per call. The publisher may charge for its own service.
Runs locally over stdio
This server isn't hosted — your MCP client launches it from a package registry. Use one of the commands below, or drop the config into your client (e.g. Claude Desktop).
Run
npx -y @ooples/token-optimizer-mcp
MCP client config
{
"mcpServers": {
"token-optimizer": {
"command": "npx",
"args": [
"-y",
"@ooples/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.
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.
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."command": "node", "args": [...]). An older Claude Code ignores args, so the
hooks silently do nothing; the doctor reports it.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.
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.
| Run (SWE-bench Verified, Claude Sonnet) | Instances | Cost vs. control | Resolved, control / plugin |
|---|---|---|---|
Default mode (assist), first session | 10 | 0.705× [0.63–0.80] | 7 / 7 |
| Learned cost control, after the hoist fix | 15 | 0.634× [0.54–0.74] | 14 / 14 (of 15) |
off (MCP server only) | 10 | 0.999× [0.83–1.20] | 7 / 7 |
The samples are small and run-to-run variance is large, so read these as directions with intervals, not guarantees. The full method, every run including the ones where it lost, and the per-instance data are in PR #559.
Short answer: it saves more than every competitor we tested, in like-for-like runs, except one small Claude Code task against Headroom, which is a tie. The fairness notes and every loss are below the table.
| Competitor | How it was tested | Them | Token Optimizer | Result |
|---|---|---|---|---|
| Headroom | Tokens removed on Headroom's own benchmark, 18 workloads | 61.4% | 91.5% | ✅ Win |
| Headroom | Installed proxy vs ours, 120 Codex task pairs | $30.43 est. cost, 120/120 passed | $22.26 est. cost, 119/120 passed | ✅ 26.9% cheaper, 30.1% faster on average |
| Headroom | Installed proxy vs ours, one small Claude Code task, 4/4 tests | 48,626 weighted input | 49,053 weighted input | ➖ Tie (0.9% more) |
| tokenjuice | Product installed, same coding tasks for every arm | 13.6% cheaper | 33.6% cheaper | ✅ Win |
| Tokenade | Its rules text vs our rules text; its full product not yet run | 22.9% cheaper | 32.0% cheaper | ✅ Win |
| claude-token-optimizer | Product installed, its hooks fixed so they fire on Claude Code | 2.7% cheaper, within noise | 33.6% cheaper | ✅ Win |
How each row was kept fair, and what it does not show:
CLAUDE_TOOL_NAME variable that Claude Code does not set, so they
exit before checking anything. Scoring that would not be a fair comparison, so the row
uses their product with that one line changed to read the hook input Claude Code
actually sends. We confirmed the patched hooks fired and blocked oversized reads.
Its CLAUDE.md ships as an unfilled template, which understates it.Beyond the table:
On Headroom's own benchmark, its fixtures and its harness, the proxy removes 91.5% of the tokens. Their best setting removes 61.4%. The proxy costs less on 18 of 18 workloads when nothing it moved out is read back, and on 17 of 18 when all of it is.
Where it loses:
Raw data: competitor campaign, Headroom 120-pair study, and the Headroom benchmark tables in the comparison.
Read, Grep, cat or grep -r is routed to
a cached, bounded replacement, or refused outright in enforce mode. Re-reading a file you already read this
session returns only the diff.enforce mode a large
read is denied with a message naming the cheaper call; in the default assist
mode the hooks route, retrieve and capture without refusing anything.smart_read, smart_grep, smart_edit,
optimize_text, token_audit and the rest: diff-on-reread, bounded search,
and an out-of-context store.More: docs/HOW_IT_WORKS.md.
you touch src/auth.ts
│
├─ verify() compares exp against the LOCAL clock (finding, 0.9)
├─ per-host retry budgets; global was rejected — deadlock (decision)
├─ ! the skew fix was reverted once already (dead end)
└─ [git] 47 changes in 90d, last three: "fix token expiry",
"revert skew fix", "fix token expiry again"
None of that is in your repository. It exists only because an agent once spent tokens finding it out, and it is gone at the end of the session unless something keeps it. No ingestion job, no embedding model, no rebuild step.
More: docs/HOW_IT_WORKS.md.
| Mode | What the hooks do |
|---|---|
assist (default) | Route, retrieve, capture and compress; refuse nothing |
enforce | Also refuse large built-in reads and unbounded searches |
advise | Suggest the cheaper call without refusing |
off | Hooks and proxy off; the MCP server's tools still work |
Set it with TOKEN_OPTIMIZER_MODE. The chart above shows what each mode cost on
SWE-bench.
Enforcing tier: the client has a pre-execution hook, so a wasteful call can be refused.
| Client | What installs |
|---|---|
| Claude Code | Native plugin (see Quick start) |
| Codex | Native plugin in src/integrations/codex/plugin, or standalone hooks |
| GitHub Copilot CLI | Project hooks in src/integrations/copilot |
| Gemini CLI | Gemini extension at the repository root |
| Qwen Code | Extension bundle in src/integrations/qwen |
| Cursor | Project hooks and rule in src/integrations/cursor |
| Cline | Project hooks and rule in src/integrations/cline |
| OpenCode | In-process plugin and hooks in src/integrations/opencode |
| Kilo | In-process plugin and hooks in src/integrations/kilo |
| Windsurf | Project hooks and rule in src/integrations/windsurf |
Rules tier: Roo Code, Zed, Amp, Continue, Crush and Droid have no veto API, so they get always-on routing rules instead.
Every config path is checked against the client's published documentation; see docs/CLIENT_SUPPORT.md.
The dashboard reads the local ledger: verified savings, excluded reports, per-agent attribution, hook health and the knowledge graph. It prices usage with the exact provider, model and rate tier it captured, and leaves an ambiguous model Not priced rather than guessing. More: docs/DASHBOARD.md.
TOKEN_OPTIMIZER_TELEMETRY=1 counts into a file on your own
disk, and TOKEN_OPTIMIZER_BEACON=1 is what uploads it. DO_NOT_TRACK=1
overrides both.TOKEN_OPTIMIZER_UPDATE_CHECK=0 turns it off.npx token-optimizer-doctor prints which of these is on and what has been
recorded.Full details: docs/HOW_IT_WORKS.md.
Releases are published from CI with npm provenance, so
npm audit signatures ties the package to the workflow run and the commit without
trusting us. CHECKSUMS.sha256 ships alongside for offline checking.
To remove it, uninstall the plugin (/plugin uninstall token-optimizer@token-optimizer).
For a hook install, npx token-optimizer-uninstall shows the plan and changes
nothing; add --apply to carry it out. It removes only files that still match
what it wrote, and names anything you have edited since. Step by step:
docs/INSTALLATION.md.
| Page | What is in it |
|---|---|
| How it works | The mechanisms, subagents, the knowledge graph, trust and attribution |
| Benchmarks and comparison | Head-to-head against Headroom, tokenjuice, Tokenade and claude-token-optimizer, what it does differently, where it loses |
| Installation | All sixteen clients, requirements, verification and removal |
| Reference | Tools, compression statistics and the full technical reference |
| Dashboard | What the local dashboard shows |
| OrcaRouter | Routing requests through OrcaRouter |
| Tool reference | Every MCP tool and its arguments |
| Token accounting | How savings are counted and priced |
git clone https://github.com/ooples/token-optimizer-mcp.git
cd token-optimizer-mcp
npm ci
npm run build
npm test
The benchmarks, evaluation corpora and registry material live under
bench/. See CONTRIBUTING,
testing and the
security policy.
MIT. See LICENSE. Commercial use is allowed.