Skip to content
BENIBIX Learn

--forward-subagent-text Flag

Also known as claude --forward-subagent-text, Subagent text in the stream

It adds what subagents write to the output stream.

Think of it like

It is like you hear what each helper says. You do not just hear what the boss tells you.

Example

Jack's tool logs each run for review. With --forward-subagent-text, it saves what each subagent did too, not just the main answer.

Why it matters

When a subagent gets something wrong, its own words show where.

Definition

--forward-subagent-text adds what subagents write and think to the output stream. Each piece is marked with the tool call that started that subagent. So you can rebuild its whole chat. Without it, the text of a subagent that runs in the foreground is left out. It needs -p and --output-format stream-json.

Example code

bash
claude -p --output-format stream-json --verbose --forward-subagent-text "Review this repo"
Keep each subagent's words in the stream.
This flag adds the subagent lines to the stream.

Common mistake

Mixing subagent lines with the main chat. Use the tool call ID on each line to sort them.

Key takeaways

  1. 1
    Subagent text. And thinking.
  2. 2
    Marked by tool call. To sort them.
  3. 3
    Needs stream-json. And -p.

Learn it properly