Skip to content

Claude Context Optimizer

Claude Code plugin that tracks token usage, identifies wasted context, and saves 30-50% on API costs. Heatmaps, ROI reports, budget alerts, efficiency scores, git-aware…

Install

$npx skills add https://github.com/egorfedorov/claude-context-optimizer
Claude Code
claude mcp add claude-context-optimizer -- npx skills add https://github.com/egorfedorov/claude-context-optimizer
Cursor / Claude Desktop (mcp.json)
{
  "mcpServers": {
    "claude-context-optimizer": {
      "command": "npx",
      "args": [
        "skills",
        "add",
        "https://github.com/egorfedorov/claude-context-optimizer"
      ]
    }
  }
}

Install command taken from the project's README or registry entry. Always review code before running it.

Stop burning tokens on weak prompts and redundant reads. Model-aware for the whole Claude lineup — Opus 5.5, Sonnet 5.5, Fable 5.1, Haiku — detected per session, zero config.


The Problem

The average Claude Code session wastes 30-50% of tokens on files that are read but never actually used. Every Read call consumes context — whether the file was relevant or not.

  • A 200-line config file? 800 tokens gone.
  • A README you glanced at once? 2,400 tokens burned.
  • That package.json Claude reads "just in case"? 120 tokens, every time.

At $4/M input tokens (Opus 5.5) — $10/M on Fable 5.1 — a developer spending $100/month is lighting $30-50 on fire on irrelevant context.

The Solution

context-optimizer silently tracks every file read, edit, and search. It learns which files are actually useful and which are waste. Over time, it builds a profile of your coding patterns and tells you exactly where your tokens go — and how to stop wasting them.


What's new in v4.12 — honest numbers

  • Session cost was counted ~2×. Claude Code repeats a message's usage on every content block it writes to the transcript; CCO summed them. Now each message counts once ($17.43 → $7.72 on a real session). This also removes phantom "cache breaks" on the first turn.
  • Per-model and fast-mode pricing. Sessions that switch /model are priced per segment, fast-mode turns at 2×, and a cache break caused by a model switch is named as such.
  • "CCO saved $X" is CCO's savings only. It used to include Claude Code's own prompt-cache savings, which CCO doesn't cause.
  • Read-only sessions record no waste. When nothing is edited (review, explain, Q&A), reading is the work.

What's new in v4.11 — Opus 5.5 & Sonnet 5.5, and a plugin that cleans up after itself

Opus 5.5 was billed as Opus 5. Sessions on claude-opus-5-5 matched the opus-5 row: $5/$25 and 0.1× cache reads. Opus 5.5 is $4/$20 and reads its cache at $0.20/M (0.05×), so a real Opus 5.5 session showed ~50% more spend than it cost ($4.60 vs $3.06 on the session this release was built in). Opus 5.5 and Sonnet 5.5 now have their own rows, and opus-5.5 is the default fallback. ROI, digest, export and /cco-report compare the current lineup (Haiku 4.5 · Sonnet 5.5 · Opus 5.5 · Fable 5.1) instead of 17 aliases.

Data retention. One file per session landed in six folders under ~/.claude-context-optimizer/ and was never removed (~96MB after a few months). Once a day at session start, per-session files older than 90 days and live-session state older than 14 days are pruned; aggregated stats and learned patterns stay. Projects untouched for 180 days drop out of patterns.json. Run it now with /cco-clean --prune.

Shield picks the right project. With nested projects (repo and repo/games/x), the Read shield used the first prefix match, which was often the parent, and /rx matched /r. It now takes the deepest root on a / boundary.

/cco-doctor flags a stale fallback model in your config (e.g. opus-4.8).

What's new in v4.10 — Claude 5 prices, the 1-hour cache, and task state that survives /compact

Similar plugs

Orca is the ADE for working with a fleet of parallel agents. Run any coding agent with your own subscription. Available on desktop, mobile and remote runtime.

CLI proxy that reduces LLM token consumption by 60-90% on common dev commands. Single Rust binary, zero dependencies

Documented system prompts from Anthropic - Claude Fable 5.1, Opus 5.5, Claude Design, Claude Code. OpenAI - ChatGPT GPT-6-Astra, Codex. Google - Gemini 3.8 Flash, 3.1 Pro,…

Wrap Antigravity, ChatGPT Codex, Claude Code, Grok Build, Muse Code, Devin as an OpenAI/Gemini/Claude/Codex compatible API service, allowing you to enjoy the free Gemini…