guide · claude code cost

How to cut Claude Code token costs: where the tokens actually go

When people try to make Claude Code cheaper, they usually look at the model's answers. In our own logs, the answers were the smallest part of the bill. Most of the money went on re-reading context that was already there, and on rebuilding the prompt cache after it went cold.

Updated 19 November 2026 · Prices are Anthropic's API list prices. On a Pro or Max plan you pay a flat fee, but the same waste uses up your plan's limits faster.

A real month, by cause

This is one month of Priberry's own Claude Code use, read from the logs Claude Code keeps on disk and priced at API rates:

  $6,720 API-equivalent spend · 254 sessions · 79,905 API calls

  Reading cached context     $3,809
  Writing to the cache       $2,072
  Output (thinking incl.)      $838

  ~82k tokens load before you type a word.
  Coffee-break tax: $722 re-caching after 636 pauses.
  Sub-agents spent $2,734 (41%).

Your numbers will differ. To see your own, run npx tarelab. It reads the same local logs, uploads nothing and never calls a model.

How Claude Code is billed, in one minute

Every message re-sends the whole conversation: your instructions, every file it read and every command output so far. The prompt cache makes that affordable. Reading from the cache costs a tenth of the normal input price. Writing to it costs more than normal input: 1.25× for the standard 5-minute cache, 2× for the 1-hour cache. As long as the cache stays warm, each message pays mostly cheap reads. When it goes cold, the next message writes the whole context again at the higher price.

Seven ways to cut the cost

1. Mind the coffee-break tax

The standard cache lives for about five minutes after the last use. Step away for longer and the next message re-writes everything. In the month above that happened 636 times and cost $722. You don't have to stop taking breaks. Finish a step before you leave, start a new session for a new task instead of reviving a huge old one, and know when the cache is about to expire. tare fix adds a status line that counts down to the cache going cold and shows what the next message will cost warm versus cold.

2. Shrink what loads before you type

CLAUDE.md files, MCP tool definitions and skills load into every session before your first word. In our case that was about 82,000 tokens, and every later message re-reads it. Remove MCP servers you don't use in this project, keep CLAUDE.md to what the agent really needs, and move rarely used instructions into files it reads only when needed.

3. Keep big command output out of the context

A test run or build log that prints thousands of lines stays in the conversation and is re-read on every later call until the conversation is compacted. Tare calls this the carry cost. Ask for targeted commands (one failing test, the last 50 lines), or let tare fix install its output trim: output over about 2,500 tokens is cut to the start, the lines that look like failures and the end, and the full output is saved to a file the agent can open.

4. Don't switch models mid-session

The cache belongs to one model. Switching models in the middle of a long session means the next message builds a new cache from scratch. Pick the model at the start of a task, or switch at a natural break.

5. Use sub-agents on purpose

Each sub-agent builds its own context. They're worth it for real parallel work or for keeping a noisy search out of the main conversation. In the month above they spent 41% of the total, so it's worth checking they earned it.

6. Don't rewrite the history to save tokens

Tools that edit or summarise earlier messages to make the context smaller break the cache, and the rebuild often costs more than the tokens saved. Cut waste where it enters the context, as in 3, and leave what's already there alone.

7. Measure before and after

A change that feels cheaper isn't always cheaper. Some cut tokens but make the agent fail more often. tare receipt compares cost per commit before and after your changes, with a 90% range, and checks that as many sessions still reach a commit. With fewer than 8 finished sessions on either side it says "not enough data" instead of guessing.

See where your tokens go

One command reads the logs Claude Code, Codex CLI, Gemini CLI, Cline, Roo Code and Kilo Code already keep on your machine. Free, open source, nothing uploaded.

npx tarelab

Source on GitHub · How Tare works