# Claude Code token costs — Anthropic explains what makes sessions expensive

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

- Org: Anthropic
- Date: 2026-08-14
- Category: tutorial
- Source: https://claude.com/blog/maximizing-the-value-of-your-claude-code-sessions
- Canonical page: https://ai-tldr.dev/releases/anthropic-claude-code-session-costs/

## In short

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.

## What it is

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 it works

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 it matters

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 it's for

Claude Code users on API billing or tight plan limits

## Try it

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

## Links

- [Anthropic Guide](https://claude.com/blog/maximizing-the-value-of-your-claude-code-sessions)
- [Cost Docs](https://code.claude.com/docs/en/costs)
- [HN Discussion](https://news.ycombinator.com/item?id=49300800)
