← All recipes
  • subagents
  • models
  • cost

We gave Opus a 902-file repo and a search-heavy bug. It started 0 subagents in 15 runs

A follower said our last task was too small for Opus to delegate. So we used undici, Node's HTTP client (902 files, pinned commit), and a bug that needs tracing through 4+ files. Sonnet alone, Opus with subagents off and Opus with default subagents all fixed it in 5 of 5 runs, and none of them started a single subagent. Sonnet cost $0.248 a run; Opus $0.776 with subagents available and $0.951 without.

Cost per run Each bar is the average cost of the runs, starting at $0.

Other checks: Sonnet alone runs 3 and 4 missed “ran the tests after the last code edit (TRACE.md edits don't count)”. Every run in every setup passed these three. Two Sonnet runs missed one other check: they edited the code again after their last test run.

See every run, check and diff →

In our mixed-models test last Friday, Opus never handed any work to a subagent, and our forking test two days earlier got 0 fork calls in 9 runs. @0xMfox asked the right question: “could be opus never delegated exploration in those 3 runs — have you tried a more search heavy task and checked /tasks?”

So we tried a bigger, more search-heavy task, and counted every subagent from the logs.

The setup

The repo: undici, the HTTP client behind Node’s fetch, at commit 6228fc5: 902 files, 119 of them in lib/. We didn’t copy it into our repo. A setup script fetches that exact commit for each run.

The bug: we planted one. undici has a maxResponseSize option that caps a response body. We changed one line in lib/dispatcher/client-h1.js so it checks each incoming chunk, not the running total. A big body in one piece is still rejected, but the same body in small chunks gets through. undici’s own max-response-size tests still pass with the bug in place.

The prompt gave the bug as a user report (“when the server streams a bigger body in many small chunks, the whole thing gets through”) and asked for three things:

  1. Trace how maxResponseSize gets from new Agent({ maxResponseSize }) to the code that enforces it, file by file.
  2. Check five other ways people set it (BalancedPool, a RetryAgent wrapping an Agent, ProxyAgent, H2CClient, and a Client using the Milo HTTP/1 parser): is the limit passed down and enforced on the whole body, and which files and lines show it? Answers 1 and 2 go in TRACE.md.
  3. Fix the bug, add a regression test, and run the relevant test files. The prompt said the full suite is very large.

That means reading at least 10 files across the dispatcher layers, which is the kind of search Claude Code’s built-in Explore subagent is meant for.

Three setups, 5 runs each, on Claude Code 2.1.312 with each model at its default effort:

  • Sonnet alone: claude-sonnet-5-5, default settings (subagents available).
  • Opus, subagents off: claude-opus-5-5, with the subagent tool denied in .claude/settings.json.
  • Opus, default subagents: claude-opus-5-5, default settings. Explore, general-purpose and Plan were all available.

Six checks graded each run afterwards, including a hidden test Claude never saw: 7 cases that stream a too-big body in 400-byte chunks through an Agent, a Pool and a Client, and confirm smaller bodies still get through.

How we counted delegation: every call to the subagent tool in each run’s output (Claude Code’s headless mode calls it Task in its tool list, the model calls it Agent). We also checked Claude Code’s own session logs: Agent/Task calls in the main log, and subagent transcripts in the session’s subagents/ folder, which is the data /tasks shows. Headless runs have no /tasks screen, so we read the logs directly. We tested the session-log counter on a run from Friday’s test that we know started 4 subagents, and it found all 4.

What happened

Sonnet alone Opus, subagents off Opus, default subagents
Subagent calls, all 5 runs 0 0 0
Runs where the subagent tool was available 5 of 5 0 of 5 5 of 5
Subagent transcripts in the session logs 0 0 0
Fixed the bug (hidden test, 7 cases) 5 of 5 5 of 5 5 of 5
TRACE.md named all 4 default-path files 5 of 5 5 of 5 5 of 5
TRACE.md named all 6 other-path files 5 of 5 5 of 5 5 of 5
Passed all 6 checks 3 of 5 5 of 5 5 of 5
Average cost per run $0.248 $0.951 $0.776
Cost range $0.224 to $0.265 $0.667 to $1.125 $0.681 to $0.918
Average tokens per run 669,585 1,795,333 1,405,027
Average output tokens 9,497 17,267 14,406
Average tool calls (all in the main session) 29.6 52.4 41.6
Average turns 30.6 53.6 42.6
Largest main-session context, average 49,503 63,842 56,764

Claude Code 2.1.312, claude -p, 5 runs per column (averages unless marked). Token counts include cached input. Every run, check and diff: run data.

The 6 smoke-test runs before these (one per setup on a first, narrower version of the prompt, then one per setup on the final prompt) didn’t start a subagent either. That makes 0 in 21 runs.

What we learned

Opus didn’t delegate, even with 902 files and an explicit tracing job. The subagent tool was available in all 5 default-Opus runs and never used. Opus searched with Grep, Read and shell commands like grep -n and sed -n in its own session, and so did Sonnet. Its largest main-session context averaged 56,764 tokens, so it wasn’t close to running out of room.

Sonnet did the same job for about a third of the price. All three setups fixed the bug in 5 of 5 runs, and every TRACE.md named all 10 files we checked for. Sonnet averaged $0.248 a run; Opus with default subagents cost 3.1 times that ($0.776), and Opus with subagents off cost 3.8 times that ($0.951).

Turning subagents off didn’t matter here, because they were never used. Opus with the tool denied cost more on average, but the cost ranges overlap ($0.667 to $1.125 vs $0.681 to $0.918) and both setups worked the same way. With 5 runs each, we read that as noise. One real difference: denying the tool removes it from what Claude Code loads, so the first request was smaller (16,397 vs 18,687 tokens on average).

The answer to @0xMfox’s question, for now: on this task, a bigger repo with more searching didn’t get Opus to delegate by default. In Friday’s test, Claude did start subagents in every run of the setup whose CLAUDE.md told it to.

What failed, and the limits of this test

  • Two Sonnet runs failed one check. They passed the hidden test, but their last code edit came after their last test run, so we don’t count them as having tested the final code. No Opus run missed a check, and no run errored.
  • The first prompt was too narrow, so we changed it before the scored runs. Version 1 only asked for the default trace and the fix. Each run started with one search for maxResponseSize, which turns up most of the files involved (3 smoke runs, $0.79, no subagents). We added the five-way check (step 2) to force more searching. Both smoke rounds are included in the spend below and in the run data.
  • We only checked that TRACE.md names the right files. We didn’t grade whether each sentence about BalancedPool, ProxyAgent and the rest was right.
  • One task, one repo, 5 runs per setup. A vaguer question (“how does this codebase handle X?”) or a bigger monorepo might get a different result. We also left out CLAUDE.md lines or prompts that ask Claude to delegate. That’s a different test.
  • The bug is planted. It’s one realistic line in real code, but we wrote it.
  • We didn’t compare time. All 15 runs ran in parallel, so wall-clock times aren’t comparable.
  • API cost only. In total we spent $13.04 in API charges: $0.79 on the first smoke round, $2.37 on the second and $9.88 on the 15 scored runs. We didn’t measure how much of a Pro or Max plan’s usage limit this would use.

The recipe

  1. Don’t assume Claude Code delegates on its own. Even on a 902-file repo with a search-heavy prompt, default settings gave 0 subagents in 21 runs, with Opus and with Sonnet.
  2. Check whether it actually did. In a session, /tasks and the subagent panel show it. In logs, look for Agent or Task tool calls, or a subagents/ folder next to the session’s .jsonl under ~/.claude/projects/.
  3. For a trace-and-fix like this, start with Sonnet. It passed the hidden test in 5 of 5 runs at $0.248 a run, about a third of what Opus cost.
  4. If you want delegation, ask for it. Put it in the prompt or CLAUDE.md, and check the logs to see whether it happened.