Claude Code token usage: what the numbers cost you
Four counters, one estimate and a monthly bill that rarely matches the screen. How to audit the gap.
·3 min read
Claude Code token usage is not one number. It is four counters, and the largest one is usually the cheapest. A session with a huge total can cost less than a short one that keeps missing the cache, so an audit starts with the shape of the usage.
The four counters
| Counter | What it measures | Where it appears |
|---|---|---|
| Input | Tokens sent that were not served from cache | Usage by model |
| Output | Generated tokens, thinking included | Usage by model, turn counter |
| Cache write | Content written into the prompt cache | Usage by model, cache line |
| Cache read | History served from the cache | Usage by model, cache line |
Anthropic bills thinking tokens as output. Cache reads and writes are priced differently from plain input, and its pricing page lists the rates per model.
Why the biggest count is often the cheap one
Claude Code sends the conversation with every request, so the same history is processed again and again. Prompt caching keeps that affordable: repeated content is served from the cache at a lower rate instead of being charged as fresh input. In a long session the cache read line can dwarf everything else, and that is the system working.
It stops working in two places. A break longer than the cache lifetime causes a miss, and the next request reprocesses the full context. A change to tools or the system prompt can invalidate the cache too, which is why the prompt cache line names a likely cause.
Turning tokens into money
Cost is token counts multiplied by per-million rates, with a different rate for each model and a different treatment for cache traffic. Claude Code computes the figure locally at list price, unless an administrator sets a modelPricing table, and Anthropic calls the result an estimate.
For a sanity check, Anthropic's cost guide, read in November 2026, puts enterprise averages at around $13 per developer per active day and $150 to $250 per developer per month, with costs below $30 per active day for 90 percent of users. An estimate far outside that range points at the model mix first.
A five step audit
- Open /usage and switch to the 7 day view with w. Write down tokens and the estimated cost.
- Read the usage by model lines. Opus share is the fastest explanation for a jump.
- Check the prompt cache line. A low share of input from cache means misses.
- Compare days. The CLI stops at seven days and deletes session files after cleanupPeriodDays, 30 days by default.
- Reconcile. UsageAtlas is a free, open-source desktop tracker that reads local usage from Claude Code and the other coding tools it supports, and keeps daily totals for tokens, requests, models and estimated cost. It needs no account for local tracking, does not read prompts or responses, and an optional free account saves history.
Where the audit goes wrong
Two mistakes cover most of it. Comparing raw token totals between tools, when each counts cache traffic differently, produces a number that means nothing. Treating the local estimate as the amount owed produces a surprise at the end of the month. Use the estimate to find the expensive day, and the provider's billing page to settle it.
FAQ
Why is cache read so much larger than input?
Because the conversation is re-sent with every request and most of it comes back from the cache. A large cache read count is normal in a long session, and it is priced below plain input.
Are thinking tokens counted?
Yes. Anthropic bills thinking tokens as output, so a large thinking budget appears in the output column.
Can I audit a full month?
Not from /usage alone, which stops at seven days, and not from local files once cleanupPeriodDays removes them. Daily totals kept by a tracker are the practical way to hold a month together.