Read Cache blocks redundant reads. Prompt Coach grades and rewrites weak prompts before they cost you context. Smart Pack picks the optimal file set for your task. Adaptive to 200K and 1M context windows. Measured at 63% token savings across 7 reproducible scenarios — and now with prompt-quality scoring.
$ npx skills add https://github.com/egorfedorov/claude-context-optimizer
Run node benchmark/run.js yourself.
All scenarios use real file parsing, real token estimation, and real file digests. Nothing synthetic.
| Scenario | Without CCO | With CCO | Savings | |
|---|---|---|---|---|
| Read Cache Dedup (JS) | 9,082 | 4,579 | 50% | |
| Read Cache (5x reads) | 22,705 | 4,693 | 79% | |
| File Digest vs Full Read (JS) | 4,541 | 38 | 99% | |
| Read Cache Dedup (JSON) | 12,076 | 6,075 | 50% | |
| Contextignore Block (lockfile) | 8,827 | 0 | 100% | |
| File Digest vs Full Read (MD) | 3,117 | 36 | 99% | |
| Typical Session (10 files, 45 min) | 35,166 | 20,044 | 43% |
Based on 35% average waste rate (conservative), 80K tokens/session, 5 sessions/day.
Run /cco-roi for personalized calculations based on your actual usage.
| Model | $/M tokens | Saved/session | Saved/day | Saved/month | Saved/year |
|---|---|---|---|---|---|
| Haiku 4.5 | $0.80 | $0.02 | $0.11 | $3 | $40 |
| Sonnet 4.6 | $3.00 | $0.08 | $0.42 | $13 | $151 |
| Opus 4.6 | $15.00 | $0.42 | $2.10 | $63 | $756 |
* Individual developer. For a team of 10 on Opus: $7,560/year saved.
Every Read call consumes context — whether the file was relevant or not.
At $15/M tokens on Opus, this adds up fast.
Claude reads package.json, tsconfig.json, .eslintrc every session. ~500 tokens each time, rarely used.
A single read of a 250-line README burns tokens. If Claude reads it once and never references it again, that's pure waste.
Context gets compacted, Claude forgets, reads again. 5x the tokens for the same information. Over and over.
The plugin hooks into Claude Code silently. No configuration. No commands to learn. It just works.
Every Read, Edit, Write, Glob, Grep, and Agent call is tracked automatically via PostToolUse hooks. Zero overhead.
Read Cache blocks redundant reads and returns a compact file digest (~100 tokens instead of ~18K). Contextignore blocks lockfiles and generated code entirely.
Cross-session confidence scoring identifies which files are useful and which are waste. Per-project, decays with time. Gets smarter every session.
No commands needed. The plugin intervenes only when it can save you tokens.
Smart Read Cache v2.0 — blocks re-reading unchanged files. Returns a structural digest (~100 tokens) instead of full content (~18K). Saves 50-99% per file.
Live session pulse — "45K used, 18K saved by CCO (28% efficiency)" — unobtrusive real-time feedback on your savings.
Budget multiplier — "CCO makes your budget 1.4x more effective" — shows how much extra context you're getting from saved tokens.
Smart compact suggestions — lists specific read-only files to drop with exact token savings. Repeats every 10K tokens.
Performance comparison — "12% waste. Better than your avg (19%)!" Motivates improvement over time.
Weekly savings streak — shows waste trend. Warns about files that are always wasted in this project.
Optimization isn't just about blocking reads. The most expensive thing in any session is a vague prompt that sends Claude reading 20 files to guess your intent. v3.6 adds two new ways to make every prompt count.
A UserPromptSubmit hook scores every prompt on
specificity, scope, success criteria, and length.
Weak prompts get inline suggestions before Claude starts working —
so you stop wasting context on guesswork. Run /cco-coach to grade
a prompt manually or see history.
Run /cco-pack "fix login flow" and get a ranked file list with
suggested offset/limit per file — built from
mentioned paths, git diff, and historical patterns. Token-budget aware:
stops at 25% of your effective context.
Set /cco-budget model opus-4.7-1m and the entire plugin retunes:
adaptive Read Cache staleness thresholds, correct cost calculations
($22.50/$112.50 per M), and budget warnings that don't fire at 5% of a 1M window.
Budget monitor now estimates input and output tokens separately and uses each model's real prices (Opus 4.7: $15/$75, Haiku 4.5: $1/$5). You see actual cost — not just half of it.
PostToolUse hook now matches mcp__* tools too — so Linear, Slack,
Postgres, GitHub, and other MCP integrations show up in your token reports
alongside Read/Edit/Write.
Run /cco-doctor to verify install integrity: version sync,
hooks wiring, data-dir writable, model config sane. Catches the
"I installed it but nothing happens" class of bugs in under a second.
The plugin works automatically, but 17 commands are available for detailed insights.
Run /cco to see a visual breakdown of every file in your session. Green = useful. Red = waste. With actionable recommendations.
Run /cco-roi for personalized savings: monthly costs by model, effective budget multiplier, team ROI tables. Based on your real data.
Run /cco-digest for a weekly grade (S/A/B/C/D/F) broken down by precision, edit ratio, search accuracy, and focus.
Run /cco-budget set 80000 to set a limit. Automatic alerts at thresholds with cost estimates and budget multiplier.
Blocks redundant reads automatically. Returns a file structure digest (~100 tokens) instead of full re-read (~18K). Staleness-aware.
Run /cco-anatomy to generate a compact codebase map. Claude reads one file instead of twenty.
PreToolUse hook that warns before loading known-waste files. Suggests Grep or offset/limit alternatives.
Run /cco-export html for a Chart.js dashboard with waste trends, token usage, project breakdown, and edit timelines.
Run /cco-replay to see recent session summaries. Pick up where you left off without re-reading everything.
One command. Zero config. Proven savings.
$ npx skills add https://github.com/egorfedorov/claude-context-optimizer
Or clone manually: git clone https://github.com/egorfedorov/claude-context-optimizer.git
context-optimizer is 100% free, open source, and has no telemetry. If it saved you money on Claude tokens, consider supporting development.
bc1q428exz5t2h9rzk7z5ya70madh0j3rs6h4gfgyd
0xB3f0C8e42B7cA9d65920cEfe82e3fef1B5C9d0C9
8ctK8nt3CBkPZGfWQXX8TsnqUYUy4JAbT1EMhr8rsQxm