Skip to content
BENIBIX Learn

--include-partial-messages Flag

Also known as claude --include-partial-messages, Partial messages

It streams the answer in small pieces as Claude writes it.

Think of it like

It is like you watch a friend write, word by word. You do not wait for the whole note.

Example

Lucy's web app shows Claude's reply in a chat bubble. With --include-partial-messages, the words show up as Claude writes them.

Why it matters

Users trust a reply they can see coming more than a long wait for a block of text.

Definition

--include-partial-messages adds the answer to the stream in small pieces, as Claude writes it. Without it, each message shows up only when it is done. It needs -p and --output-format stream-json. An app uses it to show the words as they come, so the user is not left looking at a blank screen.

Example code

bash
claude -p --output-format stream-json --verbose --include-partial-messages "Explain recursion"
Get the words as they are written.
This flag adds the small partial lines to the stream.

Common mistake

Saving each piece as a full message. The pieces add up to one message, which comes again whole at the end.

Key takeaways

  1. 1
    Small pieces. As they are written.
  2. 2
    Needs stream-json. And -p.
  3. 3
    Whole message. Still comes at the end.

Learn it properly