Skip to main content
skill CX Codex

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.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add daymade/claude-code-skills --skill claude-usage-analyst -a claude-code
Open on GitHub

What 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-code

2Manually: put the files in place

~/.claude/skills/claude-usage-analyst/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/claude-usage-analyst/

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

Similar skills

All skills for Agent setup: memory, context, orchestration →

From the same set64

bigdata-skill Extracts structured Bigdata.com (RavenPack) financial and news data via SDK and REST API. Built for data pipelines when MCP tear sheets lack machine-readable fields. CX Codex +1 473installs auto-repo-setup Diagnoses and repairs repository setup, startup sync and hooks. Useful when a repo won't run or you need guarded commit and push. CX Codex +1 469installs pdf-to-html Turns a PDF into one self-contained HTML file that keeps images, tables and reading order. Handy when you want to read a report on your phone instead of scrolling pages. CX Codex +1 458installs terminal-screenshot Renders colored terminal output into a PNG image. It lets the agent visually verify syntax themes and contrast instead of guessing from ANSI codes. CX Codex +1 433installs marketplace-health-check Runs a parallel audit of a skills marketplace repo: script safety, docs, PII, open PRs and issues, manifest integrity. CX Codex +1 389installs llm-eval-harness This skill probes a third-party LLM endpoint across six dimensions: availability, request fidelity, speed, concurrency, protocol compliance and quality regression. CX Codex +1 372installs github-sensitive-data-cleanup Scans and removes secrets, tokens, and personal data from Git history, then verifies and pushes safely. Use it after accidentally leaking credentials to a GitHub repository. CX Codex +1 353installs claude-switch-models-setup Sets up isolated profiles to run multiple providers like Kimi, DeepSeek, and Anthropic in separate terminal windows. It stops configuration drift while sharing common skills and hooks. CX Codex +1 344installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor