How to Stream Nested Subagent Output From a Headless Claude Code Run
By default a headless Claude Code run emits only tool_use and tool_result blocks from its subagents, so the delegated reasoning is invisible. Pass --forward-subagent-text (Claude Code 2.1.211+) to get subagent text and thinking in the stream-json output, and demultiplex it by parent_tool_use_id.