Claude Code cost: why it climbs when you are not typing
The honest answer to what Claude Code costs is not a price. Cost scales with context times requests, which is why a session you left open all day bills for a one-line question. How to read /usage, the six ways tokens leave while you are idle, and the levers ranked by what actually moved our number.
"How much does Claude Code cost" has two answers depending on how you pay, and neither one is the number you actually need.
On a Pro or Max subscription it is included, and the dollar figure stops being the question. What replaces it is the limit: a rolling five-hour window and a weekly one, and the mystery of why you hit them on a day that did not feel heavy. On an API key or a cloud provider it is per token, and Anthropic publishes enterprise averages of roughly $13 per developer per active day and $150 to $250 per month, with 90% of users staying under $30 per active day. Both audiences end up asking the same real question: what is consuming this, and which knobs move it.
We run a multi-agent pipeline, a blog publishing skill, and long refactor sessions through Claude Code every day, so this is the answer from the instrument panel rather than the pricing page.
The one mental model
Cost scales with context size times number of requests, and almost nothing else.
Every request carries the entire conversation. That is not a per-message charge, it is a per-message re-send of everything before it. And requests are not the same as your messages: each time Claude runs a tool, the results come back as another request carrying the whole batch. A single "fix the failing test" turn can be fifteen requests, every one of them dragging your full history along.
This is why the intuition that costs track typing is wrong in both directions. A one-line question in a session that has been open all day is an expensive request. A carefully written 300-word prompt in a fresh session is a cheap one.
Prompt caching softens this: repeated prefixes are re-read at the cached rate rather than the full one. It does not remove the relationship, it discounts it. Which makes cache misses one of the more expensive things that can happen to you, and we will come back to that.
Read the instrument before turning knobs
/usage is the panel, and most people never open past the first block.
The Session block shows total cost, API versus wall duration, lines changed, and a per-model breakdown of input, output, cache read, and cache write. The dollar figure is computed locally from token counts at list price, so treat it as an estimate. It resets when /clear starts a new session.
The Prompt cache (main) line is the one worth learning to read. It reports what share of your input tokens came from cache, how many misses you took, and whether the cache is warm right now:
Prompt cache (main): 14 requests · 91% of input tokens from cache · 2 misses
(last 6m 10s ago, 310.2k tokens re-cached) · 1 expected rebuild (compaction or
tool-result clearing) · warm (1h TTL, last activity 40s ago)
A miss is counted when a request reprocessed more than 5% and at least 2,000 tokens of what it could have read from cache. Two misses on a 310k-token context is a real bill, and the line tells you when they happened so you can connect them to what you did.
The plan usage breakdown, on Pro, Max, Team, or Enterprise, is the part that changes behavior. It attributes recent usage to individual skills, subagents, plugins, and MCP servers, each as a percentage of the total. It raises behavior flags for anything accounting for 10% or more, such as long context or cache misses. It lists your heaviest scheduled loops with per-run token counts. Press d or w to switch between 24 hours and 7 days.
That attribution list is the difference between guessing and knowing. If one MCP server is 22% of your week, you found your problem without a single experiment. Figures come from local session history on that machine, so other devices and claude.ai are not included.
Two more instruments: /context shows what is currently occupying the context window, which is where you catch a bloated CLAUDE.md or a server you forgot you enabled. /insights analyzes up to 200 recent sessions and writes an HTML report to ~/.claude/usage-data/report.html, aimed at how you work rather than how much you spent.
Six ways tokens leave while you are idle
This is the section that explains the surprising bills, and it is the one the pricing page cannot tell you.
- Long context. Covered above. The session you never cleared is charging you for its whole history on every poke.
- Cache misses after a break. Cache lifetime is one hour on a subscription and five minutes once you are drawing on usage credits. On an API key or cloud provider it is five minutes by default. Step away for lunch, come back, and your first message reprocesses the entire context at full rate. Ten short questions spread across an afternoon can cost more than an hour of continuous work.
- Scheduled tasks. A
/loopor other scheduled task fires on its interval whether or not you are there, and each firing sends your full context. - Cross-session messages. A message from another of your sessions is delivered as a new turn while this one sits idle, again carrying full context. Set
crossSessionInboundtoholdif you want them queued instead. - Goal check-ins. While background work keeps a goal waiting, Claude Code starts a turn to check on it, up to three idle check-ins per goal between your prompts.
CLAUDE_CODE_GOAL_CHECKIN_MINUTES=0turns them off. - Agent teammates. Each active teammate keeps consuming until it exits. Agent teams run roughly 7x the tokens of a standard session when teammates work in plan mode, because every teammate is a separate instance with its own context window.
Genuine idle background work, the conversation summarization behind --resume and similar, runs under $0.04 per session. The list above is where the real idle spend lives.
The levers, ranked
Ordered by what actually moved our numbers, not by how often they get repeated.
1. /clear between unrelated tasks. The highest-value habit by a wide margin, and free. Stale context taxes every subsequent message. /rename before clearing makes the session findable, and /resume brings it back.
2. Know that /compact is not the cheap option. Compaction reads the conversation it summarizes, so compacting a large context is itself a large request, and it forces a cache rebuild after. It is the right tool when you need continuity. When you do not, /clear costs nothing. Choosing compaction reflexively is a common way to pay for the privilege of keeping context you did not need.
3. Match the model to the job. Sonnet handles most coding work at lower cost; Opus earns its rate on architecture and multi-step reasoning. Set model: haiku on simple subagents. Note that seat-based session and weekly limits are shared across models, so /model will not rescue you from those; it only helps against a model-specific limit like "You've hit your Opus limit."
4. Turn extended thinking down for shallow work. Thinking tokens bill as output, and default budgets run to tens of thousands of tokens per request. Lower the effort level with /effort, or set MAX_THINKING_TOKENS=8000 on models with a fixed budget. Adaptive-reasoning models ignore nonzero budgets, so use effort levels there.
5. Filter verbose output before it becomes context. A PreToolUse hook can rewrite a test command to return only failures, turning a 10,000-line log into a few hundred tokens. This is the cheapest structural fix available and almost nobody sets it up. Delegating verbose operations to subagents does the same job from the other direction: the noise stays in the subagent's context and only the summary comes back.
6. Move procedures out of CLAUDE.md. Everything in it loads at session start and stays for every message, including the migration checklist you touch twice a month. Keep it under 200 lines of facts and push procedures into skills, which load only when used. This is the same rule from our memory post, now with a token figure attached.
7. Audit MCP servers, with updated assumptions. The old advice was that every server taxes every request. Tool definitions are now deferred by default, so only names and server instructions enter context until a tool is used. Run /context to see the current reality, /mcp to disable what you are not using, and prefer a CLI like gh when one exists, since it adds no listing at all.
8. Use plan mode on anything ambiguous. Wrong direction discovered at minute twenty costs the whole twenty minutes plus the rework. A plan you approve first is the cheapest correction there is.
What we would tell a team on day one
Put context usage in your status line so it is ambient rather than something you remember to check. Open /usage once a week and read the attribution list, not the dollar figure. Clear between tasks by reflex. And write specific prompts: "add input validation to the login function in auth.ts" scans a file, "improve this codebase" scans a repository.
One last thing the numbers make visible. Every lever above trades your attention for tokens, and the good ones make turns longer rather than shorter: plan mode, subagents, filtered output, delegation. That is the actual shape of an efficient agent workflow, and it means more waiting, not less. We built Unwait because those gaps became the largest recurring block of time in our day, and the cheapest place to put them is somewhere useful.