In this video I test whether giving each Claude Code sub-agent its own model is worth it. I ran the same ticket on the same real repo with two lineups: Claude Opus 5.5 on every job, and a roster where Opus plans, Sonnet 5.5 builds and Haiku 5.5 scans. If you run coding agents and want to know which jobs need the big model, this write-up covers how routing works, how to set it, the results and where it breaks.
What I cover in this video
- 0:46 What a coordinator and a sub-agent are, and why every helper starts with a fresh context window.
- 2:18 The four ways to set a sub-agent's model in Claude Code.
- 3:04 Which setting wins when they disagree, and why the built-in Explore helper is not cheap by default.
- 3:50 Checking the model that really ran with
/tasks, and which jobs need a big model.
- 5:23 The test: adding GitHub-style alerts to mistune, with 56 hidden tests.
- 6:10 The box score: tests, cost, tokens and time.
- 8:26 Round two, where the Opus planner did the scanner's job itself.
- 9:12 The audit of every scanner claim, and the one wrong report that put a bug in a build.
How sub-agent model routing works in Claude Code
The coordinator is your main session, the one you talk to. It reads the ticket, makes the plan and hands pieces of the work to helpers through the Agent tool. Each helper is a sub-agent with a brand new context window. It does not see your chat or what the coordinator already read. It gets the brief the coordinator writes plus its own instructions, does the work and sends back one report. I compare it to handing a contractor a sticky note: whatever is on the note is all they know.
Because every helper starts fresh, every helper can run a different model. Anthropic's docs pitch it this way: "Control costs by routing tasks to faster, lower-cost models like Haiku." If you want the broader question of whether sub-agents help at all, I tested that in Claude Code sub-agents vs one agent.
There are four ways to set a helper's model. Here they are in the order the docs say they win:
- The per-call model. The coordinator passes a model when it starts a helper, so the AI picks on the fly.
- The model field in the agent file. Every custom sub-agent is a small file with a name, a description, its tools and a model line. You can put
sonnet, opus, haiku, a full model ID, or inherit, which means use whatever your main session is running. This is what I used in the test.
- The
CLAUDE_CODE_SUBAGENT_MODEL environment variable. The default for every custom helper that does not set its own.
- Your main session's model. What a helper gets if nothing else is set.
There is also a force switch you turn on next to that environment variable. It pins one model on almost every helper and beats both the model field and the per-call model.
Two things most people miss
First, the built-in Explore helper, the one Claude Code sends to search your codebase, does not drop to a small model on its own. The docs say it runs on your main session's model, so if you are on Opus, your searches run on Opus. For a cheap scanner, define your own agent named Explore with model: haiku.
Second, routing does not always do what you told it. There is an open GitHub issue where the environment variable silently beats the per-call model, and the helper's own record shows the model you asked for, not the one that ran. So while a helper is working, run:
/tasks
It shows the model on each helper's row. Trust it, but check it.
The test: one ticket, two lineups
I used mistune, a real open-source Python Markdown library with about 6,400 lines of code and almost 1,200 tests of its own. The ticket: add GitHub-style alerts (the [!NOTE] and [!TIP] boxes you see in a README), with output in HTML, Markdown and reStructuredText, working alongside the existing plugins. I wrote 56 hidden tests the agents never saw, and all of mistune's own tests had to keep passing.
Lineup A was Opus 5.5 on every job. Lineup B was Opus planning, Sonnet building and Haiku scanning. Same coordinator prompt, same helper prompts, same tools, effort on high for every role, web search off, each run sandboxed, three rounds.
Five of the six runs played out the same way. The coordinator sent the scanner to map how block quotes and plugins work, wrote a brief for the builder from the report, the builder wrote the plugin and tests, and the coordinator checked it and called it done.
The results: same score, lower cost, more tokens
- Hidden tests: 56 out of 56 for both lineups in all three rounds, with zero of mistune's own tests broken.
- Cost: the roster was 34% cheaper at API prices across the three runs (41%, 33% and 27% by round).
- Tokens: the roster burned more, about 8.7 million versus about 5 million, or 1.75 times as many. It was still cheaper because most of those tokens landed on the cheaper models.
- Scanner: Haiku read 2.2 times the tokens of the Opus scanner and cost 83% less.
- Builder: Sonnet used about 1.5 times the tokens and cost 34% less.
- Planner: Opus in both lineups, and it ended up at 43% of the roster's bill.
- Time: median 6:05 for Opus everywhere, 6:19 for the roster. The roster won one round on time and lost two.
- Redos: the planner sent work back to a helper zero times in all six runs.
The small, fast model was never the faster scanner. Opus mapped the code in under two minutes every round. Haiku went wider, read more and took about three minutes in round three. Small does not mean fast. It means cheap per token. For more on how these models compare head to head, see Haiku 5.5 vs Sonnet 5.5 vs Fable 5.1 in Claude Code.
Where routing breaks
In round two, Claude Code started the Haiku scanner in the background and the Opus planner said it was waiting. It did not really wait. It ran nine reads and searches of its own, and around the 100 second mark decided it had enough to brief the builder. The scanner's 2,500-word report showed up almost two minutes later, and by the time the planner got it, the build was done. I paid for a scanner and my most expensive model did the scanner's job anyway. That round the roster still came out faster and cheaper.
The scary version of routing is a small model handing back a wrong summary that the planner trusts. So I had a separate agent check 338 claims across the six scanner reports against the real code. The Haiku reports had 2 wrong claims. The Opus reports had 5.
One of those Opus mistakes went somewhere. In round three, the Opus scanner said a certain design avoids a problem. It does not. The planner put that design into the builder's brief and the builder built it. The 56 hidden tests did not catch it, so after the runs I wrote 10 more README-style checks. All three roster builds passed 10 of 10. Two of the three Opus-everywhere builds passed 7: an alert right after a list came out as a plain quote. In round one, the Opus planner picked that same design on its own.
This is three runs, so do not read it as Haiku beats Opus. Read it as the real risk with routing: the planner only sees the summary, never what the helper read. A wrong, confident summary can go straight into the plan no matter which model wrote it.
Key takeaways
- Keep your best model on judgment: planning, reviewing and debugging. In my runs the planner was almost half the roster's bill, and that is the role worth paying for.
- Give lookups to the small model, but keep the brief tight. Haiku was cheap but wordy, so something like "find these three things and stop" is how I would keep it fast.
- Put a mid model on the build when there is a clear plan and real tests to check against. Sonnet matched Opus on every hidden test here.
- Have the planner double-check the one claim the whole design rests on before the builder starts.
- Run
/tasks and confirm each helper is really on the model you picked.
Full video transcript
0:00Coding agents can now give every job its own model. So I put it on the scoreboard. Same ticket, two lineups. On the left, Opus 5.5 on every job. On the right, a full roster. Opus plans, Sonnet Builds, Haiku Scans. Both passed all 56 hidden tests. The roster cost about a third less. The small fast model never once won the scanning race, and the one report that put a bug in a build came from the Superstar. I'll show you how routing works, how to set it, the box score, and where it breaks. I run agents all day, so I tested it myself. Let's jump right into it. So, what's a coordinator, and what's a sub agent? The coordinator is your main session. It's the one you talk to. It reads the
0:46ticket. It makes the plan, and then it hands pieces of the work to helpers through the agent tool. Those helpers are sub agents. Here's how it actually works. Every time the coordinator starts a sub agent, that sub agent opens a brand new context window. It doesn't see your chat, it doesn't see what the coordinator already read, it only gets the brief the coordinator writes for it, plus its own instructions. It goes off, does the work, and hands back one report. That report is the only thing that comes back. It's kind of like handing a contractor a sticky note. Whatever's on the note is all they know, and they can't lean over and ask you what you meant. And because every helper starts fresh, every helper can run a different model. Anthropic's own docs pitch it like this. Control costs by routing tasks to faster, lowerc cost
1:32models like Haiku. So that's the lineup card. One coordinator and in our test, two helpers. A scanner that only searches and reads and a builder that writes the code. Same prompts and same tools on both teams. The only thing we changed is which model sits in each seat. So the question is pretty simple. Does the cheap roster do the same job for less? Or do you end up paying for it somewhere else? Because one of those seats ended up costing almost nothing, and the seat nobody thinks about turned into almost half the bill. Real quick, 263 builders are already inside shipping school. In premium, I show you how I make every video on this channel with Claude Code. New course material drops every single day, plus live calls every week, over 500 hours of replays, and a
2:18full course library. Join free link below. So how do you actually tell claude code which model goes where? There are four ways and this is straight from the official docs. One, the model field. Every custom sub aent is a little file with a name, a description, the tools it can use and a model line. You can put sonnet opus haik coup a full model ID or inherit which just means use whatever your main session is running. That's what we used in our test. Two, an environment variable called claude code sub aent model. That's the default for every custom helper that doesn't set its own. Three, the coordinator can pass a model itself when it starts a helper. That's a per call setting. So the AI picks on the fly. And four, if nothing
3:04is set, the helper runs on the same model as your main session. So which one wins when they disagree? The docs give the exact order. The per call model wins first, then the model field in the file, then the environment variable, then your main sessions model. And if you want one model on basically every helper, there's a force switch. Turn it on next to that environment variable, and it beats the model field and the per call model. Most people skip right past this, but the built-in explore helper, the one cloud code sends to search your codebase, doesn't drop to a small model on its own. The docs say it runs on your main sessions model. So, if you're on Opus, your searches run on Opus, too. If you want a cheap scanner, you have to set one up yourself. The docs even tell you how. Make your own agent named explore
3:50with model haiku. And it doesn't always do what you told it either. There's an open GitHub issue right now where that environment variable silently beats the per call model and the helper's own record says the model you asked for, not the one that actually ran. So, once it's set up, run /tasks while a helper is working. It shows the model on each helper's row. Trust it, but check it. So, which jobs actually need the big model? Think about what each seat does all day. The planner reads the ticket, decides how to build it, reviews what comes back, and decides if it's done. That's judgment. If the plan is wrong, everything after it is wrong. Same with debugging. Figuring out why a test fails when the code looks right. That's where you want the biggest brain you've got.
4:36The scanner is different. find the file, GP for the function, read these three plugins, and tell me how they register. Those are lookups, and a smaller model can handle lookups. And the builder sits in the middle. It writes real code, so it needs to be good, but it's following a plan somebody else already made. And the price gap is huge. On Anthropic's own price list, Haiku 5.5 runs about 140th of Opus 5.5 on input and output on normalsiz prompts and Sonnet 5.5 is half. So on paper, moving your scanner to Haiku should make that seat basically free on paper. Let's see what actually happened. So here's the test. I took Mistune. It's a real open- source markdown library for Python. about 6,400
5:23lines of code with almost 1,200 tests of its own. And I wrote a ticket, add GitHub style alerts. You know those boxes in a readme that say note or warning? Mistune doesn't have them. The ticket spells out exactly how they should come out in HTML, in markdown, and in restructured text, and they have to work alongside the plugins that are already there. Then I wrote 56 hidden tests the agents never see. And on top of that, every one of Mistune's own tests has to keep passing. Lineup A is Opus 5.5 in every seat. Lineup B is Opus planning, sonnet building, and haiku scanning. Same coordinator prompt, same helper prompts, same tools, effort on high everywhere. Web search off. And each run sandboxed so it can't peek at
6:10the other team. Both lineups start at the same moment. And we ran it three times. And five of the six runs played out exactly the same way. The coordinator reads the ticket and sends the scanner to map how block quotes and plugins work. It reads the report and writes a brief for the builder. The builder writes the plugin and the tests, runs everything, and reports back. Then the coordinator checks it and calls it done. So let's look at the box score. Hidden tests. Lineup A 56 out of 56 all three rounds. Lineup B 56 out of 56 all three rounds. Zero broken tests anywhere. On our hidden tests, it's a tie. Hold on to that one because it comes back. Cost. Add up all three runs at API prices and the full roster cost
6:5534% less. Round by round. It was 41, 33, and 27% cheaper. Now, here's the weird part. The roster actually burned more tokens. About 8.7 million versus about 5 million. So, 1.75 times as many. And it was still cheaper because most of those tokens landed in the cheap seats. Seat by seat. The scanner seat. Haiku read more than twice as many tokens as Opus did. And that seat still cost 83% less. The builder seat. Sonnet used about one and a half times the tokens and cost 34% less. And the Planner, which stayed on Opus in both lineups, ended up being 43% of the roster's whole bill. So once the helpers are cheap, your one opus seat
7:40costs almost as much as the builder that wrote all the code. Time median run. Lineup A took 6 minutes 5 seconds. Lineup B 6 minutes 19. The roster won one round on time and lost two. The small fast scanner was never the faster scanner. Opus mapped the code in under 2 minutes every round. Haiku took about the same in round one and 3 minutes in round three because it went way wider and read way more. So small doesn't mean fast, it means cheap per token. And redoss. The planner sent work back to a helper zero times in all six runs. One brief, one report, done. Except one run did something nobody planned for. Round two, the roster. Claude code started the
8:26haik coup scanner in the background and the opus planner said waiting for the scanner but it didn't really wait. It started reading the code itself. Nine reads and searches of its own and around the 100 second mark it said I have enough to brief the builder. I'll send it now so the scanner's report isn't blocking. The scanner's report showed up almost 2 minutes later while the builder was already working 2500 words. And by the time the planner got them, the build was already done. So, you paid for a scanner and then your most expensive model did the scanner's job anyway. And funny enough, that round the roster still won faster and cheaper. But the thing everybody worries about with routing is the scary version. A small model hands back a wrong summary and the planner just trusts it. So, I had a
9:12separate agent check every claim in all six scanner reports against the real code. About 340 claims. The Haiku reports had two wrong claims. The Opus reports had five. And one of those Opus mistakes actually went somewhere. In round three, the Opus scanner told the planner that a certain design avoids a problem. It doesn't. The planner put that design straight into the builder's brief, and the builder built it. Our 56 hidden tests didn't catch it. So, after the runs, I wrote 10 more checks. Real read me stuff, like a note right after a bullet list. All three roster builds pass all 10. Two of the three Opus Everywhere builds miss three of them. A note right after a list just comes out as a plain quote. In round three, that came from the bad report. In round one,
9:58the Opus planner picked the same design all on its own. So, the one summary that put a bug in a build came from the superstar, not the small model. Now, it's three runs. So, don't take that as Haiku beats Opus. Take it as the real risk with routing. The planner only sees the summary. It never sees what the helper actually read. So, if the summary is wrong and it sounds confident, it can go straight into the plan, no matter which model wrote it. So, how do you build your own roster? Here's my rule of thumb. One, keep your best model on judgment, planning, reviewing, debugging. That's the seat that decides if everything else was right. Two, give lookups to the small model, but keep its brief tight. In our runs, Haiku was cheap but wordy. It searched wide and
10:44wrote long reports. Something like find these three things and stop. That's how I'd keep it fast. Three, put a mid model on the build when there's a clear plan and real tests to check against. Sonnet matched opus on every hidden test here. Four, have the planner double check the one claim the whole design rests on before the builder starts. That's the check that could have saved round three. Five, run slashtasks and make sure each helper is really on the model you picked. And if your helpers are on haiku and sonnet, in our runs, the planner was almost half the bill. That's fine. That's the seat worth paying for. And tap like before you go. So, which job would you never hand to a small model? Planning, debugging, code review? Tell me in the comments. I read them. Have a
11:30blessed day.