# Token usage and cost: cut your Claude bill

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 token 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:

| Model | Input (per 1M) | Output (per 1M) | Output/input ratio |
|---|---|---|---|
| Claude Haiku 4.5 | $1.00 | $5.00 | 5x |
| Claude Sonnet 4.6 | $3.00 | $15.00 | 5x |
| Claude Opus 4.8 | $5.00 | $25.00 | 5x |
| Claude Fable 5 | $10.00 | $50.00 | 5x |

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](https://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.

```bash
# 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:

```bash
/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
```

| Situation | Recommended model | Why |
|---|---|---|
| Quick rename or one-liner fix | Haiku 4.5 | 3x cheaper input, 3x cheaper output than Sonnet |
| Normal feature work | Sonnet 4.6 | Best cost-to-quality balance |
| Complex debugging, architecture | Opus 4.8 | Stronger reasoning; justify the extra spend |
| Large-scale eval or batch review | Haiku 4.5 | Volume 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](/guides/claude-code-effort-levels) means shorter chain-of-thought and fewer output tokens.

```bash
/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.When 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.

```bash
# 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:

| Component | Tokens | Rate | Cost |
|---|---|---|---|
| System prompt | 2,000 | $3/1M | $0.006 |
| File context | 3,000 | $3/1M | $0.009 |
| Output (review) | 1,500 | $15/1M | $0.0225 |
| **Total per run** | 6,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:

| Step | Model | Tokens | Cost |
|---|---|---|---|
| Triage (classify) | Haiku 4.5 | 1,500 in / 50 out | ~$0.0016 |
| Full review (Sonnet) | Sonnet 4.6 | 5,000 in / 1,500 out | ~$0.0375 |
| Skip review if low-severity | Sonnet 4.6 | 0 | $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

| Lever | Command or config | Effect |
|---|---|---|
| See current session spend | `/cost` | Instant visibility |
| Switch model down | `/model haiku` | 3x cheaper per token |
| Lower reasoning depth | `/effort low` | Fewer output tokens |
| Wipe context | `/clear` | Eliminate accumulated history |
| Compress context | `/compact` | Reduce without losing continuity |
| Cache stable prompts | `.claude/settings.json` cache config | ~10x cheaper on repeated reads |
| Constrain output | Ask for "brief" or "one paragraph" in prompt | Fewer 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:

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.Caching 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](/guides/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](/guides/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](/guides/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.
