Every request re-reads the whole context. context-optimizer keeps it small and shows you the numbers: Haiku 5.5 subagents that do the reading for 1/40 of the price; and skills that keep long chats cheap on claude.ai too.
Measured with /cco audit on the session that built this release. Your numbers will differ — that's the point of the audit.
We expected read dedup to be the big win. On real transcripts, Claude almost never re-reads an unchanged file. The cost is the context itself, paid again on every request.
Cache reads are cheap per token, but every token in context is read again on every later request. 280K of context × 300 requests adds up.
$4.00 against $0.10 per million input tokens. Reading files and test logs doesn't need the expensive model.
Its context is thrown away when it returns. Only the short answer enters yours, and only that gets re-read.
The plugin ships two subagents on Haiku 5.5. Claude hands them work on its own; a 90-token policy at session start says when.
"Where is X defined, what calls Y, which tests cover Z" goes to context-optimizer:scout, several in parallel. Each answer comes back with path:line evidence.
It reads only the line ranges it's about to change. Design calls and edits never leave it.
Test suites and builds run in context-optimizer:runner. Thousands of log lines stay there; you get pass/fail and the failures.
/cco orchestrate <task> runs a whole task this way.
Checked live in Claude Code 2.1.302: the scout ran on claude-haiku-5-5, did one Grep and a 25-line Read, and found readEnd at src/read-cache.js:212. The whole session cost $0.005.
Most installs come from claude.ai chat, where a plugin loads its skills but not hooks or local scripts. So the plugin ships skills that work everywhere, and the heavy machinery where it can run.
fresh-start hands a long conversation over to a new one. doc-digest turns a long document into a working digest. project-context turns background you keep retyping into Project instructions. token-check and sharpen-prompt size and tighten.
The same skills, plus the scout and runner subagents on Haiku 5.5 for reading and checks.
Everything: Haiku subagents, one /cco command for the board, the audit and task state across /compact, read dedup, budget and cache warnings.
Claude Code keeps every session in ~/.claude/projects/. The audit prices them with each session's real model and cache TTL, counts every refusal CCO made, and ranks the levers that would save you the most. Nothing leaves your machine.
SAVINGS AUDIT — 3 sessions + 2 subagent runs, last 2 days ────────────────────────────────────────────────────────────────── Spend $26.16 over 293 requests (subagents $2.04) cache reads 62% · cache writes 23% · output 17% Subagents opus-5.5 $2.04 (1 run) · haiku-5.5 $0.001 (1 run) Context avg 282.2K per request, peak 564.8K; fixed overhead is 22% of it WHAT CCO DID Read dedup refused 1 re-read (1.2K tokens) → saved ~$0.00 (0% of spend) Repeated reads that went through: 2 via Read, 0 via Bash cat/sed BIGGER LEVERS (estimates on these sessions) ~ $7.49 29% Compact at 200K instead of letting context grow ~ $1.71 7% Delegate exploration (Read/Grep/web) to Haiku subagents ~ $0.70 3% Every 10K less of fixed overhead (MCP tools, CLAUDE.md, skills) VERDICT Read dedup saved $0.00. The biggest saving available here is "compact at 200K instead of letting context grow" — about $7.49 (29% of spend).
Real output, on the sessions that built this release. Yes, it says read dedup saved nothing there. That's why v4.22 ships the orchestrator.
Since v4.20 the hooks answer in the JSON Claude Code reads: advice for Claude as context, notes for you as a system message that costs no tokens.
read-cacheAn unchanged re-read is skipped and replaced by a map of the file. Per subagent, and it steps aside if Claude asks again.
budgetReal context size from the transcript, the cost of a cold cache after a pause, and a nudge to /compact before quality drops.
/cco/cco is the session board; /cco help lists audit, task, pack, orchestrate, config and the others.
/cco taskA small JSON state per task, put back into context after compaction or resume.
/cco overheadWhat every session pays before you type: system prompt, MCP tools, CLAUDE.md. Lists MCP servers you never call.
.contextignoreBlock lock files and build output from Read. ContextShield proposes rules from your own waste history.
Transcripts over estimates. Cost comes from the API usage Claude Code records, priced per model, cache TTL and fast mode.
NET savings. Everything CCO injects into context is subtracted from what it claims to save.
Tested the way Claude Code runs it. End-to-end tests drive the real hooks through sh -c on Linux and macOS; /cco doctor does the same on your machine.
Local only. The plugin's code makes no network calls. Data lives in ~/.claude-context-optimizer/ and is pruned automatically.
claude plugin marketplace add egorfedorov/claude-context-optimizer claude plugin install context-optimizer@cco
# in Claude Code
/cco doctor
/cco audit
On claude.ai, the desktop app or Cowork: open the Directory and add Context Optimizer. Upgrading from 4.x: commands moved under /cco (/cco-audit is now /cco audit). Turn the delegation policy off with "orchestrate": false in ~/.claude-context-optimizer/config.json.
context-optimizer is free, open source and has no telemetry. If it saved you money, consider supporting development.