How to reduce Claude Code costs
The biggest levers on Claude Code spend, from Anthropic's own guidance: clear context between tasks, pick the right model, keep CLAUDE.md short, and watch prompt-cache expiry.
Checked against sources on 2026-09-19
First, see what you're spending
Run /usage in Claude Code to see the session's tokens, estimated cost and prompt-cache hits. The dollar figure is an estimate at list price; your Console usage page is the actual bill. On a Pro or Max subscription you see plan usage instead, since the per-session cost does not change what you pay.
Anthropic's cost guide puts average spend across enterprise deployments at about $13 per developer per active day.
Clear and compact context
Use /clear between unrelated tasks — it costs nothing, and every message after it no longer re-reads the old conversation. Use /compact to summarize a long session you want to continue, optionally telling it what to keep; note that compacting a large context is itself a large request.
Match the model and thinking to the task
Sonnet handles most coding tasks for less than Opus; save Opus for complex reasoning, switch with /model, and use Haiku for simple subagents. Extended thinking is billed as output, so lower it with /effort or turn it off for routine work.
Keep always-on instructions short
CLAUDE.md loads at the start of every session, so every line in it is paid for every time. Anthropic suggests keeping it under about 200 lines and moving task-specific procedures into skills, which load only when needed. Disable MCP servers you are not using for the same reason.
Mind the prompt cache
Claude Code caches the conversation automatically, so repeated context is re-read at a lower rate. The cache lasts an hour on a subscription but five minutes by default on an API key, and the first message after it expires reprocesses the full context. Long pauses mid-session on an API key are more expensive than they look.
Plans
Claude Code needs a Pro, Max, Team, Enterprise or API account; the free plan does not include it. Pro is $20/month ($17 billed annually) and Max starts at $100/month.