# What common Claude Code tasks cost, measured on each model

Authors: AutoRouter
Published: 2026-10-28T17:40:00.000Z
Reading time: 11 min
Canonical: https://autorouter.com/blog/claude-code-task-costs-measured
Part of: How to cut Claude Code and Codex costs (https://autorouter.com/blog/cut-claude-code-and-codex-costs.md)
Publisher: AutoRouter, the Mac app for Codex and Claude Code (https://autorouter.com)

> AutoRouter ran five everyday Claude Code tasks three times each on Claude Opus 5.5, Sonnet 5.5 and Haiku 5.5 in October 2026. At Anthropic's list prices, an average run cost $0.110 on Opus 5.5, $0.049 on Sonnet 5.5 and $0.0044 on Haiku 5.5, and all 45 runs passed their checks. Writing the prompt cache was the largest part of every model's cost.

[AutoRouter, the Mac app for Codex and Claude Code](https://autorouter.com), ran five everyday Claude Code tasks three times each on Claude Opus 5.5, Claude Sonnet 5.5 and Claude Haiku 5.5 on October 28, 2026: a commit message, a rename across files, tests for one module, a failing-test fix and a multi-file refactor. At [Anthropic's list prices](https://platform.claude.com/docs/en/about-claude/pricing) that day, an average run cost $0.110 on Opus 5.5, $0.049 on Sonnet 5.5 and $0.0044 on Haiku 5.5, and all 45 runs passed their automatic checks. The runs used a Claude Max subscription, so they cost nothing beyond the plan. With an API key, Claude Code [uses a shorter prompt cache](https://code.claude.com/docs/en/prompt-caching#which-ttl-each-request-gets) that is cheaper to write, and the same runs would have cost about a fifth to a quarter less: $0.084, $0.037 and $0.0035. AutoRouter wrote this post, and the study measured Claude Code alone, with no router in between.

![What $1 buys in Claude Code. Claude Opus 5.5: 9 tasks per $1; Claude Sonnet 5.5: 20 tasks per $1; Claude Haiku 5.5: 228 tasks per $1. Source: Average of 45 runs of 5 everyday tasks at Anthropic's list prices, October 28, 2026 · autorouter.com/blog.](https://autorouter.com/blog/images/claude-code-task-costs-measured/1-what-a-dollar-buys.png)

## How was the cost measured?

Each run started Claude Code 2.1.305 in print mode (`claude -p`) on a fresh copy of the same Python repository and recorded the tokens and the list-price cost that Claude Code reports when it finishes. The repository is [pallets/itsdangerous](https://github.com/pallets/itsdangerous) at commit `672971d` (June 14, 2025): 1,176 lines of source and 297 tests. Every run had its own copy and virtual environment, and one task, model and attempt per session.

- **Model:** chosen with `--model`, signed in with Claude Max and no API key set.
- **Settings:** project settings only (`--setting-sources project`) and `--strict-mcp-config`, so no personal CLAUDE.md, hooks, plugins or MCP servers loaded ([CLI reference](https://code.claude.com/docs/en/cli-reference)). Permissions were skipped inside the copy.
- **Cost:** the `total_cost_usd` field of Claude Code's JSON result, with the per-model token counts beside it. On a subscription no money changes hands, so this is Claude Code's list-price estimate for the tokens.
- **Checks:** each task's check was confirmed to fail on an untouched copy and pass on a correct solution before the first counted run.

The method was written on October 27, 2026, before any run. It and all 45 observations, one dated line per run, are published: [method](/studies/claude-code-task-costs/method.md) and [results](/studies/claude-code-task-costs/results.jsonl).

| Task                 | Prompt, in short                                                                                    | Passes when                                                                                                  |
| -------------------- | --------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
| Commit message       | Commit a staged one-method change                                                                   | Exactly one commit added, nothing left staged, subject 1 to 72 characters                                    |
| Rename across files  | Rename `want_bytes` to `to_bytes` everywhere (27 uses in 6 files)                                   | No `want_bytes` left, `def to_bytes` exists, all tests pass                                                  |
| Tests for one module | Write pytest tests for `encoding.py`, whose test file was deleted                                   | The tests pass and cover at least 90% of `encoding.py`                                                       |
| Fix a failing test   | Find a planted bug that fails 5 tests, without changing the tests                                   | All tests pass and no test file changed                                                                      |
| Multi-file refactor  | Move three base64 helpers into a new module and update every import, keeping the old import working | Helpers live only in the new module, no import uses the old path, the old import still works, all tests pass |

## What does each Claude Code task cost on each model?

An average run cost $0.110 on Claude Opus 5.5, $0.049 on Claude Sonnet 5.5 and $0.0044 on Claude Haiku 5.5 at list prices on October 28, 2026, so Opus 5.5 cost 2.2 times Sonnet 5.5 and 25 times Haiku 5.5 per task. Each cell is the mean of three runs, and the costs reconcile exactly with the token counts times the published rates for [Opus 5.5](https://platform.claude.com/docs/en/models/opus-5-5/whats-new-opus-5-5), Sonnet 5.5 and Haiku 5.5.

![Cost per task on each model. Commit message: $0.082 on Opus 5.5, $0.034 on Sonnet 5.5, $0.0024 on Haiku 5.5 (Opus ÷ Haiku: 35×); Rename across files: $0.097 on Opus 5.5, $0.038 on Sonnet 5.5, $0.0037 on Haiku 5.5 (Opus ÷ Haiku: 26×); Tests for one module: $0.125 on Opus 5.5, $0.062 on Sonnet 5.5, $0.0055 on Haiku 5.5 (Opus ÷ Haiku: 23×); Fix a failing test: $0.078 on Opus 5.5, $0.040 on Sonnet 5.5, $0.0032 on Haiku 5.5 (Opus ÷ Haiku: 25×); Multi-file refactor: $0.168 on Opus 5.5, $0.070 on Sonnet 5.5, $0.0072 on Haiku 5.5 (Opus ÷ Haiku: 23×). Source: Mean of 3 runs per task and model, list prices, October 28, 2026 · autorouter.com/blog.](https://autorouter.com/blog/images/claude-code-task-costs-measured/2-cost-per-task.png)

| Task                        | Claude Opus 5.5 | Claude Sonnet 5.5 | Claude Haiku 5.5 |
| --------------------------- | --------------- | ----------------- | ---------------- |
| Commit message              | $0.082          | $0.034            | $0.0024          |
| Rename across files         | $0.097          | $0.038            | $0.0037          |
| Tests for one module        | $0.125          | $0.062            | $0.0055          |
| Fix a failing test          | $0.078          | $0.040            | $0.0032          |
| Multi-file refactor         | $0.168          | $0.070            | $0.0072          |
| Average run                 | $0.110          | $0.049            | $0.0044          |
| Average run with an API key | $0.084          | $0.037            | $0.0035          |
| All 15 runs                 | $1.647          | $0.733            | $0.066           |

The multi-file refactor was the most expensive task on every model, and the failing-test fix and the commit message the cheapest. Three runs of the same task on the same model never differed by more than about 1.5 times in cost. With an API key, 1,000 runs of tasks like these would cost about $84 on Opus 5.5, $37 on Sonnet 5.5 and $3.50 on Haiku 5.5 at these averages.

## Why is Haiku 5.5 only 25 times cheaper when its prices are 40 times lower?

Claude Haiku 5.5 did each task in more steps, so it used more tokens at its lower price. As of October 28, 2026, Haiku 5.5's output and cache-write rates are a fortieth of Opus 5.5's and its cache reads a twentieth ([pricing](https://platform.claude.com/docs/en/about-claude/pricing)), for prompts up to 100,000 tokens. Across its 15 runs, Haiku 5.5 took 1.5 times as many turns as Opus 5.5, wrote 1.7 times as much output and read 1.6 times as much from the cache. On the refactor it averaged 8.7 turns against 4.3 on Opus 5.5 and Sonnet 5.5.

![Haiku 5.5 is 40× cheaper per token, 25× per task. Price per token: 40×; Cost per task: 25× (it would be 40× without Haiku 5.5's 1.5× turns, 1.7× output). Source: Claude Opus 5.5 as a multiple of Claude Haiku 5.5 over 15 runs each, October 28, 2026 · autorouter.com/blog.](https://autorouter.com/blog/images/claude-code-task-costs-measured/3-price-gap.png)

The extra turns didn't make it slower on these tasks. Average wall time stayed within 9 seconds across the three models on every task: the refactor took 33 seconds on Opus 5.5, 24 on Sonnet 5.5 and 30 on Haiku 5.5.

## Did the cheaper models pass as often?

Yes: all 45 runs passed, five tasks times three models times three runs. That shows these five tasks were within reach of all three models in a small, well-tested repository. It doesn't show the models are equal on harder work. On Terminal-Bench 4.0, Anthropic reported 39.2% for Claude Haiku 5.5 against 70.6% for Claude Sonnet 5.5 in its [October 7, 2026 launch post](https://www.anthropic.com/news/claude-haiku-5-5).

Every model wrote tests that covered all of `encoding.py`; Opus 5.5 wrote 26 to 40 tests per run and Haiku 5.5 wrote 45 to 52. One check changed after the runs: the refactor check first counted a code comment that mentioned the old import path as a failure. Ignoring comment lines and rescoring all nine saved refactor runs turned one Haiku 5.5 run from a fail into a pass and changed nothing else.

## Where does the money go in a Claude Code task?

Writing to the prompt cache was the largest cost on every model: 63% on Opus 5.5, 66% on Sonnet 5.5 and 51% on Haiku 5.5. [Claude Code caches the prompt](https://code.claude.com/docs/en/prompt-caching) so each later request reads the unchanged start of the conversation at a discount, and in these runs nearly every input token went through the cache: no run sent more than 18 uncached input tokens. On a Claude subscription, Claude Code [requests the one-hour cache](https://code.claude.com/docs/en/prompt-caching#which-ttl-each-request-gets) for the main conversation, and every run's cost matches that rate: twice the input price, or $8 per million tokens on Opus 5.5, $4 on Sonnet 5.5 and $0.20 on Haiku 5.5 as of October 28, 2026 ([pricing](https://platform.claude.com/docs/en/about-claude/pricing)).

![Where the money goes in a Claude Code task. Opus 5.5: cache writes 63%, output 26%, cache reads 11% of $1.65; Sonnet 5.5: cache writes 66%, output 23%, cache reads 11% of $0.73; Haiku 5.5: cache writes 51%, output 28%, cache reads 21% of $0.066. Source: Share of list-price cost over 15 runs per model, subscription sessions, October 28, 2026 · autorouter.com/blog.](https://autorouter.com/blog/images/claude-code-task-costs-measured/4-where-the-money-goes.png)

| Model, 15 runs    | Cache writes | Output       | Cache reads  | Total  |
| ----------------- | ------------ | ------------ | ------------ | ------ |
| Claude Opus 5.5   | $1.034 (63%) | $0.435 (26%) | $0.178 (11%) | $1.647 |
| Claude Sonnet 5.5 | $0.481 (66%) | $0.170 (23%) | $0.082 (11%) | $0.733 |
| Claude Haiku 5.5  | $0.033 (51%) | $0.018 (28%) | $0.014 (21%) | $0.066 |

A fresh session writes Claude Code's system prompt, its tool definitions and the files it reads into the cache, between 6,500 and 16,300 tokens per run here. That is a fixed setup cost per session. On Opus 5.5 it was about 69% of a commit message's $0.082. Starting a fresh Opus 5.5 session for every small job pays that setup each time; the same setup on Haiku 5.5 costs a fortieth as much.

## Does an API key change what the same task costs?

Yes: with an API key, these runs would have cost 24% less on Opus 5.5, 25% less on Sonnet 5.5 and 19% less on Haiku 5.5. With an API key, usage credits or a cloud provider, Claude Code [uses the five-minute cache](https://code.claude.com/docs/en/prompt-caching#which-ttl-each-request-gets), whose writes cost 1.25 times the input price ([pricing](https://platform.claude.com/docs/en/about-claude/pricing)). No run here lasted more than 40 seconds, so a five-minute cache would have stayed warm throughout. Cache writes would still be the largest cost: 51% on Opus 5.5, 54% on Sonnet 5.5 and 39% on Haiku 5.5. The one-hour cache pays off in sessions you leave idle and come back to, and the `promptCacheTtl` setting chooses either one.

## What does this mean on a Claude Pro or Max plan?

On a plan, these runs cost nothing beyond the subscription and count against its usage limits instead. Anthropic doesn't publish those limits in tokens; its [pricing page](https://claude.com/pricing) says how much you can do depends on the length and complexity of your conversations and the model you choose. This study didn't measure how much of the Max limit the 45 runs used. Claude Code's `default` model on Pro, Max and the Anthropic API is [Opus 5.5](https://code.claude.com/docs/en/model-config#default-model-setting) as of October 2026, so small jobs run on the most expensive of the three unless you change it.

[Subscription or API: which is cheaper for coding agents?](/blog/subscription-vs-api-pricing) works through where a plan beats paying per token. For every lever that lowers the bill, from the model to the context each request carries, see [How to cut Claude Code and Codex costs](/blog/cut-claude-code-and-codex-costs).

## How do you run small tasks on a cheaper model?

Pass a model for the one job, and leave your main session on the model you debug with. Each model keeps [its own prompt cache](https://code.claude.com/docs/en/prompt-caching#switching-models), so a separate command avoids re-reading a long conversation after a `/model` switch:

```bash
claude -p --model haiku "Commit the staged changes"
```

[How to send quick coding tasks to a cheaper model](/blog/quick-tasks-on-cheaper-models) covers subagents and the same setup in Codex. Doing it by hand means sorting every task yourself.

AutoRouter, the Mac app for Codex and Claude Code, works out how hard each turn is and sends quick tasks to the cheapest capable model, which is often your ChatGPT or Claude plan or a low-cost open model. A model has to clear the quality bar for the task before price counts, hard work goes to the strongest model your plans cover, and every turn shows its model, what it cost and why. Routing across your plans is free; [Pro](https://autorouter.com/#plans) is $20 a month and adds every other model at the provider's price plus 10%. AutoRouter earns that 10% on paid models and nothing on your plans. It is in beta, works with Codex and the Claude Code CLI on macOS 14 or later, and sometimes misjudges how hard a task is; you can rate the pick or choose a model yourself.

## What can't this study tell you?

It measures five small, well-specified tasks in one small Python library, and its numbers will move with your codebase and habits:

- **Bigger repositories cost more.** A task that reads more files writes and reads more cache.
- **Long sessions shift the mix.** Each run here was a fresh session, so setup dominated. In a long interactive session, re-reading the growing conversation from the cache takes a larger share; Anthropic's [cost guide](https://code.claude.com/docs/en/costs) lists ways to keep it short.
- **Three runs per cell show spread.** They don't give a statistically tight average.
- **List prices only.** Batch, fast mode and US-only inference price differently.
- **One Claude Code version.** Version 2.1.305's system prompt and tools set the setup cost; other versions will differ.
- **Cost, measured on Claude Code alone.** It isn't a quality benchmark and doesn't measure AutoRouter.

## Questions

### How much does a commit message cost in Claude Code?

In this study, a commit message cost $0.082 on Claude Opus 5.5, $0.034 on Claude Sonnet 5.5 and $0.0024 on Claude Haiku 5.5 at list prices on October 28, 2026, as Claude Code priced a subscription session; with an API key it would be about $0.061, $0.025 and $0.0018. Each was a fresh `claude -p` session on a one-method change, and all nine runs produced a valid commit. On a Pro or Max plan, the same run uses plan limits instead of money.

### Does the same task cost the same every time?

No. Three runs of the same task on the same model differed by up to about 1.5 times in cost, because the model took a different number of turns or wrote more. The Opus 5.5 commit message ranged from $0.072 to $0.100.

### Why is the prompt cache the biggest cost?

Because Claude Code sends almost all of its input through the cache, and writing to it costs more than plain input: twice the input price for the one-hour cache a subscription session uses, and 1.25 times for the five-minute cache an API key uses. Each fresh session writes the system prompt, tool definitions and the files it reads, then later requests read them back at a small fraction of the input price.

### How can I see what my own tasks cost?

Run the task with `claude -p --output-format json`, whose result includes `total_cost_usd` and the token counts per model, or check the Session block of `/usage` in an interactive session. On a Pro or Max plan, both figures are list-price estimates; [Anthropic notes](https://code.claude.com/docs/en/costs) the session cost isn't relevant for billing there, because usage is included in the plan. Anthropic's [cost guide](https://code.claude.com/docs/en/costs) covers the other tools for tracking usage.

## Sources

- [Pricing](https://platform.claude.com/docs/en/about-claude/pricing), Claude Platform docs, Anthropic
- [What's new in Claude Opus 5.5](https://platform.claude.com/docs/en/models/opus-5-5/whats-new-opus-5-5), Claude Platform docs, Anthropic
- [Plans and pricing](https://claude.com/pricing), Anthropic
- [Introducing Claude Haiku 5.5](https://www.anthropic.com/news/claude-haiku-5-5), Anthropic
- [How Claude Code uses prompt caching](https://code.claude.com/docs/en/prompt-caching), Claude Code docs
- [Manage costs effectively](https://code.claude.com/docs/en/costs), Claude Code docs
- [Model configuration](https://code.claude.com/docs/en/model-config), Claude Code docs
- [CLI reference](https://code.claude.com/docs/en/cli-reference), Claude Code docs
- [pallets/itsdangerous](https://github.com/pallets/itsdangerous), GitHub

## Read next

- [How to cut Claude Code and Codex costs](https://autorouter.com/blog/cut-claude-code-and-codex-costs.md): Claude Code and Codex costs come down to three things: which model runs each turn, how much context each request carries, and whether you pay through a plan, credits or an API key. Run routine turns on a smaller model, keep sessions short, and spend the plan you already pay for before paying per token. AutoRouter, the Mac app for Codex and Claude Code, makes the model choice on every turn and shows each turn's model, cost and reason.
- [How to use Claude Code and Codex without a subscription](https://autorouter.com/blog/no-subscription-coding-agents.md): Claude Code runs on a Claude Console account and Codex runs on an OpenAI API key, and both bill per token with no ChatGPT or Claude plan. AutoRouter, the Mac app for Codex and Claude Code, is a third option: AutoRouter Pro costs $20 a month with $20 of included usage and bills paid models at the provider's price plus 10%. On the same models, a direct API key costs less, so Pro comes out ahead only when cheaper models take enough of your turns.
- [How Claude Code usage limits work, and how to make them last](https://autorouter.com/blog/claude-code-usage-limits.md): As of October 2026, Claude Code on Anthropic's Pro and Max plans counts every request against a rolling five-hour session limit and a weekly limit, both shared with claude.ai and Claude Desktop, and Anthropic publishes no fixed message or token counts for either. The limits last longer when routine turns run on Sonnet 5.5 or Haiku 5.5 instead of the default, Opus 5.5, when the context stays small, and when overflow goes to usage credits. AutoRouter, the Mac app for Codex and Claude Code, makes that model choice for each turn and shows each turn's model, cost and reason.

Tags: [Costs](https://autorouter.com/blog/tags/costs.md), [Claude Code](https://autorouter.com/blog/tags/claude-code.md), [Models](https://autorouter.com/blog/tags/models.md)

Drafted with AI from the sources linked above, then checked and edited by the AutoRouter team.
