Claude Code, Codex and Cursor
How do I reduce Claude Code token usage?
Alexandru Lupascu, CTO & Co-founder · Updated
According to Anthropic's Claude Code cost docs, the two highest-impact habits for reducing token usage are clearing context between unrelated tasks with /clear and matching the model to the job, because Claude Code sends your full conversation with every request. The same docs say "token costs scale with context size" and put the average enterprise cost at around $13 per developer per active day and $150-250 per developer per month, with costs below $30 per active day for 90% of users. Run /usage and /context before changing anything, so you can see where your tokens go.
Which Claude Code commands and settings reduce token usage?
Clear, compact, pick a smaller model and keep context lean. From Anthropic's "Reduce token usage" guidance:
| Action | How | Why it saves tokens |
|---|---|---|
| Clear between tasks | /clear (run /rename first) | Stale context is re-sent with every message |
| Compact with a focus | /compact Focus on code samples and API usage | Keeps what you name |
| Match the model | /model; model: haiku for simple subagents | Sonnet costs less than Opus and handles most coding |
| Lower thinking | /effort; MAX_THINKING_TOKENS on fixed-budget models | Thinking tokens are billed as output |
| Slim CLAUDE.md | Under 200 lines; move workflows to skills | CLAUDE.md loads every session; skills load on demand |
| Cut MCP overhead | /mcp to disable unused servers; CLI tools such as gh | Fewer tool listings in context |
| Delegate verbose work | Subagents for tests, docs and logs | Output stays in the subagent's context |
| Filter output | A hook that returns only ERROR lines | A 10,000-line log drops from tens of thousands of tokens to hundreds |
How do you see where your tokens go?
Run /usage for the session's token counts and an estimated cost at list price, including a Prompt cache (main) line that shows how much input came from cache. Run /context for a live breakdown by category, including which CLAUDE.md and memory files loaded. On Pro, Max, Team and Enterprise plans, /usage also lists recommendations for any behavior behind 10% or more of your recent usage, such as trimming a CLAUDE.md that adds 49k tokens per request, and pressing f lets Claude Code apply the ones it can. For a team, Anthropic's docs point to OpenTelemetry export, which streams per-user token and cost metrics into your own observability stack.
Why does usage climb in a long session?
A long session costs more per message because every request carries the whole conversation. Anthropic's Claude Code cost docs list the usual causes: long context re-read on each request, even for a one-line question; cache misses after a break longer than the cache lifetime, which reprocess the full context; scheduled tasks and subagents that send their own requests; and agent teams, which use approximately 7x more tokens than standard sessions when teammates run in plan mode. Switching models mid-session also misses the cache, because each model has its own. Compacting a large context is itself a large request, while /clear costs nothing. Background jobs typically use under $0.04 per session.
Can a runtime cut tokens without changing the model?
A runtime can cut tokens by changing what reaches the context window, while the model stays the same. elephant.broker, a pluggable runtime for AI agents, assembles a working set on every turn: it keeps current, verified context and drops what is stale, duplicate or off-task before your model sees it. elephant.broker reports on its website 40-80% less context per task, where "only verified, relevant knowledge reaches the window", and 40% lower AI spend with the same model. These are elephant.broker's own reported results, not an independent or head-to-head test. The runtime adds a retrieve and rerank step to every turn. For one developer, the Claude Code steps above come first; for agents beyond Claude Code, see reducing AI agent token costs.
Sources
- Anthropic: Claude Code costs, Claude Code prompt caching, Claude Code context window, Claude Code commands
- elephant.broker: overview and reported results, how a turn flows
Product details come from each vendor's public documentation as viewed on 2026-10-28 and may have changed. Product names are trademarks of their respective owners; elephant.broker is not affiliated with them.