cost-report | /cost-report [--period today] | Generate a cost report with token usage and USD costs by tier, model, and agent |
cost-optimize | /cost-optimize | Analyze usage patterns, recommend cost optimizations, and emit hooks_model-outcome events |
cost-track | /cost-track | Auto-capture per-session token usage from the Claude Code jsonl into cost-tracking namespace (producer side). Also auto-fires on session-end via the Stop hook in hooks/hooks.json — no manual invocation needed. |
cost-budget-check | /cost-budget-check [--period today|week|month|all] | Read totals + budget config, emit 50/75/90/100% alert ladder; exit 1 on HARD_STOP |
cost-booster-route | /cost-booster-route <task> | Route tasks via hooks_route and report Agent Booster (Tier 1) bypass utilization |
cost-booster-edit | /cost-booster-edit <intent> <file> | Apply a Tier 1 transform via agent-booster.apply() (sub-millisecond, $0, deterministic) |
cost-benchmark | /cost-benchmark [--llm] [--anthropic] | Run the corpus benchmark and persist measured-vs-claimed table to docs/benchmarks/runs/ |
cost-trend | /cost-trend | Read all bench runs and surface drift (win rate, latency, speedup) — flags regressions the smoke gate misses |
cost-projection | /cost-projection [--window 7d] | Forward spend extrapolation: USD/day rate × 7d/30d/90d/365d horizons + days-until-budget-exhausted (predictive counterpart to cost-budget-check) |
cost-counterfactual | /cost-counterfactual [--since 7d] [--baseline all] | Comparative cost analysis: actual spend vs always-haiku / always-sonnet / always-opus baselines. Negative savings flag over-escalation; positive savings quantify routing's win. |
cost-burn | /cost-burn [--bucket 1d] [--lookback 14d] [--alert-on-acceleration-pct N] | Trend burn-rate analysis: window-over-window delta + optional drift-alert exit code. Catches "hot loop burning 10× normal" before budget alarm fires. |
cost-anomaly | /cost-anomaly [--since 7d] [--threshold 3.5] [--alert-on-outliers N] | Point-anomaly MAD-based outlier detection: flags individual sessions with |modified z| > threshold (Iglewicz-Hoaglin 3.5 default). Robust to outliers themselves; works on n=10. |
cost-diff | /cost-diff --baseline <path> --current <path> [--alert-on-pct N] [--alert-on-usd N] | PR regression detection — diffs two cost-summary JSON snapshots. Per-tier + per-model breakdowns sorted by |delta|. Optional pct/USD alert thresholds for CI gating. |
cost-session | /cost-session [--session-id <id>] [--top 20] [--since <iso-ts>] | Drill-down — per-message cost breakdown within ONE session. Surfaces top-N expensive messages with cache_write column so $16 messages stop looking like 569-token outputs. Pair with cost-anomaly. |
cost-health | /cost-health [--alert-acceleration 100] [--alert-outliers 1] [--skip burn,anomaly] | Composite CI gate — runs budget+burn+anomaly+projection in parallel, returns max(exit). One shell-out covers all four alert ladders. |
cost-ledger | /cost-ledger [--since 7d] [--provider claude|codex|grok|all] | Multi-provider spend, tokens and cache hit ratio from the local Claude Code, Codex and Grok logs; unpriced models flagged, USD and credits never mixed. |
cost-advise | /cost-advise [--since 7d] | Optimisation findings from your own logs (cache discipline, 1h cache TTL, sub-agent tier, Codex reasoning share, context bloat) with what-if savings. |
cost-openrouter | /cost-openrouter key|generation <id>|credits | OpenRouter's own billed cost, key limits and credits. Network + key: asks first (--yes); the key is $OPENROUTER_API_KEY, never an argument; a key stored as the sensitive option openrouterApiKey (credential store) is exported as OPENROUTER_API_KEY to the session's commands by the plugin's SessionStart hook when that variable is unset (ADR-506). |
cost-local | /cost-local --tok-per-s <n> [--busy 0.25] [--compare <model>] | Cost per 1M tokens on your own hardware (fixed + marginal) and the utilisation at which it beats a hosted model. |