Claude Code Plugin · Zero Config · Benchmarked
63%

fewer tokens per session.
Benchmarked.

Context Optimizer blocks redundant file reads, returns compact digests instead of full files, and learns your project's waste patterns. Measured across 7 scenarios with reproducible benchmarks.

$ npx skills add https://github.com/egorfedorov/claude-context-optimizer

Every claim is measured

Run node benchmark/run.js yourself. All scenarios use real file parsing, real token estimation, and real file digests. Nothing synthetic.

63%
Overall token savings
60,049
Tokens saved across scenarios
7
Reproducible scenarios
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%

How much you'll save

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.

1.5x
Effective context multiplier
200K context behaves like 310K
1.5M
Effective 1M context
Get more useful work from every token
0
Config required
Install once, savings are automatic

Your tokens are leaking. Every session.

Every Read call consumes context — whether the file was relevant or not. At $15/M tokens on Opus, this adds up fast.

Token accumulation over 30 tool calls
Without CCO
With CCO
📄

Config files "just in case"

Claude reads package.json, tsconfig.json, .eslintrc every session. ~500 tokens each time, rarely used.

📑

README glance = 2,400 tokens

A single read of a 250-line README burns tokens. If Claude reads it once and never references it again, that's pure waste.

🔁

Re-reading the same file 5x

Context gets compacted, Claude forgets, reads again. 5x the tokens for the same information. Over and over.

Install once. Forget about it.

The plugin hooks into Claude Code silently. No configuration. No commands to learn. It just works.

1

Silent Tracking

Every Read, Edit, Write, Glob, Grep, and Agent call is tracked automatically via PostToolUse hooks. Zero overhead.

2

Smart Blocking

Read Cache blocks redundant reads and returns a compact file digest (~100 tokens instead of ~18K). Contextignore blocks lockfiles and generated code entirely.

3

Pattern Learning

Cross-session confidence scoring identifies which files are useful and which are waste. Per-project, decays with time. Gets smarter every session.

What you'll see

CONTEXT HEATMAP ============================================================================ File Tokens Rds Eds Impact ---------------------------------------------------------------------------- ✏ src/components/Auth.tsx 4.2K 2 3 ██████████████████████████████ ✏ src/lib/api.ts 2.8K 1 2 ████████████████████ ✔ src/types/index.ts 1.1K 3 0 ████████ ⚠ README.md 2.4K 1 0 ░░░░░░░░░░░░░░░░░ ⚠ package.json 320 1 0 ░░ ⚠ tsconfig.json 280 1 0 ░░ ---------------------------------------------------------------------------- 11.1K total | 3.0K waste (27%) | 33% partial reads [cco] Session pulse: 45K used, 18K saved by CCO (28% efficiency) [context-budget] CCO makes your budget 1.4x more effective (18K saved)

It works while you work

No commands needed. The plugin intervenes only when it can save you tokens.

Every Re-Read

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.

Every 15 Calls

Live session pulse — "45K used, 18K saved by CCO (28% efficiency)" — unobtrusive real-time feedback on your savings.

Budget 50%+

Budget multiplier — "CCO makes your budget 1.4x more effective" — shows how much extra context you're getting from saved tokens.

Budget 85%+

Smart compact suggestions — lists specific read-only files to drop with exact token savings. Repeats every 10K tokens.

Session End

Performance comparison — "12% waste. Better than your avg (19%)!" Motivates improvement over time.

Session Start

Weekly savings streak — shows waste trend. Warns about files that are always wasted in this project.

When you want to dig deeper

The plugin works automatically, but 14 commands are available for detailed insights.

📊

Context Heatmap

Run /cco to see a visual breakdown of every file in your session. Green = useful. Red = waste. With actionable recommendations.

💰

ROI Calculator

Run /cco-roi for personalized savings: monthly costs by model, effective budget multiplier, team ROI tables. Based on your real data.

🎯

Efficiency Score

Run /cco-digest for a weekly grade (S/A/B/C/D/F) broken down by precision, edit ratio, search accuracy, and focus.

💰

Token Budget

Run /cco-budget set 80000 to set a limit. Automatic alerts at thresholds with cost estimates and budget multiplier.

Smart Read Cache v2.0

Blocks redundant reads automatically. Returns a file structure digest (~100 tokens) instead of full re-read (~18K). Staleness-aware.

🗺

Project Anatomy

Run /cco-anatomy to generate a compact codebase map. Claude reads one file instead of twenty.

🛡

ContextShield

PreToolUse hook that warns before loading known-waste files. Suggests Grep or offset/limit alternatives.

📊

HTML Dashboard

Run /cco-export html for a Chart.js dashboard with waste trends, token usage, project breakdown, and edit timelines.

📊

Session Replay

Run /cco-replay to see recent session summaries. Pick up where you left off without re-reading everything.

Zero telemetry
100% local storage
Only tracks paths, never content
Zero dependencies
MIT licensed

Start saving 63% of your tokens today

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