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
Install / Use
npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill cost-breakdownInstalls into whichever agent you are using.
SKILL.md
Installable skill definition
Quality Score
Category
OperationsSupported Platforms
Tags
Our assessment of cost-breakdown
cost-breakdown scores 85/100 on our quality scale, 480th of 736 Operations skills we index.
Its SKILL.md is 3.3 KB long, well organised into 12 sections with 1 code example: a solid amount of guidance for an agent.
With 1,015 GitHub stars, it is one of the more widely adopted skills in the catalogue.
Maintenance, license and trust
- The repository was last updated 12 days ago, so cost-breakdown is actively maintained.
- It is released under the MIT license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 100/100, with no cautions. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
cost-breakdown compared with similar skills
All 4 of these similar skills score higher than cost-breakdown; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| cost-breakdown (this skill)by hoangsonww | 85 | 1.0k | 12d ago | SKILL.md |
| algorithmic-artby anthropics | 100 | 177.9k | 14d ago | SKILL.md |
| pptxby anthropics | 100 | 177.9k | 14d ago | SKILL.md |
| designby nextlevelbuilder | 100 | 130.2k | 15d ago | SKILL.md |
| ui-ux-pro-maxby nextlevelbuilder | 100 | 130.2k | 15d ago | SKILL.md |
Frequently asked questions
- How do I install cost-breakdown?
- Run
npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill cost-breakdown. The install tabs above show the steps for each supported agent. - Which AI agents does cost-breakdown work with?
- It is written for Claude Code, as a SKILL.md file. Other agents that read the same format can often use it too.
- Is cost-breakdown safe to use?
- It is MIT-licensed and scores 100/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is cost-breakdown still maintained?
- The repository was last updated 12 days ago, so cost-breakdown is actively maintained.
Skill content
View source on GitHubname: cost-breakdown description: > 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.
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
+ (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).
Default pricing tiers (seeded on first run)
| 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 |
Report Sections
1. Cost by Model
Table from /api/pricing/cost breakdown — each model with 4 token counts + cost. Highlight which pricing rule matched.
2. Cost by Session (Top 10 Most Expensive)
From sessions list with inline cost — sort descending. Show session name, model, duration, cost.
3. Daily Cost Trend
Cross-reference daily_sessions with per-session costs to compute daily spend. Show 7/30-day trend with direction arrows.
4. Token Efficiency Analysis
- Cache hit rate:
total_cache_read / (total_cache_read + total_input) × 100— higher = more efficient - Compaction baseline recovery: Tokens preserved via baseline columns (tokens not lost to compaction)
- Output/input ratio: Balanced ratio indicates good prompt efficiency
5. Cost Optimization Opportunities
- Sessions where cache_write >> cache_read (poor cache reuse)
- Expensive models used for simple tasks (check subagent_type vs model)
- Sessions with many compactions (context overflow = wasted tokens)
Output
Structured Markdown with tables. Currency as USD to 4 decimal places. Include total and per-model subtotals.
Related Skills
algorithmic-art
177.9kCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems.
pptx
177.9kUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx or .potx file (even if the extracted content will be used elsewhere, like in an em…
design
130.2kComprehensive design skill: brand identity, design tokens, UI styling, logo generation (55 styles, Gemini, Atlas Cloud, or MuAPI AI), corporate identity program (50 deliverables, CIP mockups), HTML presentations (Chart.js), banner design (22 styles, social/ads/web/print), icon design (15 styles, SVG…
ui-ux-pro-max
130.2kUI/UX design intelligence for web, mobile, and desktop. This skill should be used when designing, building, reviewing, or fixing interfaces, including pages, components, design systems, accessibility, interaction, responsive layout, typography, color, charts, and stack-specific UI implementation.
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
