A research platform team runs a coordinator agent on the Claude Agent SDK that decomposes a question and delegates to web search, document analysis, synthesis and report generation subagents. Their custom harness ends the run and returns the assistant text to the caller as soon as any assistant message contains a text block. Telemetry across 800 runs shows that 46 percent of delivered reports contain only the coordinator's stated plan for which subagents it intends to call, and none of the findings those subagents returned. Which change most effectively addresses the logged behaviour?
- ARaise the maximum output tokens on the coordinator request so that a single assistant message has room to hold both the plan and the aggregated findings before the harness reads it.
- BInstruct the coordinator in CLAUDE.md to withhold all narrative text until every delegated subagent has reported, so that the first text block it emits is already the finished report.
- CMove report generation into a second API request that receives the subagent outputs as pre-formatted input, leaving the coordinator responsible only for issuing the delegation calls to each subagent.
- DDrive the harness from stop_reason, continuing the loop while it is tool_use by appending each tool result to the conversation history and sending it back, and returning to the caller only on end_turn. Correct
Why A is wrong: Tempting because the delivered report is short and truncation is a familiar cause of missing content, but the findings are missing because the loop stopped, not because the message ran out of room. A larger budget on a message the model has not yet been allowed to write changes nothing.
Why B is wrong: Tempting because it appears to remove the early text block the harness reacts to, but it makes correctness depend on the model choosing to stay silent on every run. A harness defect that needs a deterministic fix is being answered with probabilistic compliance.
Why C is wrong: Tempting because splitting the work looks like it isolates the broken stage, but the harness would still cut the coordinator off at its first text block, so the subagent outputs the second request depends on would never be produced.
Why D is correct: Correct because stop_reason is the signal that distinguishes a turn the model expects to continue after tool execution from a turn it considers finished, and an assistant message may carry text and tool_use blocks together.