$ npx ccusage@latest copy
What it does
ccusage reads the local JSONL files Claude Code writes per session and turns them into readable reports — daily, weekly, monthly, per-session, and per 5-hour billing window — so you can actually see how tokens and cost are trending.
Features
- Multiple report views — daily, weekly, monthly, session, 5-hour billing window
- Per-model breakdown — see token spend by Opus vs. Sonnet vs. Haiku
- Cost estimation — USD cost based on current pricing
- Zero setup — reads local JSONL, no auth or API needed
- Fast —
npx ccusage@latestand you have a report
Use cases
- Check monthly token usage and cost for budget planning.
- Monitor per 5-hour block consumption to avoid hitting limits.
- Compare session-by-session consumption to refine your prompting strategy.
When to use it
- Monitor daily spend during a heavy coding push
- Compare model usage ratios before switching defaults
- Spot anomalies (e.g. a runaway session) after the fact