Room 42, home

Token usage and cost: cut your Claude bill

What drives your Claude Code bill, and the levers that cut it: model choice, effort level, and a clean, well-managed context window.

Codingintermediate6 min readUpdated 12 Jun 2026

In short

  1. 01Tokens are the unit the model bills, and output costs roughly five times more per token than input across every model tier.
  2. 02The biggest hidden cost is context length, since the whole conversation is resent each turn and grows the bill toward O(n squared).
  3. 03Use the cost command to watch spend, switch to a cheaper model for simple work, and lower the effort level when reasoning is not needed.
  4. 04Keep the context lean with clear and compact, cache stable content, and ask for short answers to cut the expensive output tokens.
Contents · 12 sections
  1. 1What is a token?
  2. 2Why does output cost more than input?
  3. 3How do I see my cost in Claude Code?
  4. 4How do I pick the right model?
  5. 5Controlling effort level
  6. 6Why does context length drive cost per turn?
  7. 7/clear and /compact: your two context controls
  8. 8Worked cost estimate
  9. 9Practical levers summary
  10. 10Keeping output concise
  11. 11Cache stable content
  12. 12What comes next

Tokens are the unit of work the model bills. Every prompt you type, every reply you receive, every tool result fed back through the context costs tokens. Once you run agents at scale, the accounting stops being optional. A loop that burns 200k tokens a run at midnight looks fine in testing and catastrophic on the invoice.

What is a token?

A tokena chunk of roughly 3-4 characters of English text, or about 0.75 words on average is the smallest unit the model reads and writes. The tokenizer is language-sensitive: English text is efficient (~4 chars/token), code is slightly denser, and non-Latin scripts can cost 2-4x more tokens per character.

Rough conversion rules for back-of-envelope estimates:

  • 1,000 tokens ≈ 750 words of English prose
  • 1,000 tokens ≈ 500-600 tokens of dense TypeScript
  • A full page of a PDF ≈ 400-700 tokens depending on layout and encoding

Why does output cost more than input?

The model charges separately for input and output tokens, and output costs a good deal more per token than input. Current pricing for the main tiers:

ModelInput (per 1M)Output (per 1M)Output/input ratio
Claude Haiku 4.5$1.00$5.005x
Claude Sonnet 4.6$3.00$15.005x
Claude Opus 4.8$5.00$25.005x
Claude Fable 5$10.00$50.005x

The 5x multiplier holds across tiers. Every output token costs five times what you paid to prompt it. Long chain-of-thought, padded JSON, and waffle in responses burn money fast.

Pricing changes. Always verify current numbers at docs.anthropic.com/en/docs/about-claude/pricing before committing to a cost model.

How do I see my cost in Claude Code?

Claude Code tracks token spend for your session. Run /cost at any point to see a breakdown of input tokens, output tokens, and estimated dollar spend for the current conversation.

# inside a Claude Code session
/cost

The output shows:

  • Tokens used this session (input and output separately)
  • Estimated cost at the current model's rates
  • Cache hits if prompt caching is active

Check /cost after a large file-read or a long planning pass. If a single turn burned more than you expected, trim the context before you carry on.

How do I pick the right model?

Every session uses one model. The default is Sonnet 4.6, which covers most coding tasks well. Switch with /model when the task is clearly cheaper elsewhere:

/model haiku     # drop to Haiku 4.5 for quick edits, grep-style lookups, or drafting
/model sonnet    # default · balanced reasoning and cost
/model opus      # step up for hard debugging or architecture decisions
SituationRecommended modelWhy
Quick rename or one-liner fixHaiku 4.53x cheaper input, 3x cheaper output than Sonnet
Normal feature workSonnet 4.6Best cost-to-quality balance
Complex debugging, architectureOpus 4.8Stronger reasoning; justify the extra spend
Large-scale eval or batch reviewHaiku 4.5Volume makes savings compound fast

A common pattern: triage on Haiku first, then escalate to Sonnet for the full response. Claude Code makes that a two-command switch.

Controlling effort level

Plenty of tasks do not need the model's full reasoning budget. A lower effort level means shorter chain-of-thought and fewer output tokens.

/effort low      # quick answers, minimal elaboration
/effort medium   # default
/effort high     # deliberate step-by-step reasoning

Use /effort low for lookups, reformatting, and questions with obvious answers. Save /effort high for the turns where slower, more careful reasoning earns its keep. A high-effort 2,000-token response costs four times a 500-token low-effort one at the same output rate.

Why does context length drive cost per turn?

In a multi-turn session, the whole conversation history goes back to the model on every turn. This is the cost driver people overlook most in agent work.

By turn 10, all prior turns accumulate in the input. A session that averages 300 tokens of history growth per turn costs O(n²) in total input tokens across n turns. For a 20-turn session with 300-token turns, that is roughly 60,000 input tokens in accumulated history alone, before counting your actual prompts.Common gotchaWhen a session feels expensive, the reflex is to switch to a cheaper model with /model, but that does nothing about the bloated history you keep resending every turn at the new rate.The accumulated context is the cost, so reach for /compact or /clear first, then drop the model.

/clear and /compact: your two context controls

Claude Code gives you two commands to keep the context window lean.

/clear wipes the conversation and starts fresh. Use it when a task is done and the next one is unrelated. A clean slate costs nothing to carry forward.

/compact summarises the conversation in place, swapping the raw history for a compressed version. Context length drops; continuity holds. Use it mid-session when the history has grown large but the work is not done.

# finished debugging, moving on to a new feature
/clear
 
# deep into a long refactor, context is bloating
/compact

A good rule: run /cost, and if the session has crossed a threshold that feels high for where you are in the task, run /compact. The next /cost then shows a smaller context and a reset spend counter for the work that is left.

Worked cost estimate

Imagine a code-review session that, on each invocation:

  • Sends a 2,000-token system prompt
  • Attaches 3,000 tokens of file context
  • Receives a 1,500-token review

No caching, Sonnet 4.6 pricing:

ComponentTokensRateCost
System prompt2,000$3/1M$0.006
File context3,000$3/1M$0.009
Output (review)1,500$15/1M$0.0225
Total per run6,500$0.0375

At 500 runs per day: $18.75/day, $562/month.

Switch to Haiku 4.5 with /model haiku for a triage pass that only classifies severity before routing harder cases back to Sonnet:

StepModelTokensCost
Triage (classify)Haiku 4.51,500 in / 50 out~$0.0016
Full review (Sonnet)Sonnet 4.65,000 in / 1,500 out~$0.0375
Skip review if low-severitySonnet 4.60$0

If 40% of files are low-severity and skip the full review, monthly cost at 500 runs/day drops by roughly 40% of the Sonnet share.

Practical levers summary

LeverCommand or configEffect
See current session spend/costInstant visibility
Switch model down/model haiku3x cheaper per token
Lower reasoning depth/effort lowFewer output tokens
Wipe context/clearEliminate accumulated history
Compress context/compactReduce without losing continuity
Cache stable prompts.claude/settings.json cache config~10x cheaper on repeated reads
Constrain outputAsk for "brief" or "one paragraph" in promptFewer output tokens at 5x rate

Keeping output concise

Verbose output is expensive at 5x the input rate per token. Put a length instruction in the prompt itself:

Try this prompt
Review this function for correctness and style. Respond in at most three bullet points. Do not restate the function.

A 500-token answer costs a third of a 1,500-token one at the same rate. That difference multiplies across every call in a long session.

Cache stable content

Anything that stays constant across many calls is a candidate for prompt caching: your CLAUDE.md instructions, a large codebase context, reference documentation. Claude Code gets the benefit automatically when it re-reads stable files. A cache read costs around 10% of the standard input rate.Common gotchaCaching is not free to set up: the first write of a cache entry costs more than a normal input read, and the entry expires after a few minutes idle.Cache content you reuse soon and often, or you pay the write premium and never earn it back.

The Prompt Caching guide covers the exact syntax and TTL mechanics for controlling what gets cached and for how long.

What comes next

Two guides build straight on this foundation:

  • Prompt Caching covers the exact syntax for cache breakpoints, TTL tiers, and how to structure a system prompt so the cached prefix survives model updates.
  • Context Engineering covers how to keep the rolling context window lean: summarisation strategies, message pruning, and tool result management across long agent sessions.

Know where your tokens go and what they cost, and cost control stops being guesswork. It becomes arithmetic.