See what your AI coding habit would cost if you paid per token.
Claude Code and OpenAI Codex both run on flat subscriptions right now. This tool reads your local session logs, adds up the tokens by model, and prices them at current API list rates. It answers one question: what would the last month of my usage cost on the API meter?
If you run these tools on a subscription, treat the number as a pay-as-you-go comparison, not a bill.
Point your coding agent (Claude Code, Codex, Cursor, etc.) at this repo and say:
Run the analysis in this repo on my usage.
Or run it yourself:
python3 analyze.py # last 30 days
python3 analyze.py --days 7 # last 7 daysYou get a summary in the terminal, a machine-readable usage.json, and a shareable report.html.
- Claude Code —
~/.claude/projects/**/*.jsonl(per-messageusage+model) - OpenAI Codex —
~/.codex/**/rollout-*.jsonl(cumulativetoken_countevents)
Everything runs on your machine. Nothing is uploaded. The generated usage.json and report.html contain your numbers and are gitignored by default.
Rates live in pricing.json as per-million-token prices. Update them when providers change pricing. Cache is handled per provider: Claude bills cache writes at 1.25× input and cache reads at 0.10× input; Codex bills cached input at its own cached rate with no separate write charge.
- Codex token counts exclude OpenAI's 2× surcharge on turns over 272K context, so Codex is slightly conservative.
- Numbers come from one machine. Usage on other machines isn't counted.
- Models not listed in
pricing.jsonare skipped — add them to include them.
MIT. Built at Runpoint.