Claude Code Token Calculator
Estimate your monthly Claude Code cost in seconds. Compares API pay-as-you-go against Pro, Max 5x, and Max 20x plans. Updated for Opus 4.7. Includes INR pricing for Indian developers.
Light: occasional Q&A, small edits. Balanced: daily feature dev, debugging. Heavy: multi-file refactors, agents, exploration.
Pro saves you about $41/month vs API at this usage. You'll rarely hit rate limits.
All plans compared at your usage
Pay-as-you-go
$61/mo
No subscription. Pay per token.
Pro
$20/mo
$17/mo annual. ~44K tokens / 5hr window.
Max 5x
$100/mo
5× Pro usage. ~88K tokens / 5hr window.
Max 20x
$200/mo
20× Pro usage. ~220K tokens / 5hr window.
Claude Code pricing in 2026: the quick reference
Claude Code itself is free to install. You pay for the Claude API access it consumes — either through a subscription plan or pay-as-you-go API billing. These are the current rates as of April 2026.
Subscription plans
| Plan | Price (USD) | Tokens / 5hr window | Best for |
|---|---|---|---|
Pro Entry tier | $20/mo or $17 annual | ~44,000 | Light to moderate daily use |
Max 5x Power user | $100/mo | ~88,000 | Full-time developers |
Max 20x Heavy / agent workflows | $200/mo | ~220,000 | Claude Code as primary tool |
API pay-as-you-go (per million tokens)
| Model | Input | Output | Cache read | Best for |
|---|---|---|---|---|
Haiku 4.5 Fastest, cheapest | $1 | $5 | $0.10 | Simple tasks, classification |
Sonnet 4.6DEFAULT Best balance | $3 | $15 | $0.30 | 80% of coding work |
Opus 4.7 Most capable | $5 | $25 | $0.50 | Complex reasoning, agents |
Cache reads are 90% off the standard input rate. Batch API gives an additional 50% discount on async workloads. Opus 4.7 and Sonnet 4.6 both support the full 1M context window at flat rates.
How Claude Code token usage actually works
Most people picture Claude Code like ChatGPT — you send a prompt, you get a response, you pay for both. That mental model is wrong, and it's why Claude Code costs surprise people in both directions.
A typical Claude Code session reads your codebase repeatedly. Every time you ask it to fix a bug or add a feature, it doesn't just process your prompt — it re-reads the relevant files, your CLAUDE.md, your conversation history, and any tool outputs. That re-reading is where 90%+ of your tokens go.
Anthropic charges three different rates for these tokens. For Sonnet 4.6, fresh input tokens are $3 per million, output tokens are $15 per million, and cache reads are just $0.30 per million — a 90% discount.
The cache discount is the entire reason heavy Claude Code usage doesn't bankrupt people. When the same 2,000-line file gets re-read across 20 prompts in a session, you pay full price once, then 10% of full price 19 more times.
This also means your token bill scales with session length, not just message count. Long sessions where you keep building on the same context are dramatically cheaper per message than 20 fresh sessions doing similar work.
How many tokens does Claude Code actually use?
These are real numbers from tracked Claude Code usage across hundreds of developer-days:
Light user
1–2 hours/day, occasional checks, mostly Sonnet
- Daily tokens5–15M
- API cost/day$2–7
- Pro is enough
Medium user
3–5 hours/day, daily feature work, mixed models
- Daily tokens50–150M
- API cost/day$5–15
- Max 5x sweet spot
Heavy user
6+ hours/day, agents, exploration, Opus-heavy
- Daily tokens200–700M
- API cost/day$15–50
- Max 20x pays off
Real example: One developer who tracked 8 months of intensive Claude Code use found their busiest day hit 8,930 messages across 9 sessions. Their peak month would have cost $5,623 at API rates — versus $200 on the Max 20x plan. The reason? Over 90% of the tokens were cache reads, which are effectively included in flat-rate plans.
How to reduce Claude Code token usage: 12 proven tactics
If you're burning through tokens faster than expected, these are the highest-impact ways to cut your consumption without losing productivity. Tactics are ranked by the typical token savings they deliver.
Use /compact when conversations get long
Type /compact in any session over 50 messages. It summarizes the conversation history into a brief summary while preserving what Claude has learned about your codebase. Saves 60–80% of cache reads on subsequent messages. This is the single highest-impact change for most users.
Use /clear between unrelated tasks
If you're done with a refactor and switching to writing tests for a different feature, /clear resets the entire context to zero. Cache reads drop instantly to nothing. Most people leave Claude Code running with stale context for hours, paying for re-reads of files they're not even touching anymore.
Build a tight CLAUDE.md
Your CLAUDE.md is loaded into every single session. Keep it under 500 lines. Move project-specific docs to separate files that you reference only when needed. A bloated CLAUDE.md silently inflates the cache read cost of every message you send.
Use plan mode before executing
Press Shift+Tab to enter plan mode. Claude generates a step-by-step plan without executing any tools. Plans typically use ~80% fewer tokens than execution because no files get read or written. Approve the plan, then execute. This catches bad approaches before they consume tokens.
Use subagents for heavy reading tasks
If you need Claude to analyze a 5,000-line file or scan an entire directory, spawn a subagent. The subagent has its own isolated context — it reads the file once, summarizes findings, and returns just the summary to your main session. Your main context stays small and cheap.
Default to Sonnet, escalate to Opus only when needed
Sonnet 4.6 is 5× cheaper than Opus 4.7 on output and handles 80% of coding tasks just as well. Use Opus only for hard architecture decisions, multi-file refactors with subtle dependencies, and code review of sensitive changes. Use Sonnet for everything else. Switching defaults can cut costs by 50% overnight.
Be specific about which files to load
Instead of "fix the bug in my auth code," try "fix the bug in src/auth/login.js." Specific paths prevent Claude from grep-searching your whole repo, which can pull dozens of files into context at once.
Disable MCP servers you're not using
Each connected MCP server adds tools to Claude's system prompt — and that prompt is included in every cache read. If you have Linear, Slack, Figma, Notion, and GitHub all connected but only need GitHub today, disable the others. Per-session savings add up fast.
Avoid extended thinking for routine tasks
Extended thinking ("ultrathink", --think hard) generates internal reasoning tokens that get billed as output. For routine refactoring or simple bug fixes, this is wasteful. Reserve thinking modes for genuine reasoning challenges where the answer isn't obvious.
Drop large files from context when done
If you opened a 10,000-line generated migrations file just to check one function, ask Claude to drop it from memory. A simple "you can drop the contents of the migrations file from context now" works. The cache read cost vanishes.
Use /resume sparingly
Resuming an old session pulls all that history back into your cache. If the previous work is finished, start fresh with /clear. Only resume when you genuinely need continuity from the prior conversation thread.
Batch related questions into one prompt
"Refactor this function, add error handling, write the tests, and update the docs" is one round-trip. Asking each separately is four round-trips, each loading the same file context. One thoughtful prompt = one set of cache reads. Four chatty prompts = four sets.
Combined impact: Developers who systematically apply tactics 1, 2, 3, and 6 typically report cutting their Claude Code token usage by 60–75% within two weeks, with no loss in output quality.
/compact vs /clear vs /resume: which saves the most tokens?
The three commands look similar but behave very differently. Picking the right one for the moment is one of the easiest wins in the entire token-optimization playbook.
/clearNukes everything
Conversation history, file context, tool results — all gone. Cheapest possible state. Use when switching to an unrelated task.
/compactKeeps the lessons, drops the history
Preserves what Claude has learned, summarizes verbose history into a brief summary. Typically 5–10% the size of original context. Use when staying on the same task but the session has grown long.
/resumeRebuilds prior context
Pulls a previous session's full context back into cache. Expensive — you're paying to re-load the original cache. Only worth it if you genuinely need that prior conversation thread.
Token cost comparison on a typical 80-message session
| Command | Cache size after | Cost of next message |
|---|---|---|
| Do nothing | 100% (~200K) | $0.06 + new |
/compact | ~10% (~20K) | $0.006 + new |
/clear | 0 | $0 + new |
/resume | 100%+ | $0.06+ + new |
The right pattern for most users: run /compact every 30–50 messages, run /clear whenever you change topics. This single habit will cut a typical month's bill by 30–50%.
Why cache reads are 90% of your Claude Code token bill
When you first send a prompt with file context, Claude pays the full input rate to process and store that content (with a small 25% premium to write the cache). Every subsequent message in that session that re-reads the same context pays just 10% of the input rate.
In practice, this means a Claude Code session looks like a thin layer of fresh tokens on top of a thick base of cache reads. If you read a 50K-token file in message 1, then exchange 30 more messages that all reference it, you pay:
- 1Message 1: 50K tokens at full input rate (with cache write premium) = $0.19 on Sonnet
- 2Messages 2–31: 30 × 50K tokens at cache read rate = $0.45 total (about $0.015 each)
Without caching, those same 30 messages would cost $4.50 — 10× more. This is also why Anthropic's flat-rate plans can absorb what looks like impossible usage: the developer who tracked $5,623/month at API rates was paying mostly for cache reads, which are essentially "free" inside the Max 20x plan.
Claude Code token limits explained (the 5-hour window)
Anthropic doesn't publish exact token caps as contractual numbers, but the planning bands they share in support documentation map roughly to:
| Plan | Tokens per 5-hour window | Weekly cap |
|---|---|---|
Pro $20/mo | ~44,000 | Yes, weighted toward Sonnet |
Max 5x $100/mo | ~88,000 (5× Pro) | Higher, with separate Sonnet cap |
Max 20x $200/mo | ~220,000 (nominal 20× Pro) | Highest, but not unlimited |
Important context: these are planning bands, not contracts. Anthropic explicitly reserves the right to apply additional caps and adjust based on demand. Use these numbers to size your plan choice, not to argue quota with support.
When you hit your limit:
- •Without "extra usage" enabled: you're blocked until the 5-hour window resets
- •With "extra usage" enabled: you continue at standard API rates with an optional monthly cap
- •The 5-hour window is rolling — it starts when you start using Claude Code, not on clock-time
Claude Code pricing in India (INR + GST)
Anthropic prices Claude Code in USD, but Indian users pay through their bank or card with USD-to-INR conversion plus 18% GST applied at checkout.
| Plan | USD / month | INR / month (incl. 18% GST) |
|---|---|---|
Pro | $20 | ~₹1,985 |
Pro (annual)SAVE $170/year ($14/mo) | $170/yr | ~₹16,870/yr |
Max 5x | $100 | ~₹9,920 |
Max 20x | $200 | ~₹19,840 |
INR figures use approximate FX rate of ₹84/USD. Actual amount depends on your bank's conversion rate and any forex markup (typically 0.5–3.5%).
Payment notes for Indian users
- ✓Most international Visa, MasterCard, and Amex cards work
- !RBI's two-factor authentication adds an extra OTP step at checkout
- ✗UPI is not currently supported for Anthropic subscriptions
- ✓The annual Pro plan ($170) saves ~₹2,500 vs monthly billing
- ✓API billing is also USD-denominated; pay as you use with credit pre-loading
- →For freelancers, Max 5x typically pays for itself by saving 4–6 hours/week of waiting on rate limits during client work
How this calculator works (methodology)
Transparency matters when you're trusting numbers to make a buying decision. Here's exactly how this calculator arrives at its estimates:
Quick estimate mode
Uses per-hour cost averages calibrated against three data sources: Anthropic's official pricing pages, public usage breakdowns from developers running Claude Code as their primary tool, and tracked sessions across small, medium, and heavy workloads. The per-hour rates assume an 85% cache hit rate, which matches what most developers report after 3+ weeks of regular use.
By tokens mode
Uses Anthropic's published API pricing directly: $1/$5 (Haiku 4.5), $3/$15 (Sonnet 4.6), $5/$25 (Opus 4.7) per million tokens, with cache reads at 10% of input rate. No estimation, just direct math.
Plan recommendation thresholds
Match Anthropic's own breakeven guidance: under $18/mo of API equivalent → API; $18–90 → Pro; $90–190 → Max 5x; above → Max 20x. These thresholds are conservative — they don't account for the productivity cost of rate-limit interruptions, which often justifies upgrading earlier than pure cost math suggests.
What this calculator doesn't model
- •Rate-limit interruption cost (implicit in plan recommendations only)
- •Burst usage patterns that swing dramatically week-to-week
- •Server-side tool fees (web search at $10 per 1,000 searches)
- •Long-context surcharges (none on current Sonnet 4.6 / Opus 4.7 — flat across 1M context)
- •Batch API discounts (50% off, but Claude Code doesn't use batch)
INR conversion uses live exchange rates fetched from exchangerate-api.com, with a fallback of ₹84/USD if the API is unreachable. GST is shown separately in the India pricing section but not added to calculator output (since GST is applied at checkout, not on usage).
Last calibrated: April 18, 2026. Next scheduled review: when Anthropic publishes pricing changes or releases the next model generation.
Frequently asked questions
How much does Claude Code cost per month?
+
Claude Code costs $20/month on the Pro plan, $100/month on Max 5x, or $200/month on Max 20x. You can also use it via the API at pay-as-you-go rates: Sonnet 4.6 at $3 input / $15 output per million tokens, Opus 4.7 at $5/$25, and Haiku 4.5 at $1/$5. For most full-time developers, monthly costs land between $20 and $200.
How many tokens does Claude Code use in a typical session?
+
A light user (1-2 hours/day) uses about 5-15 million tokens per day. A medium user (3-5 hr/day) uses 50-150 million tokens daily. Heavy users (6+ hr/day with agents) can hit 200-700 million tokens daily. Over 90% of these are typically cache reads, which Anthropic charges at 10% of input rate.
What is the cheapest way to use Claude Code?
+
The cheapest way depends on your usage. If you use Claude Code less than 6 million tokens per month, pay-as-you-go API billing is cheapest. Between 6 million and 30 million tokens monthly, the Pro plan at $20 saves money. Heavy daily users save the most with Max 5x ($100) or Max 20x ($200). Use the calculator above to find your exact breakeven.
Why is my Claude Code burning through tokens so fast?
+
The most common causes are: a bloated CLAUDE.md file that gets loaded into every session, leaving Claude Code running with stale context after switching tasks, using Opus when Sonnet would suffice, having too many MCP servers enabled, and not running /compact during long sessions. Cache reads accumulate quickly when context grows.
What is the difference between /compact and /clear in Claude Code?
+
/clear nukes your entire context including conversation history and file references — cache reads drop to zero. /compact preserves what Claude has learned about your project but summarizes verbose history into a brief summary, typically 10% of original size. Use /clear when switching to unrelated tasks. Use /compact when staying on the same task but the session has grown long.
Is the Claude Pro plan enough for full-time development?
+
Pro at $20/month works for solo developers on small-to-medium codebases doing focused 1-3 hour sessions. If you run Claude Code continuously throughout a 6+ hour workday, work in large codebases, or use agent workflows, you will hit the ~44,000 token per 5-hour window limit and need to upgrade to Max 5x.
When should I upgrade from Pro to Max?
+
Upgrade when rate-limit interruptions cost you more than the price difference. A practical signal: if you wait for the 5-hour reset more than twice a week, Max 5x ($100) will pay for itself in recovered productivity. If Claude Code is your primary tool all day, jump straight to Max 20x ($200).
Can I use Claude Code without a subscription?
+
Yes. Claude Code works directly with the Anthropic API at pay-as-you-go rates. You will need API credits (start with the free $5 credit) and your costs will scale with usage. For occasional or variable workloads, this is often cheaper than a subscription.
How accurate is this Claude Code token calculator?
+
Quick estimate mode is calibrated against real tracked usage data and assumes an 85% cache hit rate (the typical observed rate). Actual costs vary ±20% based on your specific workflow, codebase size, and how aggressively you use cache-friendly patterns. By-tokens mode uses exact Anthropic API pricing with no estimation. Plan recommendations match Anthropic published breakeven thresholds.
Does Claude Code work in India? How much does it cost in INR?
+
Yes, Claude Code works in India. Pricing is in USD: Pro is $20/month (~₹1,985 with 18% GST), Max 5x is $100 (~₹9,920 with GST), and Max 20x is $200 (~₹19,840 with GST). Most international Visa, MasterCard, and Amex cards work. UPI is not supported. The annual Pro plan saves ~₹2,500 vs paying monthly.
What is the Claude Code 5-hour window?
+
Claude Code usage limits reset on a rolling 5-hour basis, not a fixed clock time. From the moment you start using Claude Code, you have 5 hours before that window resets. Pro allows ~44K tokens per window, Max 5x allows ~88K, Max 20x allows ~220K. With extra usage enabled, you can continue past the limit at standard API rates.
How can I check my Claude Code token usage?
+
On API billing, the Anthropic dashboard shows real-time costs. On Pro and Max subscriptions, your usage is visible in Settings > Usage on claude.com. For session-level detail, parse the JSONL files in ~/.claude/ to see prompt counts, token usage, and session durations. Open-source tools like Claude Cost Tracker can visualize this data.
About this calculator
This calculator is built and maintained by the ToolStackHub team. We've been using Claude Code daily since its public release and have tracked actual token consumption across web app builds, content tooling, and SEO automation projects.
Pricing data is verified against Anthropic's official API pricing page and updated whenever Anthropic publishes changes. If you spot anything outdated, email us at hello@toolstackhub.in and we'll fix it within 24 hours.
ToolStackHub is an independent tools site. We do not receive payment from Anthropic and have no commercial relationship with them. Plan recommendations are based purely on cost math.