Beta
Download

What common Claude Code tasks cost, measured on each model

AutoRouter11 min read

AutoRouter, the Mac app for Codex and Claude Code, 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 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 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.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.

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 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.

The method was written on October 27, 2026, before any run. It and all 45 observations, one dated line per run, are published: method and results.

TaskPrompt, in shortPasses when
Commit messageCommit a staged one-method changeExactly one commit added, nothing left staged, subject 1 to 72 characters
Rename across filesRename 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 moduleWrite pytest tests for encoding.py, whose test file was deletedThe tests pass and cover at least 90% of encoding.py
Fix a failing testFind a planted bug that fails 5 tests, without changing the testsAll tests pass and no test file changed
Multi-file refactorMove three base64 helpers into a new module and update every import, keeping the old import workingHelpers 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, 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.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.
TaskClaude Opus 5.5Claude Sonnet 5.5Claude 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), 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.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.

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.

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 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 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).

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.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.
Model, 15 runsCache writesOutputCache readsTotal
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, whose writes cost 1.25 times the input price (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 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 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? 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.

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, so a separate command avoids re-reading a long conversation after a /model switch:

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

How to send quick coding tasks to a cheaper model 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 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:

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 the session cost isn't relevant for billing there, because usage is included in the plan. Anthropic's cost guide covers the other tools for tracking usage.

Sources