Claude Code
Claude Code Token Usage
Understand and optimize Claude Code tokens.
Break down input, output and cache tokens to find expensive context and inefficient workflows.
Claude Code token usage should be analyzed by token type, model, user, project and workflow. Input context, tool results, cache writes, cache reads and generated output have different cost behavior and should not be combined into one unexplained total.
Token breakdown
Keep the provider usage categories intact so optimization points remain visible.
- Base input tokens
- Cache creation tokens
- Cache read tokens
- Output tokens
- Model and long-context pricing tier
Reduce usage safely
Evaluate savings against a stable task set and quality threshold.
- Exclude irrelevant repository context
- Limit verbose tool output
- Reset or summarize stale sessions
- Reuse stable instructions through caching
- Use capable lower-cost models for routine work
FAQ
Why does Claude Code use many input tokens?
Coding workflows can include repository files, tool schemas, tool results and conversation history. Inspect context composition before assuming the model output is the main cost driver.
Are cached tokens free?
No. Anthropic prices cache writes and reads differently from base input tokens; use current official pricing when estimating cost.