/ccam-analytics:cost-breakdownfrom ccam-analytics
Breaks down Claude Code costs using the Agent Monitor pricing engine: per-model costs, per-session costs, daily trends, and compaction baseline token recovery. Useful for analyzing spending and planning budgets.
Ships in ccam-analytics. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Detailed cost analysis from the Agent Monitor's pricing engine.
The user provides: $ARGUMENTS
This may be: "today", "this week", "last 30 days", a session ID, or "budget $50/week".
| Endpoint | Returns |
|---|---|
GET /api/pricing | { pricing: [{ model_pattern, display_name, input_per_mtok, output_per_mtok, cache_read_per_mtok, cache_write_per_mtok }] } |
GET /api/pricing/cost | Total cost: { total_cost, breakdown: [{ model, input_tokens, output_tokens, cache_read_tokens, cache_write_tokens, cost, matched_rule }] } |
GET /api/pricing/cost/{sessionId} | Per-session cost with same breakdown shape |
GET /api/sessions?limit=200 | Sessions list — each includes inline cost field (bulk pricing) |
GET /api/analytics | Token totals (total_input, total_output, total_cache_read, total_cache_write — baselines pre-summed), daily trends |
The pricing engine matches model names against model_pattern using SQL LIKE (e.g. claude-sonnet-4-5% matches claude-sonnet-4-5-20250514). Longest pattern wins for specificity. Cost per model:
cost = (input_tokens / 1M) × input_per_mtok
+ (output_tokens / 1M) × output_per_mtok
+ (cache_read_tokens / 1M) × cache_read_per_mtok
+ (cache_write_tokens / 1M) × cache_write_per_mtok
Token counts are effective totals = current + baseline (baselines preserve pre-compaction tokens that would otherwise be lost when the transcript JSONL is rewritten).
| Family | Input $/Mtok | Output $/Mtok | Cache Read $/Mtok | Cache Write $/Mtok |
|---|---|---|---|---|
| Opus 4.5/4.6 | $5 | $25 | $0.50 | $6.25 |
| Sonnet 4/4.5/4.6 | $3 | $15 | $0.30 | $3.75 |
| Haiku 4.5 | $1 | $5 | $0.10 | $1.25 |
Table from /api/pricing/cost breakdown — each model with 4 token counts + cost. Highlight which pricing rule matched.
From sessions list with inline cost — sort descending. Show session name, model, duration, cost.
Cross-reference daily_sessions with per-session costs to compute daily spend. Show 7/30-day trend with direction arrows.
total_cache_read / (total_cache_read + total_input) × 100 — higher = more efficientStructured Markdown with tables. Currency as USD to 4 decimal places. Include total and per-model subtotals.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
cost-analysis, pricing, budget-planning, token-efficiency, agent-monitor
5 plugins ship this exact skill · first indexed Aug 10, 2026
6 skills in this plugin
/cache-efficiencyAnalyze prompt-cache effectiveness for Claude Code usage from the Agent Monitor dashboard — cache hit rate (total_cache_read / (total_cache_read + total_input)), cache_write vs cache_read reuse, cache-read vs cache-write spend, and the sessions with the poorest reuse. Pulls token totals from /api/analytics, per-session detail from /api/sessions, and dollar splits from /api/pricing/cost. Use when diagnosing cache spend or deciding whether prompt caching is paying off.
/model-mixBreak down Claude Code usage by model family (Opus / Sonnet / Haiku) from the Agent Monitor dashboard — each family's share of tokens, share of cost, and the spots where an expensive model is doing cheap work. Pulls per-model token and cost splits from /api/pricing/cost, current rates from /api/pricing, fleet token totals from /api/analytics, and per-session model assignment from /api/sessions. Use when deciding model routing or whether to downshift work to a cheaper tier.
/productivity-scoreCalculate a productivity score using actual Agent Monitor metrics — session completion rates, cache efficiency (cache_read vs input), compaction pressure (baseline tokens), turn velocity (turn_count / total_turn_duration_ms), tool success ratio (PreToolUse vs PostToolUse), and the workflow intelligence API's complexity and effectiveness scores.
npx claudepluginhub hoangsonww/claude-code-agent-monitor --plugin ccam-analyticsOther plugins' skills for the same job