Code Tycoon Get Code Tycoon

Blog / Cost

Sonnet vs Haiku for Subagents: Cost Per Task

Haiku 5.5 is 20x cheaper than Sonnet 5.5 per token, until a prompt passes 100K tokens. The per-request math and how to set a subagent's model in Claude Code.

Sonnet vs Haiku logos side by side

Haiku 5.5 costs one twentieth of Sonnet 5.5 per token for prompts up to 100,000 tokens, and one quarter above that. Whether a subagent gets the big discount depends on how much context it carries.

Short verdict. Put read-only, high-volume subagent work (searching files, summarizing logs, fetching docs) on Haiku, as Anthropic's docs suggest for simple subagent tasks. Keep Sonnet for subagents that write code or make judgment calls. Check the prompt size before you count on the 20x: past 100,000 tokens Haiku's price steps up and the gap shrinks to 4x. In our own transcripts the team barely used either cheaper model, which is the real finding. Prices checked 2026-11-23; they change, so verify before acting.

Table of contents

The three models in one table

Per million tokens, from Anthropic's pricing page, checked 2026-11-23:

Price line Sonnet 5.5 Haiku 5.5, prompt up to 100K Haiku 5.5, prompt over 100K
Base input $2 $0.10 $0.50
5-minute cache write $2.50 $0.125 $0.625
Cache read (hit) $0.10 $0.01 $0.05
Output $10 $0.50 $2.50
Sonnet-to-Haiku ratio on input and output 20x 4x

Opus 5.5, for reference, is $4 input, $0.20 cache read and $20 output, exactly 2x Sonnet; see Opus vs Sonnet in Claude Code for that gap.

The 100K-token catch

Most comparisons quote one Haiku price. Anthropic's table lists two. The pricing page says "Claude Haiku 5.5 is priced by prompt length: a request whose prompt is over 100,000 tokens pays higher prices." It also says that "a request's prompt length counts all of its input tokens, including cache reads and cache writes" and that "each request is priced on its own." The 1M-token context window at flat pricing that Sonnet and Opus get is explicitly not extended to Haiku 5.5.

So a subagent that starts fresh and reads a few files stays under 100K and gets the full 20x discount. A subagent that inherits or builds up a big context pays the over-100K rates, where Sonnet is only 4x more expensive on input and output and 2x on cache reads.

What a subagent request costs

The figures below are arithmetic from list prices for two made-up requests, not measurements. Opus is included because by default a subagent runs on whatever model your session runs.

Request C, small context (43,000-token prompt). 40,000 tokens read from cache, 3,000 fresh input, 1,500 output.

Model Cache read Fresh input Output Total
Opus 5.5 $0.0080 $0.0120 $0.0300 $0.0500
Sonnet 5.5 $0.0040 $0.0060 $0.0150 $0.0250
Haiku 5.5 $0.0004 $0.0003 $0.00075 $0.00145

Haiku is about 17x cheaper than Sonnet here, a bit under 20x because cache reads are only 10x apart.

Request D, large context (125,000-token prompt). 120,000 tokens read from cache, 5,000 fresh input, 1,500 output.

Model Cache read Fresh input Output Total
Opus 5.5 $0.0240 $0.0200 $0.0300 $0.0740
Sonnet 5.5 $0.0120 $0.0100 $0.0150 $0.0370
Haiku 5.5 (over-100K rates) $0.0060 $0.0025 $0.00375 $0.01225

The same Haiku request now costs about a third of Sonnet. Still cheaper, but not the 17x you saw above.

Per request, this is fractions of a cent to a few cents. It matters because subagents multiply requests: Claude Code's cost page notes that "every subagent... sends its own requests on top of the main conversation's" and that "the subagent's own requests still draw on your usage." One delegated search can be dozens of requests.

How many tasks Haiku completes as well as Sonnet depends on the task. Anthropic's pricing page says to "choose Haiku for simple tasks, Sonnet for most production workloads, and Opus for the most complex reasoning," and Claude Code's docs say "for simple subagent tasks, specify model: haiku." A cheaper model that needs a rerun is not cheaper. The safe test is to switch one read-only subagent and watch whether its summaries still hold up.

How to set a subagent's model

From the Claude Code subagent docs, checked 2026-11-23. The model field accepts sonnet, opus, haiku, fable, a full model ID such as claude-opus-5-5, or inherit. By default, "a subagent you define runs on the same model as the conversation that starts it." When several sources set a model, the first in this list wins:

  1. The per-invocation model parameter that Claude can pass when it starts the subagent (an alias, not a full ID).
  2. The model field in the subagent's definition, including inherit.
  3. The CLAUDE_CODE_SUBAGENT_MODEL environment variable.
  4. The main conversation's model.

A minimal read-only subagent pinned to Haiku looks like this. The frontmatter field names are from the docs; see them for where subagent files live. If you are still deciding whether a job belongs in a subagent at all, when to use a skill, a subagent or a slash command lays out the difference.

---
name: log-summarizer
description: Summarizes long test or build logs. Use for logs over a few hundred lines.
tools: Read, Grep, Glob
model: haiku
---
Read the log and report the failing tests, the first error in each, and nothing else.

To force one model on every subagent, set two variables in the env block of a settings file (requires Claude Code v2.1.257 or later, per the docs):

{
  "env": {
    "CLAUDE_CODE_SUBAGENT_MODEL": "haiku",
    "CLAUDE_CODE_SUBAGENT_MODEL_FORCE": "1"
  }
}

While the force flag is on, Claude Code ignores the model field in subagent definitions and Claude cannot pass a model when it starts one. That is a blunt tool: it also puts subagents that write code on Haiku. To check what a running subagent uses, the docs say to run /tasks while it runs; the row shows its model.

One trap from the docs: setting CLAUDE_CODE_SUBAGENT_MODEL alone does not change the built-in Explore and Plan subagents. You need the force flag for that.

If your session itself switches models with /model, subagents that inherit follow it. The model configuration docs say a switch to Opus "also reaches subagents that inherit the main conversation's model", so delegated research then runs on Opus too.

What the built-in subagents run on

A common claim in blog posts is that Claude Code's built-in Explore subagent runs on Haiku. The current docs say otherwise. The built-in subagent table lists:

Built-in subagent Model, per the docs
Explore The parent conversation's model. On a Claude subscription, Console account or LLM gateway it runs on the Opus the opus alias resolves to.
Plan Inherits the parent's model
General-purpose The parent's model by default
statusline-setup Sonnet
claude-code-guide Haiku
web-fetch Haiku, or the conversation's model when Haiku is not usable

The docs add that a user or project subagent named Explore "overrides the built-in and keeps its own model field, so define one with model: haiku to run exploration on a lower-cost model." Exploration is the most obvious candidate: read-only, many requests, summarized output. It is also the one that may carry a large context, so apply the 100K catch above.

The docs are the reference here, and they change between versions. Third-party posts written against older versions can be wrong in both directions.

What our own data shows

We reduced one team's Claude Code transcripts to aggregates: 792 sessions and 54,344 model requests from 2026-10-02 to 2026-11-23 (about 7.5 weeks), including subagent sidechains. Costs are API list-price equivalents, not invoices, since Pro and Max are flat fees. It is one team's usage, mostly one model. Treat it as one team's usage rather than a benchmark.

Model Requests Cost (list-price equivalent)
Opus 5.5 53,848 $5,952
Sonnet 5.5 315 $44
Haiku 5.5 170 $0.38

Haiku handled 170 requests, about 0.3% of the total, for 38 cents. The team did not tune subagent models: almost everything ran on the session model, which for these accounts defaults to Opus 5.5 per the docs. The transcripts record the Opus figure as one total, without a split between subagent and main-conversation work.

Two things from the data bear on the Haiku decision. First, only 7,179 of 54,344 requests (13.2%) had under 100,000 tokens of context; the rest would be in Haiku's higher price band if moved. Main sessions are long, so this is not a clean forecast for subagents, which start smaller. Second, Haiku's 170 requests averaged about $0.002 each against $0.11 for Opus. Those are different workloads, so do not read it as a like-for-like price, but it shows what small-context Haiku work costs in practice.

If you want your own split, Claude Code's /usage shows a session's "Usage by model" breakdown, and the Plan usage breakdown on subscription plans attributes recent usage to subagents. Claude Code's prompt-cache line, per the docs, "covers the main conversation only, not subagents." For a view across sessions and tasks, Code Tycoon prices every task and session from your transcripts and ranks wasteful habits in dollars; see the working with Claude view.

Pick Haiku if, pick Sonnet if

Pick Haiku 5.5 for a subagent if:

  • It is read-only: file search, log summaries, docs lookups.
  • Its prompt stays under 100,000 tokens, so the 20x applies.
  • A weak summary is cheap to catch, because you or the parent verify the result.
  • It runs many times per session, so the volume makes the saving visible.

Pick Sonnet 5.5 if:

  • The subagent edits code, runs migrations or touches anything hard to undo.
  • It needs to follow a long spec or make judgment calls.
  • Its context is large enough that Haiku's higher band narrows the saving to 4x.
  • You would rather pay a bit more than review a second attempt.

Pick Opus if the delegated task is the hard part of the job; see Opus vs Sonnet.

When this does not matter. If you run one session with occasional delegation, the saving is cents. It adds up when you run several sessions at once; see How to run 5 Claude Code sessions in parallel and how often parallel sessions collide. On a flat plan, subagent requests count against your limits, not a dollar bill; see Claude Code usage limits explained and what Claude Code costs per month.

Setting a model per subagent, step by step

  1. List the subagents you actually use, and what each one does: searching files, summarizing logs, writing code, reviewing changes.
  2. Sort them into two groups. Reading and summarizing work goes in the first group; work that writes or judges code goes in the second.
  3. Set the first group to Haiku in each subagent's definition, following the model setting described in the Claude Code docs, and leave the second group on Sonnet or the session default.
  4. Run a normal week of work. Compare the per-model cost split and whether any Haiku subagent needed retries or produced results you had to redo.
  5. Move a subagent back to Sonnet if its output got worse. A cheaper request that has to be repeated is not cheaper.

Keep an eye on prompt length. Haiku 5.5 is priced higher once a prompt passes 100K tokens, so a subagent that reads very large files loses part of its advantage.

The bottom line

Haiku 5.5 is far cheaper per token than Sonnet 5.5 for prompts up to 100K tokens, which makes it the obvious first choice for subagents that search, read and summarize. Sonnet stays the safer default for subagents that write or review code. Measure for a week before you move everything, and judge by cost per finished task rather than cost per request.

Frequently asked questions

How much cheaper is Haiku than Sonnet for subagents?

On Anthropic's list prices checked 2026-11-23, Haiku 5.5 is 20x cheaper than Sonnet 5.5 on input and output for prompts up to 100,000 tokens ($0.10 and $0.50 against $2 and $10). Above 100,000 tokens Haiku costs $0.50 and $2.50, so the gap is 4x.

What model do Claude Code subagents use by default?

The same model as the conversation that starts them, unless the subagent's definition, the Agent tool call or CLAUDE_CODE_SUBAGENT_MODEL sets another. Built-in subagents differ: statusline-setup runs on Sonnet, and claude-code-guide and web-fetch run on Haiku.

Does the Explore subagent run on Haiku?

Per the current Claude Code docs, no. Explore uses the parent conversation's model, which on a subscription, Console account or LLM gateway is the Opus that the opus alias resolves to. You can override it by defining your own subagent named Explore with model: haiku.

How do I run every subagent on Haiku?

Set CLAUDE_CODE_SUBAGENT_MODEL to haiku and CLAUDE_CODE_SUBAGENT_MODEL_FORCE to 1 in the env block of a settings file, on Claude Code v2.1.257 or later. This overrides the model field in subagent definitions, so use it only if you are fine with code-writing subagents on Haiku too.

How can I check which model a subagent is using?

Run /tasks while the subagent is running. The docs say its row shows the model it runs on.

Is Haiku good enough for coding subagents?

Not measured here. Anthropic's docs recommend Haiku for simple subagent tasks and Sonnet for most coding work. Test it on one read-only subagent and check the results before you move anything that edits code.

Do subagent costs count against my plan limits?

Yes. Claude Code's cost page says "the subagent's own requests still draw on your usage," and its plan usage breakdown attributes recent usage to subagents.

Related articles

See what your sessions cost: self-host Code Tycoon for free with npx code-tycoon.


About this research

Anton Goldshtein is a two-time founder who previously bootstrapped a company to $100M in revenue. His team runs its own products on Code Tycoon every day.

Price figures come from Anthropic's pricing page and model and subagent behavior from the Claude Code docs, all checked 2026-11-23. Usage figures come from one team's Claude Code transcripts (792 sessions, 54,344 requests, 2026-10-02 to 2026-11-23) reduced to aggregates; costs are list-price equivalents.

Content reviewed and updated: 2026-11-26


Keep reading