Is Claude Code Free? Pricing, Limits & What You Actually Pay (2026)
By: Evgeny Padezhnov
Claude Code installs in one command and costs nothing to download. That is where "free" ends. Every real session sends context to a Claude model and consumes tokens. Those tokens are billed — through a subscription or through the API.
This is the practical breakdown of what Claude Code costs in 2026. Real tiers, real limits, and the traps that inflate the bill.
The short answer
The Claude Code CLI is free to install. Running it is not.
There is no free tier that lets you use Claude Code for actual work. The free Claude.ai chat plan does not include Claude Code. To use it, you need a paid subscription (Pro or Max) or API billing set up in the Anthropic Console.
In plain terms: the tool is free, the intelligence behind it is not.
Key point: the only genuinely free path is Anthropic's signup API credit. New accounts historically receive a small credit balance. That is enough to test Claude Code for an evening, not to work with it daily.
Two ways to pay
Claude Code bills through one of two channels. Pick one at authentication.
Subscription: Pro and Max
Claude Pro costs $20/month. It includes Claude Code with usage limits.
Claude Max has two tiers:
- $100/month — roughly 5x the Pro usage allowance.
- $200/month — roughly 20x the Pro usage allowance.
A subscription is a flat fee. You do not see per-token charges. You hit usage limits instead of a rising invoice. For most individual developers, this is the predictable option.
API: pay per token
The second path is pay-as-you-go through the Anthropic Console. You add a payment method and buy credits. Claude Code then charges each session against your balance.
API billing prices per million tokens, split by model and by input versus output. Check the official pricing page for current numbers, because rates move. The stable pattern across the Claude 4.x family looks like this:
- Sonnet — the workhorse. Around $3 per million input tokens, $15 per million output.
- Opus — the heaviest model. Around $5 per million input, $25 per million output.
- Haiku — the budget model. The cheapest per token, used for fast, simple calls.
Output tokens cost far more than input tokens. This matters because coding agents generate large diffs and long explanations. Output is where the meter runs fast.
Where the tokens actually go
Claude Code is not a chat box. It reads files, runs tools, and holds project context. Each turn can push a large payload to the model.
A single request often carries the system prompt, tool definitions, recent file contents, and conversation history. That is why one "quick question" inside a repo can cost more than a full chat conversation on claude.ai.
Common mistake: assuming a short message means a short bill. The message is short. The context attached to it is not.
Prompt caching cuts the bill
Prompt caching is the single biggest cost lever on the API path. Claude Code uses it automatically.
Cached input tokens read back at roughly 10% of the base input price. Writing to the cache costs about 25% more than base input, once. After that, repeated context is cheap.
In practice, this means a long session on one codebase gets cheaper per turn as the cache warms. See the prompt caching docs for the exact mechanics. Tested in production: a stable working set plus caching keeps input costs far below the naive token count.
A worked cost example
Numbers make this concrete. Assume Sonnet pricing at $3 per million input and $15 per million output. Assume no caching, to show the worst case.
One focused coding session:
- Input: 200,000 tokens × $3 / 1,000,000 = $0.60
- Output: 30,000 tokens × $15 / 1,000,000 = $0.45
- Total ≈ $1.05 per session
Ten such sessions a day is roughly $10.50/day, or about $315/month at full price. That is more than the Max $200 plan. With caching, the input side often drops by more than half, pulling the real figure down.
Key point: at high daily volume, the flat Max subscription usually beats raw API pricing. At low or bursty volume, API pay-as-you-go can be cheaper, because you pay only for what you run.
The limits that actually bite
The subscription does not remove limits. It sets them higher.
Anthropic enforces usage limits on Claude Code for subscribers. There are two layers to know about:
- Session windows reset on a rolling 5-hour basis. Heavy use inside a window can throttle you until it resets.
- Weekly caps were added for subscribers in 2025. Sustained heavy use can exhaust a weekly allowance before the week ends.
Common mistake: reading "Max 20x" as "unlimited." It is not unlimited. It is 20x the Pro allowance. A developer running agents in a loop all day can still hit the ceiling.
Model choice moves your limits
Opus consumes allowance far faster than Sonnet. Running everything on Opus drains a plan quickly.
The practical pattern is to default to Sonnet and reserve Opus for hard problems. This stretches a subscription and cuts API spend at the same time.
The 1M context surcharge
Sonnet's extended 1M-token context window carries premium pricing above the standard threshold. Large-context requests above roughly 200K input tokens are billed at a higher rate.
In plain terms: loading an entire large repo into one context is powerful and expensive. Scope the context to the files that matter.
Which path fits you
The decision comes down to volume and predictability.
Choose a subscription if:
- You use Claude Code most days.
- You want a fixed monthly cost with no surprises.
- You dislike watching a token meter.
For that profile, Pro at $20 covers light use. Max at $100 is the common sweet spot for a working developer. Max at $200 suits all-day heavy use.
Choose API billing if:
- Your use is occasional or bursty.
- You run automation and want to meter exact spend.
- You need multiple seats or programmatic access without a per-seat subscription.
If it works — it is correct. There is no wrong choice here, only a fit to your usage shape. Many developers start on Pro, watch where they hit limits, then move to Max or API based on real data.
Hidden costs to plan for
A few line items surprise people. Account for them before committing.
- Failed runs still cost tokens. A session that produces a wrong patch consumed input and output. There is no refund for a bad answer.
- Long-running agents multiply spend. Autonomous loops and multi-step tasks send many turns. Each turn is billed.
- Large repos inflate context. More files in context means more input tokens per request. Caching helps, but the first read is not free.
- Multiple parallel sessions add up. Two agents working at once bill in parallel.
None of these are hidden by Anthropic. They are hidden by habit — the tool feels like a flat product, but the API path meters everything.
What to try right now
Before choosing a plan, measure your real spend. Do not guess.
Try it: run the /cost command inside a Claude Code session on the API path. It reports token usage and dollar cost for the current session. On a subscription, check the usage view in the Anthropic Console or your account settings to see how close you are to limits.
Run a normal task, read the number, and multiply by your realistic daily volume. That single measurement tells you whether Pro, Max, or API pay-as-you-go is cheapest for how you actually work — before you spend a full month finding out.
Information is accurate as of the publication date. Terms, prices, and regulations may change — verify with relevant professionals.