Blog

How to reduce Claude Code token usage: 11 fixes that work

Almost all of Claude Code's tokens are input: instructions, tool definitions, history and every file and command output, re-sent on every turn. To cut usage, shrink what gets re-sent: shorter sessions, a lean setup, quieter tool output, the right model, cache-friendly habits and compressed history.

67.7%
of spend is re-sent history
13.2%
is the model's replies
72.3%
less on a 938-turn session through condense

Where Claude Code tokens actually go

Claude Code is a loop: send everything, get a short step, run a tool, append, repeat. By turn 150 the model has re-read the earliest turns more than a hundred times.

Share of spend by token tier
12 real sessions, 18,333 assistant turns, billed usage
  • cache read67.7%
  • cache write18.9%
  • output13.2%
  • uncached input0.2%
Replies are a small slice; most of the cost is context re-read on every turn. From the anatomy of a token bill.

Fixes 1-6: session habits

Each of these puts less into context, or keeps it there for less time.

  1. 1
    Start each new task with /clear

    /clear on every switch. Write decisions you need into CLAUDE.md first.

  2. 2
    Compact on your terms

    Run /compact keep the failing test names at a break, before auto-compact fires mid-step. See /compact vs /clear.

  3. 3
    Keep CLAUDE.md short and scoped

    Root file for commands and hard rules only; area notes go in subdirectory CLAUDE.md files.

  4. 4
    Turn off unused MCP servers

    Each one adds tool definitions to every request. Check /context and /mcp. More in the hidden token overhead.

  5. 5
    Point Claude at the right files

    Name the file and function, like src/auth/session.ts, and use plan mode for big changes.

  6. 6
    Send exploration to subagents

    They search in their own window and hand back a short summary instead of every file they opened.

Fixes 7-10: model, output, cache

The next four cut the cost of each turn and show you where it goes.

  1. 1
    Use Sonnet for routine work

    Plan with Opus, write the plan to a file, /clear, then implement with Sonnet via /model.

  2. 2
    Keep tool output quiet

    Failing tests only, tail long logs, scope searches. See compressing test logs, diffs and grep results.

  3. 3
    Work with the prompt cache

    Avoid idle gaps past the five-minute cache, and change CLAUDE.md, MCP or /model only at task boundaries. See caching vs compression.

  4. 4
    Measure before and after

    /context, /cost and /status. Judge by cost per finished task.

Filtering shell output is not free
Terminal-Bench, single run, cost per suite pass
no tool
$25.46
rtk
$29.33
rtk cost more per pass and solved 75% of tasks against 81.5%. One run is one data point. From our Terminal-Bench run.

Fix 11: compress the context automatically

condense is a hosted proxy that rewrites finished agent loops into short summaries and keeps instructions, code, patches and errors word for word. Compressed spans are frozen so they stay cached.

Measured sessionWithout condenseWith condense
938 turns, Sonnet, list prices$154$43 (72.3% less)
938 turns, Opus, list prices$771$214 (72.3% less)
200 turns, Opus replay$33.61$18.53 (45% less)

On the 200-turn session a judge rated condense's steps 63% good against 58% for the control (details). Below roughly 20 turns there is no gain; on a subscription it means up to 3× more work from your plan. Install with curl -fsSL https://cli.condense.chat/unix | sh (Windows: irm https://cli.condense.chat/nt | iex), then run dense claude.

Frequently asked questions

Why is Claude Code using so many tokens?

Each step re-sends the whole session, so a late turn can carry hundreds of thousands of tokens even if you typed one line.

What is the fastest way to save tokens in Claude Code?

Run /clear when you switch tasks, and keep what you need to remember in CLAUDE.md or a notes file.

Does /compact save tokens?

Yes. It replaces the conversation with a summary; run it at a natural break with instructions on what to keep.

Do MCP servers use tokens even when I don't call them?

Yes. Every connected server adds its tool definitions to each request, so disable the ones a project does not need.

Does reducing tokens make Claude Code worse?

Removing noise usually helps, but over-trimming can force re-reads. Measure cost per finished task, not just token counts.

All posts