Agent skill · Business & Finance

cost-breakdown

Break down Claude Code costs using the Agent Monitor pricing engine. Shows per-model costs (input, output, cache_read, cache_write at $/Mtok rates), per-session costs, daily trends, and compaction baseline token recovery. Use when analyzing spending, comparing model costs, or planning budgets.

hoangsonwwgithub.com/hoangsonwwGitHub ↗
claude-codeMIT
Install
npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill cost-breakdown --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 1
SKILL.md size: 3 KB
Bundled scripts: none
Path: plugins/ccam-analytics/skills/cost-breakdown/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 869
Language: TypeScript

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# Cost Breakdown Detailed cost analysis from the Agent Monitor's pricing engine. ## Input The user provides: **$ARGUMENTS** This may be: "today", "this week", "last 30 days", a session ID, or "budget $50/week". ## Data Sources | 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 | ### How costs are calculated 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

What's inside
Steps it walks through
  1. Input
  2. Data Sources
  3. How costs are calculated
  4. Default pricing tiers (seeded on first run)
  5. Report Sections
  6. 1. Cost by Model
  7. 2. Cost by Session (Top 10 Most Expensive)
  8. 3. Daily Cost Trend
  9. 4. Token Efficiency Analysis
  10. 5. Cost Optimization Opportunities
  11. Output
More from Claude-Code-Agent-Monitor
All skills →
About this skill
What does the cost-breakdown skill do?

Break down Claude Code costs using the Agent Monitor pricing engine. Shows per-model costs (input, output, cache_read, cache_write at $/Mtok rates), per-session costs, daily trends, and compaction baseline token recovery. Use when analyzing spending, comparing model costs, or planning budgets.

How do I install it?

Run `npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill cost-breakdown --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From hoangsonww/Claude-Code-Agent-Monitor, a repository with 869 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going