# --forward-subagent-text Flag

> It adds what subagents write to the output stream.

**Field:** Artificial Intelligence  
**Category:** Claude Code  
**Also known as:** claude --forward-subagent-text, Subagent text in the stream

## Think of it like

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

## 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

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

## Example code

```bash
claude -p --output-format stream-json --verbose --forward-subagent-text "Review this repo"
```

Keep each subagent's words in the stream.

## Why it matters

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

## Common mistake

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

## Three principles

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

## Related terms

- [Subagent](https://learn.benibix.com/term/ai/subagent)
- [Built-in Subagents](https://learn.benibix.com/term/ai/built-in-subagents)
- [--output-format Flag](https://learn.benibix.com/term/ai/output-format-flag)

## Taught in

- [Print Mode Output Flags](https://learn.benibix.com/learn/ai-claude-code-commands/print-mode-output-flags): Claude Code Commands, 14/17

![A stream-json run prints one event per line. Each stream flag adds one more kind of line.](https://learn.benibix.com/diagrams/flag-stream.svg)

---

Source: https://learn.benibix.com/term/ai/forward-subagent-text-flag
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-16
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
