How do I check what used my Claude Code tokens?

Start with /context in the active session. It shows what takes up space in the current context window. To explain usage across the whole session, inspect its request history. The same file can occupy space once and be read across many requests.

If your team exports Claude Code telemetry, open its logs and filter by session.id. Select claude_code.api_request events. Keep one record per request ID. If you need to enable logging first, capture a new session after setup. Claude Code telemetry setup guide.

Look for four counters on each request. Here is a shortened, illustrative log entry. Anthropic’s event field reference.

{
  "input_tokens": 120,
  "cache_creation_tokens": 0,
  "cache_read_tokens": 22000,
  "output_tokens": 80
}

Claude processed 22,200 tokens on this call. It reused 22,000 tokens of earlier context, read 120 fresh input tokens, and generated 80 output tokens. The zero means it wrote no new tokens to the cache on this call.

Do cache reads explain a high Claude Code bill?

They can. Check both the count and the rate. A cache read can make up most of a session’s tokens while cache writes account for more of its cost.

Suppose the call above belongs to a 100,000-token session. Add each counter across the session. Multiply each subtotal by its price per million tokens and divide by one million. This example uses illustrative API rates and five-minute cache writes. For your session, use the rates for its model and cache duration. Anthropic’s prompt caching guide.

Illustrative session · 100,000 tokens · $0.0819 estimated API cost
Token typeTokensToken shareRate per 1MAPI costCost share
Fresh input1,0001%$3.00$0.0034%
Cache writes (5 minutes)10,00010%$3.75$0.037546%
Cache reads88,00088%$0.30$0.026432%
Output1,0001%$15.00$0.01518%

Here, 88% of tokens came from cache reads. They cost about 2.6 cents. Cache writes accounted for only 10% of tokens but cost 3.75 cents. If yesterday’s session cost more than today’s, compare the write totals before you shorten your prompts.

Why did token usage spike after a short follow-up?

Find the first request where a counter jumps. Then look at what happened immediately before it.

  • Fresh input jumped. Check the previous tool result. A test run may have returned a full log when the failing assertion would have been enough.
  • Cache writes jumped. Check whether the session resumed after a break or the beginning of the prompt changed. Either can require Claude to cache context again.
  • Cache reads stayed high. Count the requests. Ten calls that each reuse 20,000 tokens add 200,000 cache reads to the session.
  • Output jumped. Inspect generated patches and tool calls as well as the final reply. A short summary can follow a long code edit.

How can I reduce token usage on the next task?

Change the part that drove the spike. If a command returned thousands of lines, ask for the failing test and its stack trace. If earlier debugging history still fills the window, use /compact to keep a summary. Start a fresh session when you switch to an unrelated task.

When searches reach neighboring projects, test which files Claude can read and measure the tokens spent on extra searches.

Repeat a comparable task with the same model. Compare request count, cache writes, and estimated cost per completed fix. Keep the change if the fix still passes its tests and costs less. Claude Code cost management guide.

What does the dollar estimate mean on Claude Pro or Max?

It estimates what the same requests would cost at API rates. For usage covered by a subscription, your plan determines what you pay. Check /usage for your plan limits and your account for any separately billed usage. To investigate a team-wide spike, group the same request records by developer and model. Track Claude Code cost per developer.