Reduce Claude Code Token Usage: 9 Ways
How to reduce Claude Code token usage: where tokens go, how to track them, and nine practical ways to use fewer.
Where Claude Code tokens actually go
Anthropic's cost documentation puts it simply: token costs scale with context size, and the more context Claude processes, the more tokens you use. A few things drive that in practice:
- The whole conversation is sent every time. Claude Code sends your full conversation with each request, and every time Claude uses a tool it sends another request carrying the tool results. Prompt caching means the history is re-read at a cheaper cached rate, but a one-line question in a session that has been open all day still draws on the entire conversation.
- Cache misses. Your first message after a break longer than the cache lifetime reprocesses the full context. Anthropic says the lifetime is an hour on a subscription and five minutes on an API key by default.
- Always-loaded instructions. Your CLAUDE.md is loaded into context at session start, so detailed instructions for one workflow cost tokens even when you are doing something else.
- Thinking. Extended thinking is on by default, and thinking tokens are billed as output tokens.
- Subagents, agent teams and background work. Each subagent sends its own requests, and agent teams use roughly 7x more tokens than a standard session when teammates run in plan mode. Background jobs such as summarizing past conversations cost a small amount (typically under $0.04 per session).
How much of the window a session fills is a separate question: see the Claude context window guide.
Source: Manage costs effectively, checked 16 October 2026.
How to see your token usage in Claude Code
/usageshows the Session block: token usage by model, plus a cost figure that Claude Code computes locally from token counts at list price. It is an estimate, not an invoice, and for authoritative billing Anthropic points to the Usage page in the Claude Console. On Pro and Max plans the session cost is not relevant for billing, since usage is included in the subscription; those plans also get plan-usage bars and a breakdown of what counts against your limits. The totals reset when you run/clear./contextshows what is consuming space in your context.- The status line can display context-window usage continuously.
- The spinner shows a live count of the output the current turn has produced so far. It does not include your prompt or history, so it will not match the
/usagetotals.
Source: Manage costs effectively, checked 16 October 2026.
Practical ways to use fewer tokens
Each of these comes from Anthropic's cost guidance, and each has a reason.
- Clear between tasks.
/clearstarts fresh, and stale context wastes tokens on every later message. Use/renamefirst so you can/resumethe session later. - Compact with instructions.
/compact Focus on code samples and API usagetells Claude what to keep. You can also put a "Compact instructions" section in CLAUDE.md. - Match the model to the job. Anthropic says Sonnet handles most coding tasks well and costs less than Opus, so reserve Opus for complex architectural decisions. Use
/modelto switch, andmodel: haikufor simple subagent tasks. - Trim MCP overhead. Tool definitions are deferred by default, but run
/mcpand disable servers you are not using. CLI tools such asghare more context-efficient than MCP servers because they add no per-tool listing. - Keep CLAUDE.md small. It loads every session. Move specialised instructions into skills, which load only when used, and aim to keep CLAUDE.md under 200 lines.
- Lower the thinking effort on simple tasks. Use
/effortor/model, since thinking is billed as output. - Send verbose work to subagents. Running tests or processing logs in a subagent keeps the noisy output out of your main conversation; only a summary comes back.
- Write specific prompts. "Add input validation to the login function in auth.ts" needs far fewer file reads than "improve this codebase".
- Plan first on complex tasks, and stop early. Plan mode (Shift+Tab) avoids expensive rework, and pressing Escape or using
/rewindwhen Claude heads the wrong way saves the tokens of a wrong path.
Source: Manage costs effectively, checked 16 October 2026.
Measure it: shorten a long prompt with the Token Optimizer
One more lever is the length of the instructions you write yourself: a CLAUDE.md, a system prompt or a repeated task description. Here is how to measure what shortening one saves.
- Paste it into the prompt compressor (our Token Optimizer). Choose a level: Low removes filler (aiming for roughly 15 to 25% fewer tokens), Medium restructures wordy passages (35 to 45%), and Aggressive cuts hardest (50% or more). These are targets given to the AI, not guarantees.
- Read the result and compare it with your original. It is an AI rewrite, so check that every instruction survived.
- Paste the original and the compressed version into the Claude token counter to compare them.
What the numbers mean: the Token Optimizer counts with the GPT-4o tokenizer, and the Token Counter's Claude figure is the GPT-4o count scaled up by a fixed ratio, an estimate. Both are good for comparing a before and an after, which is what you need here; neither is an exact Claude bill.
A real run. The text is the instruction block we use to turn a rough idea into a finished prompt: five rules, 186 words. We ran it through the Token Optimizer at the Medium level with formatting preserved:
| | Original | Compressed | Change | |---|---|---|---| | Words | 186 | 138 | -26% | | GPT-4o tokens (exact) | 236 | 193 | -18% | | Claude token estimate | ~283 | ~232 | -18% |
Medium aims for 35 to 45%, but this block was already written tightly, so the saving was 18%. All five rules survived, with the wording tightened (for example "never add requirements… not stated or clearly implied" for "Never invent requirements… that the idea does not state or clearly imply"). A bloated prompt with lots of politeness and repetition would shrink more; a tight one shrinks less. That is the honest range to expect.
What Claude Code costs and how tokens map to cost
Claude Code charges by API token consumption, and subscription plans (Pro, Max, Team, Enterprise) have their own pricing at claude.com/pricing. Anthropic's cost page says costs vary widely, with an average of around $13 per developer per active day and $150 to $250 per developer per month across enterprise deployments, and below $30 per active day for 90% of users.
Underneath, you pay per million tokens (MTok), with different prices for input and output. As of 16 October 2026, Anthropic's base prices are:
| Model | Input | Output | |---|---|---| | Claude Fable 5.1 | $10 / MTok | $50 / MTok | | Claude Opus 5.5 | $4 / MTok | $20 / MTok | | Claude Sonnet 5.5 | $2 / MTok | $10 / MTok | | Claude Haiku 5.5 | $0.10 / MTok (prompts up to 100,000 tokens) | $0.50 / MTok |
Haiku 5.5 costs more for prompts over 100,000 tokens ($0.50 input and $2.50 output per MTok). Batch requests are 50% off, and prompt cache reads cost a fraction of the input price (5% on Opus 5.5 and Sonnet 5.5, 2.5% on Fable 5.1, 10% on most others). A request costs its input tokens times the input price plus its output tokens times the output price. Sources: pricing and models overview, checked 16 October 2026. Prices change, so check the pricing page before you rely on them.
Using the Token Optimizer MCP server from Claude Code
Cuelara runs an MCP server, and the Token Optimizer is one of its tools. To add it to Claude Code, run:
claude mcp add --transport http cuelara-token-optimizer https://cuelara.com/api/mcp
That works without an account, and calls are rate-limited by IP like a visitor to the website. For your own account's daily limit, create a personal token in your dashboard and add it as a header:
claude mcp add --transport http cuelara-token-optimizer https://cuelara.com/api/mcp --header "Authorization: Bearer YOUR_TOKEN_HERE"
The tool is called cuelara_compress_prompt. It takes the text to compress (text), an optional level and an optional preserveFormatting setting, and uses the same compression as the web page. One thing to know before you compress a CLAUDE.md with it: anonymous calls and free-plan accounts get a "by Cuelara.com" line appended to the output, and paid plans do not. Remove it if it ends up in your file. Full setup is in the MCP setup guide.
FAQ
How do I reduce Claude Code token usage?
Clear context between unrelated tasks with /clear, compact long sessions with /compact, match the model to the job, keep CLAUDE.md short, disable MCP servers you do not use, and write specific prompts. The sections above explain why each one saves tokens.
How do I see token usage in Claude Code?
Run /usage for the session's token usage and an estimated cost, /context to see what is using space, or configure the status line to show context usage continuously.
How much does Claude Code cost per token?
Claude Code uses Anthropic's API pricing, which is per million tokens and differs by model: for example, as of 16 October 2026, Claude Sonnet 5.5 is $2 per million input tokens and $10 per million output tokens. Subscription plans (Pro, Max, Team, Enterprise) are priced separately.
Can I use the Token Optimizer from Claude Code?
Yes. Add the MCP server with claude mcp add --transport http cuelara-token-optimizer https://cuelara.com/api/mcp. See the setup guide for using your own token.
Will shortening a prompt change its meaning?
It is built not to: the AI is told to keep every constraint, variable and example. But it is an AI rewrite, so always compare the result with your original.
Is the Token Optimizer free?
Yes, within a daily limit that is higher when you sign in and higher again on the paid plans. MCP calls count towards the same limits.