The short answer
- On a subscription: $20/mo (Pro, light use) up to $100–$200/mo (Max, heavy use) — a flat, predictable bill.
- On the API: pay per token. Anthropic puts the average across enterprise deployments at about $13 per developer per active day, with ~90% staying under $30/day.
- The same task can cost 5×+ more depending on model, context size, and how long the agent loops.
- Prompt caching quietly cuts input cost — cache reads are ~10% of full price. It's the single biggest saver most people never see.
Two ways to pay for Claude Code
Claude Code bills one of two ways, and they behave completely differently.
1. A Claude subscription (flat monthly)
If you sign in with a Claude account, Claude Code draws from your plan's usage allowance rather than charging per token. There are three Claude Code plan tiers:
- Pro — $20/mo: includes Claude Code, but with modest limits. Fine for occasional use, not all-day coding.
- Max — $100/mo: roughly 5× the usage of Pro. The sweet spot for daily users.
- Max — $200/mo: roughly 20× Pro, for people who live in Claude Code all day.
Usage resets on a rolling window (every few hours), so "how much it costs" is really "how often you hit the ceiling." The bill never changes — you just get throttled if you go big.
2. The Anthropic API (pay-as-you-go)
Point Claude Code at an API key from the Anthropic Console and there's no subscription — you pay for exactly the tokens you use. No ceiling, no throttling, but the number moves every day. This is where "how much does Claude Code cost" gets interesting, because the token math is entirely in your hands.
What a token actually costs
On the API, price depends on the model and whether tokens are input (what you send) or output (what Claude writes back). Rough current rates per million tokens:
| Model | Input / 1M | Output / 1M | Best for |
|---|---|---|---|
| Opus | $5 | $25 | Hardest reasoning, big refactors |
| Sonnet | $3 | $15 | Everyday coding — the default |
| Haiku | $1 | $5 | Fast, cheap, simple tasks |
Two things jump out. Output costs ~5× input — verbose answers and long generated files add up. And Opus costs ~5× Haiku for the same tokens. Model choice alone can swing a task's cost by 5× before you change anything else. (Always confirm today's numbers at claude.com/pricing — they change.)
Why the same task costs 5× more some days
People are often baffled that yesterday's feature cost $2 and today's similar one cost $11. It's almost always one of these four levers:
- Model. Opus vs Sonnet vs Haiku — a 5× spread per token, as above.
- Context size. The API is stateless, so every turn re-sends the entire conversation as input tokens. A long session with a big file loaded means you pay for that context on every single message. This is usually the dominant cost.
- Thinking / effort. More reasoning means more tokens generated before the answer. Great for hard problems, wasteful on easy ones.
- Tool loops. An agentic task that reads ten files, runs tests, and retries burns tokens on every round-trip.
The expensive combination is all four at once: Opus, a full context window, deep thinking, and a long tool loop. The cheap one is Sonnet on a focused task with a lean context.
Prompt caching: the saver you can't see
Here's the part that changes the math. Because context is re-sent every turn, Anthropic applies prompt caching to the stable prefix of your prompt. Cache reads cost roughly one tenth of full input price (cache writes cost a bit more than normal, ~1.25×, but you write once and read many times).
Claude Code does this automatically. On a long session — where the same big context is resent on every message — caching can turn what would be full-price input into ~10%-price reads. Over a day, that's the difference between a $30 bill and a $12 one. The catch: it's invisible. Nothing in the terminal tells you how much you saved.
How to see your own numbers
You don't have to guess. Three ways, low to high fidelity:
- Built in: run
/costin a Claude Code session for a rough running total (API billing only). - ccusage: a free CLI —
npx ccusageprints daily and per-session cost tables in your terminal. (We compare it in Dinoradar vs ccusage.) - Dinoradar: a native macOS dashboard that visualizes spend, cache savings, and how you actually work — all computed locally, nothing leaves your Mac.
Whichever you pick, the point is the same: you can't manage a cost you can't see. Once the number is in front of you, the levers above are easy to pull.
Frequently asked
Is Claude Code free?+
Not really. It's included with paid Claude subscriptions (Pro at $20/mo with limited access; Max at $100 and $200/mo with much higher limits), and available pay-as-you-go on the Anthropic API. There's no free tier for real, sustained usage.
How much does a day of Claude Code cost on the API?+
Anthropic's Claude Code cost documentation reports that across enterprise deployments the average is around $13 per developer per active day and $150–250 per developer per month, with costs staying below $30 per active day for 90% of users. That figure is an enterprise average, not a universal one — heavy Opus use on large codebases runs higher, and light Sonnet use runs lower.
Why does the same task cost more some days?+
Four levers: model choice (Opus ≈ 5× Haiku per token), context size (every turn re-sends history as input tokens), how much the model thinks, and how many tool-call loops a task takes. A big context plus Opus plus long loops is the pricey combination.
Does prompt caching reduce Claude Code costs?+
Yes — meaningfully. Claude Code caches the stable part of your prompt automatically, and cache reads cost roughly a tenth of normal input tokens. On long sessions that re-send the same context, caching can cut input cost dramatically. Dinoradar shows you exactly how much it saved.
See where your Claude Code money goes.
Dinoradar reads your own history locally and shows spend, cache savings and workflow insights. Free forever · Pro $29 once.