Tooluck logoTooluck
SKILL.md

cost-breakdown

Agent skill fromhoangsonww/Claude-Code-Agent-Monitor

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 to install cost-breakdown

install cost-breakdown
# install the Claude-Code-Agent-Monitor pack with the skills CLI
npx skills add hoangsonww/Claude-Code-Agent-Monitor

# or add only this skill to Claude Code: copy the folder

plugins/ccam-analytics/skills/cost-breakdown/

# into

~/.claude/skills/cost-breakdown/ (all projects)

.claude/skills/cost-breakdown/ (one project)

plugins/ccam-analytics/skills/cost-breakdown/SKILL.md

MITFull file
1# Cost Breakdown
2
3Detailed cost analysis from the Agent Monitor's pricing engine.
4
5## Input
6
7The user provides: **$ARGUMENTS**
8
9This may be: "today", "this week", "last 30 days", a session ID, or "budget $50/week".
10
11## Data Sources
12
13| Endpoint | Returns |
14|----------|---------|
15| `GET /api/pricing` | `{ pricing: [{ model_pattern, display_name, input_per_mtok, output_per_mtok, cache_read_per_mtok, cache_write_per_mtok }] }` |
16| `GET /api/pricing/cost` | Total cost: `{ total_cost, breakdown: [{ model, input_tokens, output_tokens, cache_read_tokens, cache_write_tokens, cost, matched_rule }] }` |
17| `GET /api/pricing/cost/{sessionId}` | Per-session cost with same breakdown shape |
18| `GET /api/sessions?limit=200` | Sessions list — each includes inline `cost` field (bulk pricing) |
19| `GET /api/analytics` | Token totals (total_input, total_output, total_cache_read, total_cache_write — baselines pre-summed), daily trends |
20
21### How costs are calculated
22
23The 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:
24
25```
26cost = (input_tokens / 1M) × input_per_mtok
27 + (output_tokens / 1M) × output_per_mtok
28 + (cache_read_tokens / 1M) × cache_read_per_mtok
29 + (cache_write_tokens / 1M) × cache_write_per_mtok
30```
31…

Excerpt shown under the repository's MIT license.

More skills in Claude-Code-Agent-Monitor

Keep exploring

Similar skill repositories

thedotmack /

claude-mem
116k

Persistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More

CCCXGHGM+135 skills

Newsletter

Join the Community

Subscribe to our newsletter for the latest news and updates