billproof · v0.1

Prove your AI bill.

billproof is a free command-line tool that reads the Claude Code, Codex and Gemini CLI transcripts already on your disk, prices every request the way the provider bills it, and tells you which turns cost the money and why. Nothing leaves your machine.

$ npx billproof
True cost at Anthropic list price, one machine, 2026-07-29 to 2026-09-02 $12,573.4948,522 requests · 41 sessions
categorytokenscostshare
uncached input510k$3.520.0%
cache write 5m (1.25x)90.4M$667.265.3%
cache write 1h (2x)120.5M$1,458.9211.6%
cache read (0.1x)16.01B$9,367.2474.5%
output35.4M$1,076.568.6%
what a naive counter reportstotalerror
sums every transcript line$27,773.46+121.0%
every cache write priced as 5-minute$12,020.86−4.4%
cache tokens priced as input$96,481.71+667.6%
cache tokens ignored$1,078.25−91.4%

Real output from the author's machine. Prices from platform.claude.com/docs/en/about-claude/pricing, fetched 2026-09-02.

Three ways counters lie, all measured before a line of this was written

Claude Code writes the exact usage object Anthropic billed into every transcript. The numbers are all there. Reading them correctly is the hard part.

+121%

One response is several lines

Claude Code writes one JSONL line per content block, each repeating the full usage. Thinking + text + tool call = counted three times by anything that sums lines. billproof dedupes by message id.

−37.5%

Two cache tiers, two prices

A 5-minute cache write is 1.25x base. A 1-hour write is 2x. More than half of all turns on this machine used the 1-hour tier. Pricing everything at 1.25x under-reports every one of them.

×6.7

Cache reads are 0.1x, not 0 and not 1

Ignore reads and you under-report by ~90%. Price them as input and you over-report by ~670%. Both mistakes have shipped in real tools this year; the fixes were merged by the author of this one.

How to see what your Claude Code sessions actually cost

  1. Run the free scan. npx billproof reads the transcripts already on your disk and prices every request at list price, including both cache-write tiers and cache reads.
  2. Read the naive-counter panel. It shows what four common counting methods would have reported and how far off each is, so you can tell whether your own dashboard shares the defect.
  3. Get a receipt for one session. billproof receipt --last lists every turn as a line item with its root cause: cache expired, one-hour writes, model switch, prefix changed, fast mode or server-side fallback.

billproof and ccusage

ccusage is the free CLI most people reach for, and it prices Claude Code sessions correctly: its source, read on 2 September 2026, applies the 2x rate to one-hour cache writes and de-duplicates transcript lines by request id. billproof exists for the questions that come after the total.

questionccusagebillproof
What did my sessions cost, with both cache-write tiers and cache reads priced?yes; free; Claude Code, Codex, Gemini CLI and a dozen other agentsyes; free scan; Claude Code, Codex and Gemini CLI
Which turn cost the money, and why?totals by day, session, model and billing blocka receipt: every turn as a line item with a root cause (cache expired, one-hour writes, model switch, prefix changed, fast mode, server-side fallback)
How far off would a naive counter have been?not shownfour naive methods and each one's error, measured on your own transcripts
Does the Anthropic invoice match our own records?not a featurereconcile: the organisation's usage and cost reports against local records, day by day and model by model, every difference labelled by cause
Pricefreescan free; receipt $49 once; reconcile $199 once per organisation

The receipt: which turns cost the money, and why

The free scan tells you the true number. The receipt tells you what caused it, turn by turn, with the dollars each cause explains and the evidence fields that fired the rule.

billproof receipt 3860e21c · claude-home · 5,409 requests · Total $1,280.59
causeturnsattributedmeaning
context-heavy4,308$987.04large context read on every turn
subagent1,482$119.71work done by subagents
cache-expired14$50.73idle past the TTL; whole context re-written at write price
one-hour-write3,926$50.721-hour writes cost 2x base, 5-minute 1.25x
#gapw1hread
4069h idle600k0
19611h idle783k0
3863m592k0

Turn 386 re-wrote 592k tokens three minutes after the previous turn, with zero cache reads. That is not an expiry; the prompt prefix changed. billproof labels it prefix-changed.

causerule, in plain words
cache-expiredIdle longer than the cache TTL of the previous write, then most of the context re-written. Attributed: the write-minus-read premium on every re-written token.
prefix-changedRe-written inside the TTL with few reads. Compaction, an edited system prompt or a changed tool list broke the cached prefix.
one-hour-writeThe 0.75x premium of the 1-hour tier over the 5-minute tier, on every 1-hour token.
model-switchCaches are per model. Switching re-writes the context.
context-heavy100k+ tokens of context read on the turn. The reads themselves.
output-heavy · uncached-paste8k+ output tokens; 20k+ uncached input tokens (a paste, an image).
subagent · fast-mode · us-only-geo · fallbackSubagents on their own cache lane; the 2x fast-mode premium; the 1.1x US-only premium; a server-side fallback that billed the declining model's partial output.

Price

scan
$0
  • True cost by day, model, project, skill, MCP server, subagent
  • The four naive methods, and how far off each is
  • JSON output; incremental cache; nothing leaves the machine
npx billproof
reconcile
$199once, per organisation
  • Your organisation's Anthropic usage and cost reports against your own records, day by day and model by model
  • Every difference labelled with its likely cause: reads counted twice, a wrong rate, a machine you did not know about, a discount you did not know you had
  • Local side is the Claude Code transcripts or a JSON export from your own metering; needs an Admin API key
Buy · card or UPI
One key per organisation, activated on up to 10 machines; the key itself carries the tier.

Questions

I am on Claude Pro or Max. I do not pay per token. Why would I care?
Subscriptions do not bill per token, but the usage window drains in proportion to what the same requests would cost at API list price. billproof shows that number and says so plainly. When a window jumps from 20% to 90% in one turn, the receipt names the turn and the reason.
Does anything leave my machine?
No. The scan and the receipt read ~/.claude/projects locally and write nothing anywhere else. The only network call the tool ever makes is validating a license key when you run activate. The source is public so you can check.
How do you know the prices are right?
Every price row in the table cites the official pricing page and the date it was fetched. Every pricing rule and every root-cause rule is a unit test. Legacy models not on the current page are flagged price-unverified whenever they are used instead of being silently guessed.
Which tools does it read?
Claude Code transcripts today. OpenAI Codex and OpenCode logs are next. Reconciliation against the Anthropic and OpenAI cost APIs for organisations is on the roadmap.
How do I get the key after paying?
It is emailed to you straight after checkout, and shown on the receipt page. Nothing waits on a human. Paste it into billproof activate <key>. The checkout is a merchant of record, so EU and UK VAT is handled on the invoice you receive.
Refunds?
If the receipt tells you nothing the free scan did not, reply to your receipt email within 14 days and you get the $49 back.
What does reconcile need that receipt does not?
An Anthropic Admin API key, which only organisation accounts have, and the Team licence. It reads two Admin endpoints, the usage report and the cost report, and compares them with the records on your side. Nothing else leaves the machine.

Arthi Arumugam works on whether a reported number is true. 24 merged upstream fixes in LLM cost and token accounting across inspect_evals (UK AI Security Institute), TruLens (Snowflake), lm-evaluation-harness, Pydantic Logfire and genai-prices, Mistral, LiveKit, Pipecat, deepset and Roboflow; most of them the same defect this tool exists to catch: a number comes out wrong and nothing raises. GitHub