Anthropic explains how to save tokens in Claude Code
Anthropic published a practical guide to reduce wasted tokens in Claude Code. Its recommendations include choosing the right model, preserving the prompt cache, keeping context focused and isolating long or noisy tasks.
Summary
Anthropic published a guide with recommendations for using Claude Code more efficiently and avoiding tokens spent on context, file reads or responses that do not contribute to the task. The company’s point is that saving tokens does not always mean using fewer of them, but making sure the tokens used serve the requested goal.
In practice
The first decision is to match the model and effort level to the work: larger models and more reasoning for difficult or ambiguous problems, and lighter settings for routine tasks. Anthropic recommends checking `/model` and `/effort` at the start of a session and avoiding changes halfway through, because switching can invalidate the conversation cache.
Prompt caching lowers the cost of resending parts that have not changed. To preserve it, Anthropic recommends changing the model, effort or fast mode at the start of a session, using `/rewind` to remove only the latest turns when needed, and reserving `/compact` for summarising a conversation that will continue.
Context
Each turn resends what has entered the conversation: files that were read, command results, instructions and test output. Even when those tokens are served from cache, they still occupy context and are considered by the model. Anthropic therefore recommends pointing directly to the relevant file, for example with `@file`, keeping general instructions short in `CLAUDE.md` and moving task-specific instructions into skills.
The company also advises reducing command output with quiet flags, `tail` or more compact reports. For tasks that produce a lot of information but do not need to remain in the main conversation — such as log analysis — a subagent can work in a separate context and return only its conclusion. The trade-off depends on the task: for small jobs, the extra context may not be worth it.
Why it matters
- Matching the model and effort level to the task can avoid paying for reasoning capacity the work does not require.
- Preserving the cache makes it cheaper to continue a session, but mid-session changes, compaction and long pauses can force the context to be rebuilt.
- `/clear` between tasks, `/compact` when a task is complete and quieter command output keep the conversation shorter and more relevant.
- The recommendations do not guarantee a fixed cost reduction: the result depends on the model, plan, session length, tools and task complexity.
