Why Claude Code Burns Tokens While You're Not Even Using It
Your usage climbs during a long session even when you barely type. The reasons are specific and mostly invisible: every request carries the whole conversation, your prompt cache quietly expires, and scheduled tasks, cross-session messages and idle teammates each resend your full context.
If Claude Code is using so many tokens that you hit your limit before lunch, the cause is almost never the number of messages you send. Every request carries your entire conversation, so the cost of a turn is set by how much history sits behind it, not by how much you typed. A one-line question in a session you opened this morning still draws usage for the whole morning.
That single fact explains most surprise token usage in a long session. The rest comes from things that spend tokens while you aren't touching the keyboard at all.
Two ceilings are in play, and they're shared across Claude Code, Claude chat and Cowork rather than being per-tool: a rolling five-hour window for short-term activity, and a weekly window. Because they're shared, switching models with /model doesn't restore access when you hit a usage limit — though it will keep you working past a model-specific "You've hit your Opus limit" message. If you're hitting the usage limit too fast, the mechanisms below are where to look before you start rationing your prompts.
Your context is re-sent on every single turn
Claude Code sends the full conversation with each request, and each time Claude uses a tool it sends another request carrying that batch of tool results. A task that takes twelve tool calls is twelve requests, each one hauling everything before it.
Prompt caching makes this survivable — repeated content is re-read at the cached token rate rather than full price. But cached is not free, and it means the meaningful number is context size, not message count.
Two commands tell you where you actually are:
/usage # token usage for the session, plus plan usage bars
/context # what is consuming space right nowOn a Pro, Max, Team or Enterprise plan, /usage also breaks usage down by skill, subagent, plugin and individual MCP server, and raises a behavior flag when any one behaviour — long context, cache misses — accounts for 10% or more of recent usage. That flag is the fastest way to find out which of the causes below is yours, rather than guessing.
The cache expires quietly, and the window shrinks
This is the one that catches people, because nothing announces it.
Your first message after a break longer than the cache lifetime misses the cache and reprocesses your entire context at full rate. The lifetime is:
| Situation | Cache lifetime |
|---|---|
| Subscription plan | 1 hour |
| Subscription, drawing on usage credits | 5 minutes |
| API key or cloud provider | 5 minutes by default |
So the moment you exceed your plan allowance and start drawing on usage credits, your effective cache window silently collapses from an hour to five minutes — precisely when you least want expensive turns. You can keep the one-hour lifetime while on credits by setting an environment variable:
ENABLE_PROMPT_CACHING_1H=1If you routinely step away for twenty minutes and come back to a large session, you are paying full price for that context every single time.
Why token usage climbs in a long session you aren't touching
A session sitting open is not a session sitting still. Four mechanisms send your full context without you doing anything:
- Scheduled tasks fire on their interval whether or not you're active, and each firing sends the whole context.
- Cross-session messages from another of your sessions are delivered as a new turn while this one is idle — again carrying full context. Set
crossSessionInboundtoholdin settings if you'd rather they queue. - Agent teammates keep consuming tokens until they exit or the session ends. They do not idle politely.
- Background summarization runs so
claude --resumeworks. This one is genuinely small — typically under $0.04 per session.
The first three are worth auditing if your usage climbs overnight. The fourth is noise.
Agent teams are the expensive one
Each teammate runs its own Claude instance with its own context window, so cost scales with team size rather than with the work. The docs put it precisely: agent teams use approximately 7x more tokens than standard sessions when teammates run in plan mode.
Teammates also load CLAUDE.md, MCP servers and skills automatically, so each one starts with a full context before doing anything. If you spawn a team, keep it small, use Sonnet for teammates, and shut them down when their work is done rather than leaving them parked.
/compact is expensive. /clear is free.
This surprises people who reach for /compact as the cheap option.
/compact has to read the conversation it summarizes, so compacting a large context is itself a large request. /clear throws the context away without reading it and costs nothing.
The right rule is about intent, not price:
- Switching to unrelated work?
/clear. Carrying stale context into a new task taxes every subsequent message for no benefit. - Need continuity?
/compact, and tell it what matters:
/compact Focus on the migration plan and the failing test outputYou can also make that persistent by putting compaction instructions in your project's CLAUDE.md:
# Compact instructions
When you are using compact, please focus on test output and code changesOne practical habit: /rename your session before clearing, so /resume can find it later. You get the fresh context without losing the thread.
What's actually sitting in your context
Run /context before optimizing anything — the answer is often not what you'd guess.
CLAUDE.md loads at session start and stays there. If it carries detailed instructions for PR reviews or database migrations, those tokens are present while you're doing something completely unrelated. The guidance is to keep it under 200 lines and move workflow-specific instructions into skills, which load only when invoked.
MCP servers are less of a problem than they used to be. Tool definitions are now deferred by default, so only tool names enter context until Claude actually uses one. Still worth running /mcp and disabling servers you aren't using — and where a CLI exists (gh, aws, gcloud, sentry-cli), it's more context-efficient than an MCP server because it adds no per-tool listing at all. If you're wrestling with MCP servers generally, I wrote up why they fail to show up in Claude Code.
Extended thinking is billed as output tokens, and the default budget can run to tens of thousands of tokens per request. For work that doesn't need deep reasoning, lower it with /effort, or cap it directly:
MAX_THINKING_TOKENS=8000Note that adaptive-reasoning models ignore a nonzero budget — use effort levels there instead.
Push volume out of your main context
The highest-leverage change isn't spending less, it's keeping bulk output out of the conversation entirely.
Hooks can preprocess before Claude ever sees the data. Instead of Claude reading a 10,000-line log to find the errors, a hook greps for them and returns only the matches — tens of thousands of tokens down to hundreds. This PreToolUse hook rewrites test commands to surface only failures:
{
"hooks": {
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [
{ "type": "command", "command": "~/.claude/hooks/filter-test-output.sh" }
]
}
]
}
}Subagents isolate verbose operations. Run tests, fetch docs or process logs in a subagent and the noisy output stays in its context — only the summary comes back to your main conversation.
What normal actually looks like
Worth calibrating against, before you conclude something is broken. Across enterprise deployments the average is around $13 per developer per active day, and $150–250 per developer per month, with 90% of users staying below $30 per active day.
If you're well outside that, the docs point at two habits rather than exotic causes: long sessions that were never cleared, and Opus left as the default model when Sonnet would do. Sonnet handles most coding work well and costs less; reserve Opus for genuine architectural decisions and multi-step reasoning, and use model: haiku for simple subagent tasks.
Before you go hunting for exotic explanations, run /insights. It analyses your recent sessions on this machine and writes an HTML report on how you actually work — what you spend time on, where requests get misunderstood, where turns get wasted. That's usually a faster route to reducing Claude Code token usage than tuning any single setting.
Key takeaways
- Cost is driven by context size, not message count — every request carries the whole conversation, plus one more request per tool call.
- The prompt cache lifetime silently drops from 1 hour to 5 minutes once you start drawing on usage credits. ENABLE_PROMPT_CACHING_1H=1 restores it.
- /clear is free; /compact has to read the conversation it summarizes, so it is itself an expensive request.
- Scheduled tasks, cross-session messages and idle agent teammates all resend your full context while you are doing nothing.
- Run /context and /usage before optimizing — the behavior flags name the cause instead of making you guess.
Frequently asked questions
Why does a one-line question cost so much in a long session?
Claude Code sends your full conversation with every request. A short question in a session that has been open all day still draws usage for the entire history behind it. Prompt caching makes those tokens cheaper, not free — they are re-read at the cached rate on every turn.
Is /compact cheaper than /clear?
No, the opposite. /compact has to read the conversation it summarizes, so compacting a large context is itself a large request. /clear costs nothing. Use /compact when you need continuity and /clear when you are switching to unrelated work.
Why did my usage jump after I came back from lunch?
You missed the prompt cache. The cache lifetime is one hour on a subscription, but it drops to five minutes once you are drawing on usage credits, and it is five minutes by default on an API key or cloud provider. The first message after that window reprocesses your entire context at full price.
Can Claude Code use tokens while I am not typing?
Yes. Scheduled tasks fire on their interval and send your full context each time, cross-session messages are delivered as a new turn while the session is idle and do the same, and every active agent teammate keeps consuming tokens until it exits. Background summarization also runs, though that is typically under four cents a session.
Most "Claude Code is burning tokens" problems come down to a session that has been open too long carrying context nobody needs any more. /context tells you what's in there, /usage tells you which behaviour is responsible, and /clear is the cheapest command you have.
If you're deciding how to structure project configuration in the first place, I compared how Claude Code and Cursor handle it in Claude Code vs Cursor context management — and ContextZero came out of the same problem.
References
- Manage costs effectively — Claude Code docscode.claude.com · accessed 2026-08-14
- Connect Claude Code to tools via MCPcode.claude.com · accessed 2026-08-14
- Prompt caching — Claude Code docscode.claude.com · accessed 2026-08-14
Last reviewed August 14, 2026
Tahir Nazir
Senior AI Engineer & Full-Stack Lead
5+ years shipping AI-powered products — RAG pipelines, agentic workflows, and MCP tooling. Top Rated on Upwork with a 100% job success score.
More about Tahir →Keep reading
New posts land here first. Follow along by RSS, or get in touch if you are building something similar.
Related articles
MCP Server Not Showing Up in Claude Code? Read the Status First
Your MCP server is configured but Claude can't see it. `claude mcp list` tells you which of five different problems you actually have — pending approval, a failed spawn, a Windows .cmd shim, zero advertised tools, or a server that was never in the list to begin with.TroubleshootingAI Engineering11 min readClaude Code vs Cursor: How Each One Decides What Your Agent Knows
Both tools read project instructions from disk, but they disagree on file names, load order, and scoping. Here is the concrete difference — and how to keep one repo working well in both.ComparisonAI Engineering8 min readHow to Build an MCP Server (TypeScript, End to End)
A working Model Context Protocol server in TypeScript — project setup, tool registration with Zod, stdio transport, and wiring it into Claude Code and Cursor without breaking the JSON-RPC stream.How-toAI Engineering11 min read