[DOCS] `--input-format` help text incorrectly says it "only works with --print"
Documentation Type
Incorrect/outdated documentation
Documentation Location
claude --help (CLI output, v2.1.220)
Section/Topic
--input-format flag description in claude --help
Current Documentation
claude --help currently says:
--input-format <format> Input format (only works with --print):
"text" (default), or "stream-json"
(realtime streaming input) (choices:
"text", "stream-json")
What's Wrong or Missing?
--input-format does not require --print. It works without it, which is easy to verify:
echo '{"type":"user","message":{"role":"user","content":[{"type":"text","text":"Reply with exactly: NOPRINT-OK"}]}}' \
| claude --output-format stream-json --verbose --input-format stream-json
This emits system/init, runs the turn, and returns a result message with subtype: "success" and result: "NOPRINT-OK" — no --print anywhere on the command line, and no error about a missing flag.
This is not an edge case. It is how the Agent SDK itself invokes the binary: the bundled sdk.mjs builds the argument list
["--output-format","stream-json","--verbose","--input-format","stream-json"]
and never passes --print. So the --help text contradicts the behavior of Anthropic's own SDK.
The website is already correct here, which makes this an inconsistency between two Anthropic sources rather than a uniformly wrong description. https://code.claude.com/docs/en/cli-reference describes the same flag as:
--input-format— Specify input format for print mode (options:text,stream-json)
That wording is accurate. Only the --help string asserts the hard requirement.
The practical cost is for anyone writing a host process against the streaming protocol: --help reads as "you must also pass --print", which is misleading, and it obscures that --input-format stream-json is the bidirectional mode rather than a variant of one-shot print mode.
Suggested Improvement
Bring the --help string in line with the cli-reference wording, for example:
--input-format <format> Input format for non-interactive mode:
"text" (default), or "stream-json"
(realtime streaming input) (choices:
"text", "stream-json")
Removing "only works with --print" is the substantive fix. If there is a supported distinction between -p --input-format stream-json and --input-format stream-json on its own, documenting that difference explicitly would be more useful still, since the second form is what SDK-style hosts actually use.
Impact
Low - Minor confusion or inconvenience
Additional Context
Verified on macOS with Claude Code 2.1.220, and the same --help string is present in 2.1.181. The --help text is unchanged between those versions.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗