claude-usage-analyst — Claude Code skill: token and cost breakdown
This skill explains where your Claude tokens and money went, reading ccusage data for model mix, cache and 5-hour blocks.
npx skills add daymade/claude-code-skills --skill claude-usage-analyst -a claude-codeWhat claude-usage-analyst does
The skill reads local Claude logs through ccusage and turns them into a readable report: total tokens, estimated cost, which model burned the most. Cache gets its own section, because cache read tokens still pressure your quota even though you never typed those words.
A bundled script, scripts/analyze_claude_usage.py, runs over a date window and a timezone. The default window is today in the chosen timezone, so for a historical comparison you have to set --since yourself — otherwise the rank and median fields describe a single day. Pass --model-a and --model-b to compare two models.
Check that ccusage is present first: ccusage --version. If it is missing, install it with npm install -g ccusage@latest or run npx ccusage@latest. One caveat worth knowing: ccusage claude covers local Claude logs, including Claude Desktop sessions when those logs exist, but it is not a full bill for ordinary Claude.ai chats. Exact plan quota rules cannot be inferred from local token counts, so the skill calls it quota-like pressure unless you supply plan details.
What it helps with
- find out why the Claude quota ran out
- count tokens spent today and on earlier days
- compare two models by token volume and cost
- explain cache reads to someone non-technical
- break usage down by 5-hour blocks
Example prompts for the agent
- Why did my Claude quota run out? Walk through the ccusage data.
- Compare fable and opus-4-8 by tokens and cost this month.
- How many tokens did I spend today, and what did that cost?
How to install claude-usage-analyst
1Skills CLI (Vercel)
npx skills add daymade/claude-code-skills --skill claude-usage-analyst -a claude-code2Manually: put the files in place
~/.claude/skills/claude-usage-analyst/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/claude-usage-analyst/
1Skills CLI (Vercel)
npx skills add daymade/claude-code-skills --skill claude-usage-analyst -a codex2Manually: put the files in place
.agents/skills/claude-usage-analyst/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add daymade/claude-code-skills --skill claude-usage-analyst -a cursor2Manually: put the files in place
.cursor/skills/claude-usage-analyst/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install daymade/claude-code-skills claude-usage-analyst2Manually: put the files in place
.github/skills/claude-usage-analyst/SKILL.md1Skills CLI (Vercel)
npx skills add daymade/claude-code-skills --skill claude-usage-analyst -a gemini-cli2Platform CLI
gemini skills install https://github.com/daymade/claude-code-skills --path daymade-claude-code/claude-usage-analystManually: put the files in place
.devin/skills/claude-usage-analyst/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add daymade/claude-code-skills --skill claude-usage-analyst -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about claude-usage-analyst
How do I install claude-usage-analyst in Claude?
Run npx skills add daymade/claude-code-skills --skill claude-usage-analyst -a claude-code. The skill file then lands at ~/.claude/skills/claude-usage-analyst/SKILL.md.
What does claude-usage-analyst do?
It pulls ccusage data from local Claude logs and explains token spend, cost, model mix, cache activity and 5-hour blocks. Observed numbers stay separate from interpretation.
Does the skill need ccusage installed?
Yes, it works from ccusage output. Check ccusage --version; if the command is missing, install it with npm install -g ccusage@latest or run npx ccusage@latest.
Source text
SKILL.md · MIT
---
name: claude-usage-analyst
disable-model-invocation: true
description: Analyze Claude Code and Claude Desktop Code token usage, cost, quota burn, model mix, cache read/write, and 5-hour block consumption using ccusage evidence. Use when the user asks why Claude quota was exhausted, whether a model such as fable/opus/sonnet is unusually expensive, how many tokens were spent today or historically, or needs a human-friendly explanation of local Claude Code CLI/Desktop usage.
---
# Claude Usage Analyst
## Overview
Use this skill to produce evidence-based usage explanations from local `ccusage` data. Separate observed numbers from interpretation, and explain quota burn in human terms.
## Workflow
1. Verify `ccusage` is available:
```bash
ccusage --version
```
If missing, install or update with `npm install -g ccusage@latest` or run with `npx ccusage@latest`.
2. Run the bundled analyzer for the requested window:
```bash
python3 /path/to/claude-usage-analyst/scripts/analyze_claude_usage.py \
--since YYYY-MM-DD --until YYYY-MM-DD --timezone Asia/Shanghai
```
Default `--since/--until` is today in the selected timezone.
For historical comparison, set `--since` to an earlier date such as the first day of the month; otherwise rank/median fields only describe the single target day.
3. If the user asks about a specific model comparison, pass aliases:
```bash
python3 scripts/analyze_claude_usage.py --model-a fable --model-b opus-4-8
```
4. Read `references/explanation-guide.md` when writing the final answer.
## Evidence Rules
- Base numeric claims on `ccusage` output or the bundled analyzer output.
- State the scope: `ccusage claude` measures local Claude Code usage logs, including Claude Desktop's Claude Code sessions when those local logs exist. It is not a complete ordinary Claude.ai chat bill.
- Report dates with timezone.
- Explain cache clearly: cache read tokens are still usage/quota pressure even though the user did not type those words.
- Do not infer Anthropic plan quota rules from local token counts unless the user provides plan details. Say "quota-like pressure" or "ccusage estimated cost/token burn" when exact plan accounting is unknown.
- When comparing models, compare both token volume and estimated cost. A model can have similar token volume but higher cost.
## Output Shape
Use this structure unless the user asks otherwise:
1. Short conclusion in plain language.
2. Evidence table: total tokens, cost, input, output, cache create, cache read.
3. Model comparison table.
4. 5-hour block table when quota exhaustion is discussed.
5. Explanation of why the burn happened.
6. Confidence and caveats.
Keep the answer readable for non-technical users. Avoid unexplained terms like "cache read" without a one-sentence translation.
© daymade · MIT · daymade/claude-code-skills