Agent skill

Cost Breakdown

by hoangsonww in hoangsonww/Claude-Code-Agent-Monitor

Break down Claude Code costs using the Agent Monitor pricing engine.

MITAuto-check passed

Install Cost Breakdown

skills CLI
$ npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill cost-breakdown -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install hoangsonww/Claude-Code-Agent-Monitor cost-breakdown --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/hoangsonww/Claude-Code-Agent-Monitor.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/ccam-analytics/skills/cost-breakdown .claude/skills/cost-breakdown && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
cost-breakdown
GitHub stars
1.1k
Token cost
~845 tokens
SKILL.md length
317 words
Files
2
Skills in repo
78
Repo updated
First seen
Licence
MIT

At a glance

Break down Claude Code costs using the Agent Monitor pricing engine.

  • Works in 5 steps: Cost by Model → Cost by Session (Top 10 Most Expensive) → Daily Cost Trend → …
  • Analyzing spending
  • SKILL.md covers Input, Data Sources, Report Sections and Output
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Cost Breakdown is an agent skill from hoangsonww/Claude-Code-Agent-Monitor. Break down Claude Code costs using the Agent Monitor pricing engine. Shows per-model costs (input, output, cacheread, cachewrite at $/Mtok rates), per-session costs, daily trends, and compaction baseline token recovery. Use when analyzing spending, comparing model costs, or planning budgets.

Its SKILL.md is about 850 tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files (for example `agents/openai.yaml`).

The repository describes itself as: 🚀 A real-time monitoring dashboard for Claude Code & Codex, built with SQLite3, Node.js, Express, React, Vite, TailwindCSS, & WebSockets. It tracks sessions, agent activity… The licence is MIT.

When your agent uses it

  • Analyzing spending
  • Comparing model costs
  • Planning budgets

Example prompts

  • “/cost-breakdown”

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Cost by Model
  2. Cost by Session (Top 10 Most Expensive)
  3. Daily Cost Trend
  4. Token Efficiency Analysis
  5. Cost Optimization Opportunities

What it can do on your machine

Read from SKILL.md and the folder at commit a06db03. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Cost Breakdown loads about 845 tokens when it runs. Until then it costs about 77 tokens; SKILL.md has 317 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~77
When it runs · the whole SKILL.md, loaded when a task matches
~845

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from hoangsonww/Claude-Code-Agent-Monitor at commit a06db03, republished under its MIT licence (© hoangsonww). 317 words, ~845 tokens.

Download SKILL.mdSave it as .claude/skills/cost-breakdown/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
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

EndpointReturns
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/costTotal 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=200Sessions list — each includes inline cost field (bulk pricing)
GET /api/analyticsToken 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)
FamilyInput $/MtokOutput $/MtokCache Read $/MtokCache 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.

© hoangsonww, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in plugins/ccam-analytics/skills/cost-breakdown of hoangsonww/Claude-Code-Agent-Monitor.

  • SKILL.md
  • agents/openai.yaml

Open the folder on GitHubat commit a06db03

Compare with similar skills

Cost Breakdown next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Cost Breakdown compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Cost Breakdown this skillhoangsonww/Claude-Code-Agent-Monitor1.1k—~845Automated safety check: PassMIT
Pricingsickn33/agentic-awesome-skills47k1 repos~1.9kAutomated safety check: PassMIT
Cost Exportruvnet/ruflo74k—~687Automated safety check: NotesMIT
Cost Trackingaffaan-m/ECC277k1 repos~1.3kAutomated safety check: PassMIT
Cost Conversationruvnet/ruflo74k—~407Automated safety check: NotesMIT
Cost Reportruvnet/ruflo74k—~830Automated safety check: NotesMIT

Similar skills

  • Pricing

    sickn33/agentic-awesome-skills

    When the user wants help with pricing decisions, packaging, or monetization strategy.

    47k GitHub starsUsed in 1 repo~1.9k tokens
    Sales & SupportAuto-check passed
  • Cost Export

    ruvnet/ruflo

    Export cost-tracking telemetry in Prometheus textfile or webhook JSON formats — for external observability (Grafana, Datadog, custom dashboards)

    74k GitHub stars~687 tokensUpdated yesterday
    DevOps & CloudAuto-check: notes
  • Cost Tracking

    affaan-m/ECC

    Track and report Claude Code token usage, spending, and budgets from the local ECC cost-tracker metrics log.

    277k GitHub starsUsed in 1 repo~1.3k tokens
    AI & LLM EngineeringAuto-check passed
  • Cost Conversation

    ruvnet/ruflo

    Per-conversation cost view — list every session in cost-tracking with started-at, message count, top model, and total cost

    74k GitHub stars~407 tokensUpdated yesterday
    AI & LLM EngineeringAuto-check: notes
  • Cost Report

    ruvnet/ruflo

    Generate a cost report showing token usage and USD costs by agent and model

    74k GitHub stars~830 tokensUpdated yesterday
    AI & LLM EngineeringAuto-check: notes
  • What Could Break

    sickn33/agentic-awesome-skills

    Find what a change breaks outside its own diff, then prove the one fact that makes it safe by running real code.

    47k GitHub stars~1.8k tokensUpdated 2 days ago
    Auto-check passed

More from hoangsonww/Claude-Code-Agent-Monitor

All 78 skills in this repo
  • Version Release

    hoangsonww/Claude-Code-Agent-Monitor

    Choose and apply the correct semantic version bump for this repository.

    1.1k GitHub stars~1.6k tokensUpdated yesterday
    Auto-check passed
  • Budget Set

    hoangsonww/Claude-Code-Agent-Monitor

    Define a spend budget for Claude Code and, optionally, create a cost alert rule that fires when usage crosses the limit, via POST /api/alerts/rules on the Agent Monitor dashboard.

    1.1k GitHub stars~1k tokensUpdated yesterday
    Auto-check passed
  • Cache Efficiency

    hoangsonww/Claude-Code-Agent-Monitor

    Analyze prompt-cache effectiveness for Claude Code usage from the Agent Monitor dashboard — cache hit rate (totalcacheread / (totalcacheread + totalinput)), cachewrite vs cacheread reuse, cache-read…

    1.1k GitHub stars~966 tokensUpdated yesterday
    Auto-check passed
  • Dag Map

    hoangsonww/Claude-Code-Agent-Monitor

    Render the multi-agent orchestration DAG for a session — parent→child subagent edges, tree depth, and fan-out — from the Agent Monitor workflow intelligence API.

    1.1k GitHub stars~564 tokensUpdated yesterday
    Auto-check passed
  • Dashboard Status

    hoangsonww/Claude-Code-Agent-Monitor

    Quick dashboard health and status overview — checks the Agent Monitor API (port 4820), reports session/agent/event counts from /api/stats, confirms WebSocket connectivity, reads the redacted hook…

    1.1k GitHub stars~600 tokensUpdated yesterday
    Auto-check passed
  • Data Export

    hoangsonww/Claude-Code-Agent-Monitor

    Export Claude Code session and analytics data in JSON, CSV, or Markdown formats.

    1.1k GitHub stars~537 tokensUpdated yesterday
    Auto-check passed

Questions about Cost Breakdown

What does Cost Breakdown do?

Break down Claude Code costs using the Agent Monitor pricing engine. Cost Breakdown is an agent skill from hoangsonww/Claude-Code-Agent-Monitor. Break down Claude Code costs using the Agent Monitor pricing engine.

When should I use Cost Breakdown?

Cost Breakdown fits situations like: analyzing spending; comparing model costs; planning budgets.

How do I install Cost Breakdown in Claude Code?

Run `npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill cost-breakdown -a claude-code`. Or copy the skill folder (plugins/ccam-analytics/skills/cost-breakdown in hoangsonww/Claude-Code-Agent-Monitor) into .claude/skills/cost-breakdown in your project. Claude Code loads it when a task matches its description.

How do I install Cost Breakdown in Codex?

Run `npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill cost-breakdown -a codex`. Or copy the skill folder (plugins/ccam-analytics/skills/cost-breakdown in hoangsonww/Claude-Code-Agent-Monitor) into .agents/skills/cost-breakdown in your project. Codex loads it when a task matches its description.

Can I use Cost Breakdown in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill cost-breakdown -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/cost-breakdown, .gemini/skills/cost-breakdown, .github/skills/cost-breakdown and .opencode/skills/cost-breakdown in your project.

What does Cost Breakdown need to run?

SKILL.md names no scripts, command-line tools or credentials: Cost Breakdown is instructions for the agent only.

Does Cost Breakdown access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Cost Breakdown safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Cost Breakdown use?

Cost Breakdown is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Cost Breakdown use?

About 845 tokens (SKILL.md is roughly 3.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Cost Breakdown?

Skills that share tags, products or a category with Cost Breakdown: Pricing (sickn33/agentic-awesome-skills, 47k stars), Cost Export (ruvnet/ruflo, 74k stars), Cost Tracking (affaan-m/ECC, 277k stars) and Cost Conversation (ruvnet/ruflo, 74k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Cost Breakdown?

hoangsonww (a GitHub user) maintains it in hoangsonww/Claude-Code-Agent-Monitor, which has 1,058 GitHub stars. The repository holds 78 skills in this directory. The repository was last updated on October 10, 2026.

Source: hoangsonww/Claude-Code-Agent-Monitor on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.