What loaded before you typed

Every Claude Code session on this machine, measured from the usage object the API returned — not from /context, which estimates client-side and is known to over-count MCP tools. This is the invoice.

Anatomy of a cold start

Median across every cold start. The top row is not logged anywhere — it is the arithmetic remainder once every component Claude Code does record is subtracted from what the API charged. Hatched bars are inferred, solid bars are read from the transcript.

Tool deferral

Split on whether a deferred_tools_delta entry is present. When it is absent, every tool schema loads upfront. Same machine, same account — an observed association, not a randomised trial.

Projects

Click a project to open its sessions. Click a session for the full breakdown and the raw usage object.

Method and limitations

What is measured

For each transcript under ~/.claude/projects/, the first assistant record carrying a usage object, excluding subagent sidechains. At that instant the only thing in context is what Claude Code put there plus the opening message. Total = input_tokens + cache_creation_input_tokens + cache_read_input_tokens.

Cold vs warm

A cold start has cache_read_input_tokens == 0. Warm starts are shown but excluded from the headline distribution, because a cache hit means part of the prefix was already paid for earlier.

Known limitations

  • Component tokens are approximate. Estimated at 4 characters per token so this stays dependency-free. Headline totals are exact — those come from the API.
  • The residual cannot be split further. Claude Code never writes the system prompt or tool schemas to disk, so its size is known but its composition is not.
  • One machine, one operator. Absolute numbers are personal. The method transfers; the numbers do not.
  • Prices are Anthropic list rates and ignore subscription plans, batch discounts and long-context surcharges. Treat cost as an order of magnitude.

Why not /context

Cameron Cooke replicated its counting logic and found it sums per-tool count_tokens calls for MCP servers, double-charging the shared schema: 45,018 reported against 15,282 real. async-let.com