← Other blogs

Use fewer tokens in Claude Code by shrinking four components

History, project instructions, tool definitions and output. The prompt itself barely registers.

· 2 min read

Use fewer tokens in Claude Code by shrinking what every request carries, not by writing shorter prompts. The prompt is a rounding error compared with the conversation history, the files, the tool definitions and the project instructions that ride along with it. The UsageAtlas guide lists the same levers.

The four things in every request

Component Grows with How to shrink it
Conversation history Session length /clear, /compact
Project instructions CLAUDE.md size Keep it short, move detail to skills
Tool definitions Number of MCP servers Disable the unused ones
Output and reasoning Effort level, model Lower /effort on routine work

The first row is the biggest and the easiest to fix. The second and third are fixed once and help every session afterwards.

The habits that matter

Clear when the task changes. Not every twenty minutes, just when the next request does not need the last one.

Compact with intent. /compact Focus on the failing test and the files changed keeps what matters. A bare /compact keeps whatever the summariser thinks is interesting.

Route by task. Sonnet for most edits, a smaller model for subagent searches, the largest for work that has already failed once.

Keep CLAUDE.md under 200 lines. Detailed workflows belong in skills, which load on demand.

Turn off MCP servers you are not using. A tool listing that never gets called still occupies context.

The multipliers worth knowing

Subagents run their own contexts. Agent teams multiply further, at roughly seven times a single session according to Anthropic's cost documentation.

That does not make them bad. It makes them a choice for parallel exploration rather than a default for every task.

What "cheaper" looks like in practice

A week of daily totals is the only honest test. If the numbers do not move, the change did not work, regardless of how sensible it sounded.

UsageAtlas shows Claude Code tokens per day and per model, which is enough for a before-and-after comparison without exporting anything.

Two traps

Switching models after a limit. Session and weekly caps cover all models, so the switch does not restore access. It helps beforehand.

Buying a bigger plan first. It postpones the same outcome. Fix context and routing, then decide whether the ceiling is genuinely too low.

A quick sanity check

Before changing anything, open a session and look at how much of the request is conversation. If the thread is long, the answer is obvious and the fix is free. If it is short and the totals are still high, the model is doing more work than the task needs, and routing is the lever.

FAQ

Does clearing lose my work?

It loses the conversation, not the files. If you need to return, rename the session first so it can be resumed later.

Is compaction always cheaper than starting over?

No. Compaction is itself a large request. Start over with /clear when continuity is not required.

How long should CLAUDE.md be?

Under about 200 lines is the working target. Anything longer is usually workflow documentation that belongs in a skill.

The takeaway

Shrink the context, route the model, and measure for a week. Those three account for most of the available saving.