erabot.ai
ProductPricingCase studiesEvalBlogDocs
Book a demo

How much does Claude Code cost? What the number depends on

TL;DR: There are two billing paths, a subscription plan or pay-as-you-go API tokens, and no single dollar figure answers the question. The same task can differ by an order of magnitude between two developers depending on session length, how many tools are attached, and whether the cacheable part of their context stays stable.

What is Claude Code pricing?

Two routes, and they bill on completely different units.

A subscription plan charges a flat monthly fee and meters your usage against an allowance. You are buying predictability. The risk is hitting the allowance mid-week.

The API route charges per token, input and output separately, with a separate and cheaper rate for cached input. You are buying precision. The risk is that a long session costs several times what you expected.

For the current figures on either, go to Anthropic's own pricing page. We deliberately do not restate subscription prices here, because plan structures and limits change and a stale number on this page would be worse than no number. Our LLM API pricing reference covers the per-token side across providers.

How much does the Claude Code API cost compared to the plan?

The crossover is about session shape, not hours worked.

Pay-as-you-go tends to win when your sessions are short and focused, you keep the tool surface small, and you start fresh often. Each session sends little context, so you pay for little context.

The subscription tends to win when you run long exploratory sessions over large codebases. Long sessions are exactly where per-token billing compounds, because every turn re-sends the conversation so far. We work through that arithmetic in why Claude Code is so expensive: a thirty-turn session carries roughly 465 units of input context rather than 30.

If you do not know which describes you, that is the actual finding. Measure a week before you choose.

Why does the same task cost different amounts?

Four things, roughly in order of how much they move the bill.

Session length is the dominant term. Cost grows with the square of the turn count, not linearly, because turn n re-reads turns 1 through n-1.

Attached tools cost on every turn. Every tool available to the agent is described to the model on every request. A large MCP server attached for one lookup becomes a fixed cost on every remaining turn of that session.

What the agent read stays in context. A file it opened on turn 3 is still being re-sent on turn 25. Reading a large log or a generated file early in a session is a cost that keeps being paid.

Cache stability decides the rest. Cached input is far cheaper than fresh input, but a cache only helps if the beginning of your context stays byte-identical. Anything volatile near the start, a timestamp or a session id, invalidates the rest of the prefix.

How do I see what Claude Code cost me?

Use the /cost command in a session for its running total, and your Anthropic console for the billed figure on the API route. Those tell you what you spent.

What they do not tell you is which of the four levers above produced it, because a token counter reports a total, not an attribution. This is the same gap we wrote about in observability tells you what you spent.

Is Claude Code worth the cost?

For your own session spend, that is a judgement call about your time, and we are not the right people to make it for you.

The question we can speak to is a different one that often gets confused with it. Your agent bill is spend on building. If the thing you are building itself calls an LLM, that is a second bill, it runs on every user request rather than every developer hour, and it does not stop when you close the terminal.

We audited 15 open-source AI products to see what that second bill looks like in practice. Across 32,672 source files, 435 contained LLM calls and those held 1,086 call sites. The audit raised 94 cost findings. The breakdown is not what most people expect:

Finding typeCount
Cost optimization69
Caching8
Unnecessary API call8
Architecture6
Model/task mismatch3

Picking the wrong model, the lever everyone reaches for first, was 3 findings out of 94. Almost all of the waste was in how calls were constructed and repeated.

Two of the 15 products scored our top grade with nothing worth fixing, which is worth saying plainly: a well-built AI product is a real and reasonably common outcome, not a hypothetical.

Where to go next

If you want to cut your own session usage, the habits are in how to reduce Claude Code token usage.

If you want to know what the LLM calls inside your product cost and which ones are wasteful, that is what erabot does. Start with a free scan of a single file, or run the CLI in your own environment under your own model keys. Your source never reaches us.


Method: finding counts, call-site counts and grades are direct outputs of erabot's audit of 15 open-source AI products. Cost and savings figures elsewhere in our writing are modeled at stated call volumes and remain estimates until measured against a deployment's real usage. We do not restate Anthropic's plan pricing; check their pricing page for current figures.

EB
erabot.ai

Scan any codebase. See exactly what you spend on AI. Get one-click fixes.

No spam. Only launch updates and cost optimization tips.

Product

  • Product
  • CLI
  • Pricing
  • Changelog
  • Docs

Resources

  • Example audit
  • Blog
  • Case studies
  • Eval

Company

  • Security
  • Privacy
  • Terms
  • Support

© 2026 erabot.ai. All rights reserved.