← All guides

Claude Code pricing: how the cost model actually works

Two ways to pay, why token usage adds up, and practical ways to keep your bill under control.

There is no single sticker price. Claude Code is paid for in one of two ways. You either run it under a Claude subscription plan, where a monthly tier covers your usage up to some limits, or you connect it to the Anthropic API and pay as you go for the tokens you actually use. Heavy work on large codebases costs more because more code means more tokens, and an agent that loops over many steps sends many messages. Light use is cheap. Sustained, large context work is where the cost shows up.

The two ways you pay for Claude Code

Claude Code does not have one flat price. You pay for it in one of two models, and the right one depends on how you work. The first is a Claude subscription. You pick a monthly tier, and that tier covers your usage up to certain limits before it throttles or stops. This is predictable. You know the monthly number in advance, and for steady daily use it is usually the simpler choice. The second is pay-as-you-go API pricing. You connect Claude Code to the Anthropic API with your own key, and you are billed per token for what you send and receive. There is no fixed monthly commitment. You pay for exactly what you use, which is efficient for light or bursty usage but harder to predict when work gets heavy.

The key mental model is this. A subscription trades a fixed monthly cost for capped usage. Pay-as-you-go trades unpredictability for paying only for real usage. Neither is universally cheaper. It depends on your volume. Prices and plan limits change over time, so always check the current numbers on Anthropic's own pricing page rather than trusting a figure you read months ago.

Why the cost can add up

Big codebases mean more tokens

Every file, diff, and error message the model reads is counted as input tokens. The larger the context you feed it, the more each message costs.

Agent loops multiply messages

A coding agent does not send one message. It reads, plans, edits, runs a command, reads the result, and tries again. Each step is a round trip that consumes tokens, so a single task can be many billed calls.

Long sessions carry history

As a conversation grows, earlier context often gets resent so the model stays coherent. A long session can quietly re-pay for the same history many times.

Large system prompts tax every message

Some tools ship a big built-in system prompt that is prepended to every single request. That fixed overhead is paid on every message, whether the task is trivial or complex.

Premium models cost more per token

The most capable models are priced higher per token than smaller ones. Using a top model for simple edits spends more than the task needs.

If you are on pay-as-you-go, treat token usage like an electricity meter. It is not the sticker price that hurts, it is leaving heavy context running all day.

How to keep Claude Code costs down

Practical tactics that actually move the bill

  1. Prune the context you sendDo not dump the whole repo into every request. Point the agent at the specific files and folders that matter. Start fresh sessions for unrelated tasks so old history stops riding along.
  2. Use a cheaper model for simple workReserve the most capable model for genuinely hard reasoning. For renaming, small edits, boilerplate, and quick questions, a smaller and cheaper model is usually enough.
  3. Avoid huge system promptsKeep whatever standing instructions the tool prepends to every message lean. Every extra paragraph in a system prompt is paid on every single call, so trim it to what you truly need.
  4. Watch the agent loopsIf the agent is retrying the same failing command or wandering, stop it and give it a tighter instruction. An agent stuck in a loop burns tokens fast with nothing to show for it.
  5. Break work into focused tasksSmaller, well-scoped requests keep context small and let you catch a wrong direction early, before it has spent a lot on a bad path.

Want more control over cost?

If cost predictability is your main concern, it helps to use a tool that lets you choose how you pay instead of locking you into one meter. Wuwei is a free, open-source coding agent built around that idea. You can bring your own Claude API key or subscription and keep using the models you already pay for, so Wuwei itself adds nothing to that bill. Or you can use Wuwei's hosted models, which are priced in coins with a genuinely free tier. There are free hosted models you can try with no login, registering grants a starter batch of coins, and a daily check-in adds more, with membership plans available if you want more hosted quota. One more detail that matters for token spend: Wuwei's own system prompt is lean and you can edit it, so you are not paying for a large built-in prompt on every message. This is not a claim that Wuwei is always cheaper. It is a way to see and control where your money goes.

FAQ

Is Claude Code free?

Claude Code the tool is available to install, but running it is not free because the underlying model usage is paid. You cover that either through a Claude subscription tier or through pay-as-you-go API billing per token. There is no way to run meaningful workloads at zero cost through Anthropic. If you want a genuinely free option, an open-source agent like Wuwei offers free hosted models to try without login.

Is Claude Code worth it?

For developers who use it daily on real code, most find the time saved outweighs the cost, especially on a subscription tier where the monthly number is predictable. For occasional or light use, pay-as-you-go can be very cheap. The honest answer is that it depends on your volume and how disciplined you are about context and model choice. If you burn tokens carelessly on large context all day, the value proposition gets worse.

Why is Claude Code so expensive and burning through tokens?

Usually it is not the price per token, it is how much context is flowing. Large codebases sent in full, long sessions that keep resending history, big system prompts paid on every message, and agent loops that retry many times all multiply token usage. Prune the context, start fresh sessions for new tasks, keep system prompts lean, use cheaper models for simple work, and stop runaway loops. Those changes usually cut the bill more than switching plans does.

Can I use Claude Code without a subscription?

Yes. Instead of a subscription you can connect it to the Anthropic API with your own key and pay as you go per token. That suits light or bursty usage where a fixed monthly plan would be wasteful. You can also step outside Anthropic entirely and use an open-source agent like Wuwei, which lets you bring your own key or use its hosted models with a free tier.

Claude Code pricing comes down to two levers you control: which plan you pay under, and how many tokens you let flow. Get both right and it is affordable. If you want to see and cap where the money goes, or just try a capable agent for free first, Wuwei is free and open source. Bring your own Claude key or use its free hosted models, with no login needed to start. Download at /en#download.

Windows · macOS · Linux — free, no login