Skip to main content
Budget

The real costs of Claude Code

Transparent analysis of Claude Code costs: subscriptions, API pricing, hidden costs, and tips to optimize your spending. Make an informed choice.

Tokens = money: understanding what gets billed

Every interaction with Claude Code consumes tokens, units of text that the model processes. Everything counts: your prompt, the conversation context, files Claude reads, MCP schemas, and of course the generated responses.

What is a token?

A token corresponds to roughly 4 characters in English (or about 3 in French, which uses more tokens per word due to accents and longer words). "Claude Code is powerful" is about 5 tokens. A full A4 page of text is roughly 500 to 700 tokens.

There are two types of tokens, billed differently:

  • Input tokens: everything Claude receives, your message, the history, files read, MCP results
  • Output tokens: responses generated by Claude, code, explanations, files

Output tokens typically cost 3 to 5 times more than input tokens.

Official Anthropic pricing (March 2026)

Prices subject to change

Anthropic pricing may change. Always check current rates at anthropic.com/pricing before budgeting. The figures below are those published at the time of writing.

Per-model pricing via direct API

ModelInput (per million tokens)Output (per million tokens)
Claude Haiku 4.5~$0.80~$4
Claude Sonnet 4.5~$3~$15
Claude Opus 4.5~$15~$75

For a typical development session with Sonnet (the default model):

  • Light session (30 min, simple questions): 50,000 tokens -> **$0.30**
  • Medium session (2h, module refactoring): 200,000 tokens -> **$1.20**
  • Intensive session (full day, large project): 500,000 tokens -> **$3.00**

MCP impact on costs: concrete calculations

MCPs have a direct impact on your token consumption, often overlooked. Here are estimates based on the actual MCP architecture.

Startup cost based on active MCPs

At the start of each session, Claude loads tool schemas from all configured MCPs. This "fixed cost" is paid before you even type your first message.

ConfigurationActive MCPsStartup tokensStartup cost (Sonnet)
No MCP0~500 (CLAUDE.md)~$0.002
Minimal setup3 MCPs (filesystem, github, context7)~8,000~$0.024
Standard setup10 MCPs~25,000~$0.075
Maximal setup20+ MCPs~60,000+~$0.18+

Startup costs add up

If you start 5 sessions per day with 10 active MCPs, the startup cost alone amounts to ~$0.375/day, or ~$11/month, before you've typed a single line of code. On the direct API, that's not negligible.

Simulation: a 2-hour session with different configurations

# Session type: feature development (module refactoring)

SCENARIO A: No MCP
  Startup             :    500 tokens input
  User prompts        :  5,000 tokens input
  Code read by Claude : 30,000 tokens input
  Claude responses    : 15,000 tokens output
  TOTAL               : 35,500 input + 15,000 output
  COST (Sonnet)       : ~$0.11 + ~$0.23 = ~$0.34

SCENARIO B: With 3 MCPs (filesystem, github, context7)
  MCP startup         :  8,000 tokens input
  User prompts        :  5,000 tokens input
  Code read by Claude : 30,000 tokens input
  MCP results         :  8,000 tokens input (call results)
  Claude responses    : 15,000 tokens output
  TOTAL               : 51,000 input + 15,000 output
  COST (Sonnet)       : ~$0.15 + ~$0.23 = ~$0.38

SCENARIO C: With 10 active MCPs
  MCP startup         : 25,000 tokens input
  User prompts        :  5,000 tokens input
  Code read by Claude : 30,000 tokens input
  MCP results         : 12,000 tokens input
  Claude responses    : 15,000 tokens output
  TOTAL               : 72,000 input + 15,000 output
  COST (Sonnet)       : ~$0.22 + ~$0.23 = ~$0.45

The difference between 0 and 10 MCPs for the same session is ~$0.11, which may seem modest per session but represents $30/month over 5 sessions/day.

Claude Max subscriptions: what you're actually buying

Claude Max (formerly Claude Pro) is a fixed-price subscription that seems unlimited, but isn't.

What Claude Max includes

  • Priority access to Claude without queuing
  • Increased message limit (not unlimited)
  • Access to the latest models including Opus

The real limits

Claude Max is subject to message limits per time window (typically per hour or per day). These limits vary based on server load and aren't precisely published. In practice:

  • Light usage (fewer than 20 messages/hour): you'll never hit the limit
  • Heavy usage (continuous 4h+ sessions): you may experience throttling: Claude responds more slowly or asks you to wait

Claude Max is not unlimited

"Unlimited" in the Claude Max context means "no fixed per-token billing quota", not "you can make as many requests as you want at full speed". Intensive professional usage may encounter rate limits.

Plan comparison table

Free trialClaude ProClaude MaxDirect API
Monthly costFree~$20/month~$100/monthPay-per-use
Available modelsHaiku onlySonnet + HaikuSonnet + OpusAll
Message limitVery restrictive~1000/monthHigh but limitedUnlimited (pay per token)
Throughput priorityLowStandardHighStandard
MCPs availableNoYesYesVia SDK
Ideal forDiscoveryRegular useIntensive professionalDev/enterprise
Predictable costYesYesYesNo (variable)

When to choose the direct API vs a subscription

Prefer a subscription (Pro or Max) if:

  • You want predictable costs
  • You use Claude Code daily for development
  • You're getting started and want to explore without billing surprises

Prefer the direct API if:

  • Your usage varies a lot (active some months, not others)
  • You integrate Claude into your own tools
  • You want precise control over which model you use
  • Your usage is low (less than $50/month in API costs)

Hidden costs of third-party MCPs

Some popular MCPs rely on paid third-party APIs you must also subscribe to.

MCPThird-party APIEstimated cost
MCP Tavily (web search)Tavily API~$0.01/search, 1,000 free/month
MCP Exa (search)Exa API$0.01/search, limited free plan
MCP Firecrawl (scraping)Firecrawl$0.0002/page, limited free plan
MCP BrowserbaseBrowserbaseVariable, plans from $10/month
MCP Resend (emails)Resend APIFree up to 100 emails/month
MCP Stripe (payments)Stripe APIFree (transaction fees apply)

Calculate the total cost of ownership

Before adopting an MCP, check whether it has paid API dependencies. A "free" web search MCP can cost you $20/month in third-party API fees if you use it heavily.

Cost/value optimization strategies

1. Only load the MCPs needed for the session

Use per-project .mcp.json files to load only relevant MCPs:

// For a frontend project without a database
// .mcp.json at the project root
{
"mcpServers": {
"filesystem": { ... },
"playwright": { ... }
}
}
// GitHub, PostgreSQL, Slack -> not loaded = context savings

2. Use /cost to monitor your consumption

# In a Claude Code session
/cost
# Shows: input tokens, output tokens, estimated session cost

Use this command regularly to identify expensive sessions and adjust your prompts.

3. Write precise prompts

A vague prompt generates a long, often unsuitable response that you'll need to correct with a second prompt. Double the cost for an inferior result.

# Expensive and inefficient
"Improve my code"
# Precise and cost-effective
"In src/auth/auth.service.ts, lines 45-60:
optimize the SQL query to avoid the N+1 problem.
Use eager loading with Prisma. Keep TypeScript types."

4. Prefer Sonnet over Opus unless the task warrants it

Opus costs 5x more than Sonnet. For most development tasks, Sonnet is sufficient. Reserve Opus for:

  • Complex system architecture
  • In-depth security analysis
  • Massive refactors requiring a global view

5. Use /compact proactively

A lighter context = fewer input tokens per message. /compact can cut end-of-session costs by 2-3x.

Estimating your monthly budget

# Monthly calculation formula

Sessions/day x Days/month x Cost/session

Example: Independent developer, daily usage:
3 sessions/day x 20 days/month x $0.38/session
= ~$23/month via direct API

-> Claude Pro (~$20/month) would be more affordable and predictable
-> Claude Max (~$100/month) is only justified at 5+ intensive sessions/day

Next steps