v3.6.0 — Opus 4.7 ready: Prompt Coach + Smart Pack
Headline
This release shifts focus from "save tokens on reads" to "save tokens AND make every prompt produce sharper output", and retunes the plugin for Claude Opus 4.7 including the 1M context tier.
New features
🎯 Prompt Coach — grade and improve every prompt
A UserPromptSubmit hook scores your prompt on specificity, scope, success criteria, and length. When the score is below 80, suggestions are silently injected so Claude works against a sharpened prompt — not a vague one.
[prompt-coach] Prompt quality: D (38/100).
Suggestions to make this prompt produce better results:
- Name the specific file(s), function(s), or module(s) you want changed.
- Bound the scope: instead of "all bugs / rewrite everything", pick one concrete failure.
- State the success condition: what tests pass? what error disappears?
Run /cco-coach to grade an arbitrary prompt or see prompt history.
Zero LLM calls. Pure local heuristics. <5ms latency.
📦 Smart Context Pack — optimal file set for your task
/cco-pack "refactor login flow to support OAuth"Builds a ranked, token-budget-aware file list from mentioned paths + git diff + historical patterns + keyword match. Each file gets a suggested offset/limit based on structural landmarks. Stops at 25% of your effective context.
💡 1M context tier
/cco-budget model opus-4.7-1mSwitching models retunes the entire plugin: Read Cache staleness thresholds scale (100K/40-files/10min vs 20K/8/10min), cost calculations use 1M-tier prices ($22.5/$112.5 per M), warnings fire at the right percentages.
💰 Real cost tracking
Budget monitor now tracks input AND output tokens separately and uses real per-model prices. Reported cost = actual cost.
🔌 MCP tool tracking
PostToolUse matchers now include mcp__.* — Linear, Slack, GitHub, Postgres et al. show up in token reports.
🩺 Doctor
/cco-doctorOne-second health check: version sync, hooks wiring, data dir, model config, node version.
Plumbing & fixes
- Atomic JSON writes — prevents
patterns.jsoncorruption when concurrent hooks finalize. - Unified file classification — single source of truth in
utils.js(was duplicated across 3 files). - Extended TOKEN_RATIOS — added
.svelte,.vue,.sh,.php,.lua,.ex,.clj,.scala,.swift,.dartand ~15 more. - ContextShield false-positive fix — useful read-only files (schemas, type defs) no longer get spurious warnings.
- PPID list bounded to last 20 entries in Read Cache (memory safety).
- CCO_QUIET=1 / CI=true suppresses donation banner in machine outputs.
- Plugin / package version sync —
scripts/sync-version.js+prepublishOnlyhook prevents the recurring stale-manifest issue.
Models supported
| Model | Input/M | Output/M | Window |
|---|---|---|---|
haiku-4.5 |
$1 | $5 | 200K |
sonnet-4.6 |
$3 | $15 | 200K |
opus-4.7 |
$15 | $75 | 200K |
opus-4.7-1m |
$22.5 | $112.5 | 1M |
Tests
138 subtests, 0 failures. New coverage: model costs, effective budget, prompt-coach scoring, budget input/output split, unified classification, extended token ratios.
Upgrade
claude plugin update claude-context-optimizer@egorfedorov-plugins
# or in a manual clone:
git pull && npm testRun /cco-doctor after upgrading to confirm everything is wired up.