Last updated: July 2026
Claude Code costs add up mainly because Opus is a premium model (about $15 per million input tokens, $75 per million output) and because context accumulates every turn — files read, tool and command output, and full conversation history are re-sent on each request. Long runs, a bloated CLAUDE.md, and redundant reads multiply it.
If Claude Code feels expensive, the number rarely comes from one giant request — it comes from the same tokens being paid for over and over. The subscription or the API bill is driven by which model you run and how much context each turn carries. Here is exactly where the money goes, and how to bring it down without giving up the tool.
There are two ways to pay for Claude Code, and the confusion usually comes from not knowing which one you are on. You can run it through a Claude subscription — $20/month for Pro, or Premium seats around $125 per user for teams — which comes with rolling weekly rate limits rather than a per-token charge. Or you can bill directly through the Anthropic API and pay per token with no fixed cap.
On a subscription, "expensive" shows up as hitting your weekly limit sooner than expected and being throttled until it resets. On the API, it shows up as a per-token invoice that climbs with usage. Either way the underlying driver is the same: token volume. Heavy Opus sessions burn through a weekly allowance or run up API charges faster than most people budget for. For the full tier-by-tier breakdown, see our Claude Code pricing guide. Below are the five things that actually move the number.
Claude Opus is a frontier model priced accordingly: roughly $15 per million input tokens and $75 per million output tokens. Output is where it stings — Opus generates a lot of it when it writes code, and every generated token is billed at the premium rate. Compared to Sonnet-class pricing, you are paying a large multiple per token for the privilege of Opus-grade reasoning.
The trap is leaving Opus as your default for everything — renaming a variable, fixing a typo, writing a small test. Those tasks are trivial for a cheaper model. Opus earns its price on genuinely hard reasoning and architecture; on routine edits you are overpaying by a wide margin. Model choice is the single lever with the biggest effect on your bill.
This is the cost driver almost nobody sees. Claude Code does not just send your latest message. On every turn it re-sends the accumulated context: the full conversation history, the contents of every file it has read, and the output of every tool call and shell command it ran along the way.
That payload grows with each turn. A file you read on turn 3 — say a 4,000-token dump — gets re-transmitted on turns 4, 5, 6, and onward. Over a 30-turn session, a single early read can be billed dozens of times. This compounding is why a session that "felt short" can cost far more than the number of messages suggests: you are paying for the conversation to remember itself, again and again. On Opus, that re-sent context is billed at premium input rates, so context bloat and model choice multiply the two most expensive variables at once. If you want the mechanics in depth, see how to reduce the Claude Code context window, and our broader breakdown of AI coding agent costs quantifies how per-turn re-sends dominate a real session.
Claude Code is powerful precisely because it keeps working without you — reading files, running commands, editing, re-reading, and iterating. Every one of those steps is an API round trip carrying the accumulated context from reason #2. A long run that touches twenty files and self-corrects a few times can quietly rack up more tokens than a full day of manual editing.
The failure mode is letting it grind on an under-specified task. It wanders, reads things it does not need, retries, and each loop pays full freight. Long runs are not inherently wasteful — but an unscoped long run on Opus is exactly the combination that drains a weekly limit or spikes an API bill.
Your CLAUDE.md file is loaded into context on every session and rides along on every turn within it. That makes it convenient — and quietly expensive when it grows unchecked. A sprawling CLAUDE.md packed with rarely-used instructions, long style guides, and pasted reference material adds a fixed token tax to every single request you make.
Because it re-sends per turn just like everything else in context, an extra 3,000 tokens of CLAUDE.md is not paid once at startup — it is paid on turn 1, turn 2, and every turn after. Keeping it lean, with only the durable instructions the model actually needs, removes a recurring cost you would otherwise never notice on the invoice.
Claude Code will sometimes re-read a file it already has in context — after a small edit, or because it lost track of what it had already loaded. Each re-read injects that file's tokens again, and thanks to reason #2 those tokens then ride along on every following turn as well.
A single 2,000-line file can be 15,000-25,000 tokens on its own. Reading it twice does not just double that read; it compounds through the rest of the session. Watching for the same file being pulled in repeatedly, and steering the agent away from it, is one of the cleaner ways to stop paying for information it already has.
Here is the honest counterweight. On the same task, Claude Code is frequently more token-efficient than many IDE-embedded agents. It tends to read what it needs rather than indexing and re-injecting the whole repository, and its tool loop is comparatively disciplined about what it pulls into context.
So the "expensive" reputation is less about the tool being wasteful and more about how it is used. Point it at hard problems with Opus, hand it a fat CLAUDE.md, and let it run unscoped, and it will cost real money — because that is what those choices cost with any frontier agent. Give it a tight context and the right model, and it is often the cheaper option per task, not the pricier one.
None of this means Claude Code is a bad deal — it means the defaults reward discipline. A few habits keep the cost sane whether you are on a subscription or the API:
/compact and /clear. /compact summarizes and shrinks the conversation history so you stop re-sending every earlier turn in full; /clear starts fresh when you move to an unrelated task. Both directly attack the context-accumulation cost.If you want to go further on the prompt layer specifically, Terse compresses the prompts you type into Claude Code before they are sent and flags redundant tool calls — a light-touch, on-device nudge that keeps the token math visible without getting in your way. And if you want to measure how wordy a given instruction is before you send it, our token calculator shows the count in seconds.
Terse compresses the prompts you send into Claude Code and flags redundant tool calls — on-device, zero latency, no API calls. A light touch that cuts the wordiness before it compounds across every turn.
Terse for Claude CodeClaude Code costs add up mainly because Opus is a premium model (roughly $15 per million input tokens and $75 per million output) and because context accumulates every turn — files you read, tool and command output, and the full conversation history are re-sent on each request. Long runs, a bloated CLAUDE.md, and redundant file reads multiply that. On the same task it is often more token-efficient than many IDE agents; the spend comes from how it is used.
Both options exist. You can use it through a Claude subscription — $20/month Pro, or Premium seats around $125/user for teams — with rolling weekly rate limits, or bill directly through the Anthropic API and pay per token. Heavy Opus usage tends to hit subscription limits or run up API charges faster than people expect.
Context re-sends dominate. Every turn resends the full conversation history, the contents of files you read, and the output of every tool or shell command, so long sessions balloon. A large CLAUDE.md rides along on every request, and redundant file reads add tokens you pay for more than once.
Use Sonnet for routine work and reserve Opus for genuinely hard problems, run /compact and /clear to shrink conversation history, keep CLAUDE.md lean, scope tasks tightly instead of one sprawling run, and avoid re-reading files you already have in context.