⌨️--input-format Flag
Also known as claude --input-format, --input-format stream-json, --replay-user-messages
It sets how claude -p reads what you send it.
Think of it like
It is like you pass notes to a friend one at a time. You do not send one big letter.
Example
Jack's chat app keeps one Claude run open. Each time the user types, the app sends one JSON line in, and reads the reply lines that come out.
Why it matters
One run can take many messages, so an app does not start a new session for each one.
Definition
Example code
bash
claude -p --input-format stream-json --output-format stream-json --verboseCommon mistake
Key takeaways
- 1text. One prompt.
- 2stream-json. A message per line.
- 3--replay-user-messages. Echo each one back.