Claude Code Usage Report (Free)

Find out which projects, models and sessions eat your Claude Code usage, in one command.

Claude Code Usage Report (Free) product illustration

What it does

See what your Claude Code usage adds up to: tokens and API-equivalent cost by day, month, project, model, session and 5-hour window, straight from the logs Claude Code already writes on your machine.

  • One Python file, standard library only (Python 3.9+). No install, no account, no network. Nothing leaves your machine.
  • Reads ~/.config/claude/projects and ~/.claude/projects, or the folders in CLAUDE_CONFIG_DIR (comma-separated), or --dir.
  • Prices from Anthropic's pricing page (checked 2026-11-10): 5-minute and 1-hour cache writes, cache reads, fast mode, the Haiku 5.5 over-100k-token tier, and the lower cache-read rates on Fable 5.x, Mythos 5.x, Opus 5.5 and Sonnet 5.5.

What you get

The screenshot is real output from the kit’s own commands. Tested from a fresh download of this exact zip: ./run_tests.sh ran 21 tests OK on Python 3.13 and 3.10.

Real terminal output from Claude Code Usage Report: demo and passing tests

Use it

python3 usage_report.py                       # last 7 days, by day
python3 usage_report.py monthly
python3 usage_report.py projects --since 2026-10-01
python3 usage_report.py models
python3 usage_report.py sessions --limit 10
python3 usage_report.py blocks                # 5-hour windows, like Claude Code's usage limits
python3 usage_report.py daily --tz America/New_York --compact
python3 usage_report.py daily --json          # or --csv, --md (paste into a PR or notes)
python3 usage_report.py models --project webshop

Try it on the bundled sample logs first: ./demo.sh.

What "API cost" means

It is what the same tokens would cost at Anthropic API list prices. If you are on a Pro or Max plan you pay the subscription, not this number. It is still the best way to see which projects, models and sessions use the most, and whether a plan is worth it.

How it counts

  • Claude Code writes several copies of a streamed reply. Lines with the same message id and request id are counted once (the most complete copy is kept).
  • <synthetic> and API-error lines are skipped. Lines that are not valid JSON are skipped.
  • A cost recorded in the log (costUSD) is used as is. Otherwise the cost comes from the price table at the top of usage_report.py.
  • Models with no published price (for example old Claude 3.x ids) are counted in tokens but not priced; totals then show *.
  • Days and windows use your local time zone, or --tz.
  • 5-hour windows start at the hour of the first message and close after 5 hours (a new window also starts after a 5-hour gap).

How it was tested

./run_tests.sh runs 21 tests on sample logs: costs worked out by hand for every price rule, de-duplication, skipped lines, time zones, date filters, all six reports, JSON/CSV/Markdown output and the CLI's error messages. Tested on Python 3.13 and 3.10.

Honest limits

  • Prices change. They live in one table at the top of the file with the date they were checked; update it when Anthropic changes them.
  • It does not price the US-only inference multiplier, Batch API discounts, or server-tool fees such as web search.
  • Claude Code's log format is not a public API and may change.
  • It shows API-equivalent cost, not your remaining plan limit.

Format and license

Zip, 12 KB, v1.0, 8 files. Free to use, modify and share for any purpose, including commercial work, as long as this notice stays in copies. Not affiliated with or endorsed by Anthropic.

FAQ

Does it send my data anywhere?
No. It only reads files on your machine and makes no network calls.
I'm on Max, why does it show dollars?
It shows what the tokens would cost at API list prices, so you can compare against your plan.
Prices changed, now what?
They live in one table at the top of usage_report.py with the date they were checked.
How do I get the files?
Click Download free. The zip downloads straight away: no checkout, no account.
Do I have to sign up for the newsletter?
No. The form is optional and the download works without it.

Get Claude Code Usage Report (Free)

Free CLI: see Claude Code tokens and API-equivalent cost by day, project, model, session and 5-hour window from local logs. No install, offline.

Pairs well with

Download$12

Cursor Rules for Go

Cursor rules for Go: 7 scoped .mdc rules for errors, concurrency, net/http, testing, modules and JSON, current to Go 1.27, with a tested sample app.

View Cursor Rules for Go
Download$29

Excel MCP Server

Excel MCP server: read sheets and tables, profile columns, trace broken formulas to their source, and edit safely with backups. Python, 26 tests.

View Excel MCP Server

Related

1 email a week: new x402 + MCP tools and free kits.

Short weekly digest of new x402 + MCP tools and free kits, including the MCP OAuth Checker. The download above works without signing up. No spam, unsubscribe any time.