AI/TLDR

Anthropic · 2026-08-14 · notable

Claude Code token costs — Anthropic explains what makes sessions expensive

Anthropic's guide explains what drives Claude Code token costs: stale context left in the conversation, mid-session model switches that break the prompt cache, and noisy command output. Cache reads cost 0.1x the input price.

Anthropic blog card for the guide on maximizing the value of Claude Code sessions

Anthropic's guide lists the habits that make a Claude Code session cost more than it needs to.

What is it?

A guide by Lydia Hallie, published by Anthropic on August 14, 2026, maps where Claude Code tokens actually go. It works through concrete habits — clearing between tasks, compacting before a break, @-mentioning files instead of typing paths, and quieting commands that dump large output — rather than general advice about writing better prompts.

How does it work?

Every turn re-sends the whole conversation, so anything left in context gets paid for again and again. Prompt caching softens that: cache reads cost 0.1x the input price, but the cache expires after one hour on a subscription and five minutes on an API key. Changing /model or /effort mid-conversation invalidates the cache, which is why the guide says to set both at the start of a session. Running a noisy command inside a subagent keeps its output out of the main conversation.

Why does it matter?

One long Claude Code session costs more than several short ones, because each turn re-reads everything before it. Developers on metered API billing, and teams watching per-seat limits, get a checklist they can apply today: /clear between unrelated tasks, /compact before stepping away, and MAX_THINKING_TOKENS or BASH_MAX_OUTPUT_LENGTH when thinking and command output are the thing filling the window.

Who is it for?

Claude Code users on API billing or tight plan limits

Try it

/context — see what is filling your Claude Code context window

Sources · 3 outlets

Tags

  • anthropic
  • claude-code
  • tokens
  • prompt-caching
  • context-window
  • cost-optimization
  • developer-tools
  • cli

← All releases · Learn AI