claude_code.internal.stdin_message

(internal) One CLI run's whole prompt as the single stream-json user message the CLI reads on stdin (`--input-format stream-json`), newline terminated. Every prompt takes this path, text-only or not: argv cannot carry media (`text()` folds each media part to a placeholder the model never sees), Linux caps one argument at 128 KiB and macOS the whole argv at 1 MiB, and an argv prompt that starts with `-` parses as an option. Exactly one message: the CLI runs one turn, and emits one result, per stdin message. `suffix` is the text the client appends after the prompt: the folded journal and the tool protocol.

Reference version

Signature

function claude_code.internal.stdin_message(
prompt: ai.Prompt,
suffix: string
) -> string throws baml.errors.InvalidArgument | baml.errors.Timeout | ai.errors.InvalidRequest | ai.errors.NetworkFailure

(internal) One CLI run's whole prompt as the single stream-json user message the CLI reads on stdin (--input-format stream-json), newline terminated. Every prompt takes this path, text-only or not: argv cannot carry media (text() folds each media part to a placeholder the model never sees), Linux caps one argument at 128 KiB and macOS the whole argv at 1 MiB, and an argv prompt that starts with - parses as an option. Exactly one message: the CLI runs one turn, and emits one result, per stdin message. suffix is the text the client appends after the prompt: the folded journal and the tool protocol.

Source:<builtin>/claude_code/ns_internal/content.bamlbytes 722–951