GUIDE

How Much Does Claude Code Cost? Token Pricing, Explained

If you use Claude Code every day, the token counters can look terrifying — millions, sometimes hundreds of millions of tokens in a week. But raw token counts are a poor guide to what you actually pay. Most of those tokens are cheap cache reads, your model choice matters more than volume, and whether you pay per token at all depends on which billing path you're on. This guide breaks down how Claude Code cost really works — the four token classes, per-model rates, subscription vs pay-as-you-go — and shows how to see your own real number, computed locally on your machine.

Last updated 11 July 2026

The short version

  • Claude Code is billed two ways: included in a Claude Pro or Max subscription (a flat monthly fee), or pay-as-you-go via the Anthropic API (billed per token).
  • Per-token cost depends on the model (Opus > Sonnet > Haiku) and the token class — output is the most expensive, cache reads the cheapest, at about a tenth of the input rate.
  • Raw token counts look enormous because coding sessions reuse huge amounts of cached context — but those cache-read tokens are billed at roughly 10% of the input rate, so real cost is far smaller than the raw number suggests.
  • The only way to know your number is to look at your own usage. Token Forest's dashboard estimates it locally from your logs, fully offline.

Two ways Claude Code is billed

Before you can answer "is Claude Code expensive?", you need to know which meter you're on. There are two, and they behave completely differently.

1. A Claude Pro or Max subscription (flat monthly fee)

Claude Pro and the Max tiers bundle Claude Code together with Claude on the web, desktop, and mobile. You pay a fixed monthly price and your Claude Code usage draws from the same shared allowance as your chats — there's no per-token bill. Usage is capped by rolling limits (a short rolling window plus a weekly ceiling) rather than a dollar amount, so cost is predictable, but heavy days can hit a wall until the window resets. As of 2026-07-11, Pro is around $20/month, and the Max tiers are around $100/month (roughly 5x Pro's capacity) and $200/month (roughly 20x). Check Anthropic's plan page for current limits.

2. Pay-as-you-go via the Anthropic API

If you authenticate Claude Code with an API key instead, every token is billed at standard API rates with no cap — heavy all-day runs never get throttled by a window, but the bill scales directly with what you use. One gotcha: if an ANTHROPIC_API_KEY is set in your environment, Claude Code uses it instead of your subscription, so you can rack up API charges without realising your Pro/Max plan was sitting right there.

Rule of thumb: if your usage is steady and moderate, a subscription is usually cheaper and more predictable. If it's bursty or very heavy, API billing removes the window but the meter never stops. Either way, watching your actual token mix — not the raw count — is what tells you whether you're overpaying.

The four token classes — and why raw counts look scary

Every Claude request splits its tokens into four classes, and they are not priced the same. Understanding the mix is the single biggest key to reading your cost.

  • Input — the tokens you send: your prompt, files, and conversation history. Priced at the model's base input rate.
  • Output — the tokens Claude generates back. The most expensive class, typically about 5x the input rate.
  • Cache write — the first time a big chunk of context (a system prompt, a large file) is stored so it can be reused. Priced slightly above input: about 1.25x for the short-lived cache, 2x for the long one.
  • Cache read — reusing already-cached context on a later request. The cheapest class by far, at about 0.1x — one tenth of the input rate.

Coding agents like Claude Code lean heavily on caching: the same project files and instructions get re-sent turn after turn, so a huge share of your raw token count is cache reads. That's why the headline number looks enormous. But because cache reads cost about a tenth of input, they translate into far less money than the raw count implies.

The counter-intuitive part: in Token Forest's own six-week sample, cache reads were about 57% of the real dollar cost while input and output together were only about 24% — the rest was cache writes. Cache reads are cheap per token, but there are so many of them that they still add up. Raw token totals overstate cost; the dollar-weighted mix is what matters.

How model choice drives cost

After the token mix, the model you run is the biggest lever. Claude's tiers trade capability for price: Opus is the most capable and most expensive, Sonnet sits in the middle, Haiku is the cheapest and fastest. Output tokens cost about 5x input across all of them, and cache reads are always about a tenth of input. Rates below are per million tokens (MTok), confirmed from Anthropic's pricing page on 2026-07-11 — they change, so treat them as a snapshot and check the source for current numbers.

Model (tier)Input /MTokOutput /MTokCache read /MTok
Claude Opus 4.8 (most capable)$5$25$0.50
Claude Sonnet (mid-tier)$3$15$0.30
Claude Sonnet 5 (intro, thru 31 Aug 2026)$2$10$0.20
Claude Haiku 4.5 (fastest, cheapest)$1$5$0.10

The practical takeaway: running Opus for everything costs about five times more per token than Haiku. Many workflows use a cheaper model for routine edits and reserve the top tier for hard reasoning. Whether that's worth it depends entirely on your work — which, again, you can only judge from your own numbers.

So — is Claude Code expensive?

Honestly: it depends, and the raw token counter is the worst way to guess. On a Pro or Max subscription, your Claude Code cost is simply the flat monthly fee, no matter how many tokens scroll past. On API billing, cost tracks your real token mix — and because cache reads dominate volume at a tenth of the price, most people's real spend is a lot lower than the eye-watering raw totals suggest. The only honest answer is your answer, from your own logs.

How to see your real cost — locally, offline

Token Forest reads the usage logs Claude Code (and OpenAI Codex) already write on your machine and turns them into a plain-English cost estimate. It uses only the token counts, model names, and timestamps — never your source code, prompts, or conversation content — and it works with the network fully disabled. Nothing is uploaded.

  1. Install Token Forest (free public beta) for Windows or macOS and let it read your local Claude Code and Codex logs.
  2. Open the Usage view for daily, weekly, and monthly charts, a per-model breakdown, a burn-rate figure, and a per-project split.
  3. Open the Chats view to see one line per conversation — its four token classes and an estimated cost — so you can spot which sessions actually cost money.
  4. Use the Growth view to watch your spend as a living pixel tree, with a "this tree ≈ $X" readout per stage.

The dashboard's cost figure is an estimate from a bundled price table — computed locally, and it may differ from your actual Anthropic or OpenAI invoice. Treat it as a fast, private read on where your tokens go, and reconcile against your official bill for exact amounts.

Prefer the terminal? ccusage, an independent open-source CLI by ryoppippi, reads the same Claude Code logs and prints cost reports as text. Token Forest is a visual alternative, not a front-end for it — same idea, different surface. Use whichever fits your workflow.

Frequently asked questions

How much does Claude Code cost?

It depends on your billing path. On a Claude Pro or Max subscription it's a flat monthly fee (roughly $20 for Pro, and about $100 and $200 for the Max tiers as of 2026-07-11) with usage limits instead of a per-token bill. On API pay-as-you-go, you're charged per token at each model's rate, so the total tracks how much you actually use. To see your own figure, check your usage in Token Forest's dashboard.

Why are my Claude Code token counts so high?

Because coding sessions reuse a lot of cached context — the same files and instructions are re-sent every turn as cache reads. Cache reads can be the majority of your raw token count, but they're billed at about a tenth of the input rate, so they cost far less than the number implies. The raw total overstates your real spend.

What's the cost per token for Claude Code?

There's no single number — it depends on the model and the token class. As a snapshot on 2026-07-11: output is the priciest (about $25/MTok on Opus, $5 on Haiku), input is roughly a fifth of output, and cache reads are the cheapest at about a tenth of input. Sonnet sits between Opus and Haiku. Check Anthropic's pricing page for current rates.

Is Claude Code expensive?

For most steady users, no — especially on a subscription, where cost is a fixed monthly fee. On API billing it can add up with heavy Opus use, but cache reads keep real cost well below what raw token counts suggest. The way to know for sure is to look at your own usage, which Token Forest estimates locally.

Does Token Forest see my real Anthropic bill?

No. Token Forest never connects to your Anthropic or OpenAI account. It estimates cost locally from the token counts in your own logs using a bundled price table, so its figure may differ from your official invoice. It's a private, offline read on where your tokens go — reconcile against your real bill for exact amounts.

See what your tokens actually cost

Token Forest turns your local Claude Code and Codex logs into a private, offline cost estimate — no account, no upload, network-optional. Watch your usage grow into a pixel tree while the dashboard does the maths.