
7 Ways to Reduce Claude Code Token Usage
A practitioner writeup on cutting Claude Code token usage by managing context rather than prompts: switching models (Sonnet/Opus/Haiku) by task complexity, keeping CLAUDE.md lean since it persists every turn, offloading verbose exploration to subagents with isolated context windows, pointing Claude at exact files/line ranges instead of open-ended repo searches, running /compact proactively before context bloats, using /context to spot the "quiet offender" consuming tokens, and limiting connected tools/MCP integrations. The core argument is that token waste comes from accumulated context (files read, tool outputs, memory files) rather than prompt length.
What it claims
Claude Code cost is driven by accumulated context (prior messages, files read, tool outputs, CLAUDE.md, background instructions) that gets resent every turn, not by prompt length. Beyond the tactics the summary lists, the page puts concrete numbers and commands on the advice.
How to use it
The specifics worth carrying:
- Model cost gap: on API billing, Opus costs 5x more than Sonnet per token; heavier models also drain subscription quota windows faster. Start every session on Sonnet, escalate to Opus only for multi-file architecture or gnarly cross-system debugging, drop to Haiku for lookups/formatting/renaming.
/effort: lowers the model's thinking budget for straightforward tasks, directly cutting output tokens — separate lever from model choice.- CLAUDE.md math: it is never lazy-loaded or evicted, so a 5,000-token file costs 5,000 tokens on every turn whether you send 2 messages or 200. Keep it a lookup table (test commands, package manager, formatting rules, dirs to avoid), not a brain dump.
- Plan mode (Shift+Tab): Claude emits a step-by-step plan with no changes; you prune it, then switch back. Targets the biggest waste source — trial-and-error execution where each failed iteration costs tokens.
/compacttiming: compact early, while the session is still "healthy," not after a context warning. An overloaded session produces a worse, noisier summary./context: diagnostic to find the "quiet offender" (a big file read earlier, accumulated tool output) before changing your workflow.
Limits
- Subagents are not automatically cheaper. The page explicitly flags that for small tasks — simple shell actions, quick git ops — a subagent can be wasteful because its architecture adds overhead via prompts, tool definitions, and extra tool-call round trips. The rule is to use them only when the saved main-context clutter outweighs the startup overhead.
- Claims are practitioner experience and "community testing," not benchmarked measurements; no before/after token counts are given for any tactic beyond the 5x Opus/Sonnet ratio.
- Guidance is workflow-level and will drift as Claude Code's commands and defaults change.
Organisations named here
- Claude Code
- Kanwal Mehreen
Technologies named here
- Claude Code
- Sonnet
- CLAUDE.md
- Opus
- Subagents
- Haiku
- /model
- /effort
- /compact
- /context
- Plan mode
Techniques named here
- Switching models by task complexity
- Delegating verbose work to subagents
- Pointing Claude to exact files and line ranges
- Proactive compaction
- Checking context before optimizing
- Keeping tooling setup simple
Related in coding-agents
