A county public-health department wraps Claude Code in a small service that summarizes de-identified immunization-clinic notes. The dashboard team wants to show progress in the browser as the run proceeds, so they need machine-readable events emitted incrementally over the life of the run rather than one payload delivered at the end. Which --output-format value produces that behavior?
Select an answer to reveal the explanation.
Short Explanation
Picture a results sheet handed over after the finish line versus a lap-by-lap call. stream-json emits one JSON object per event as the run happens, so the dashboard can render progress instead of waiting.
Full Explanation
In headless mode the output format decides two things at once: the shape of what comes out and when it arrives. A live progress view is a timing requirement as much as a parsing requirement, so the choice has to land on a format that is both machine-readable and incremental.
stream-json emits newline-delimited JSON event objects over the life of the run, describing what the model and its tools are doing as they do it. A consumer parses each object on arrival instead of blocking until the process exits, which is exactly what a browser dashboard needs, and the same event stream gives the wrapper service intermediate steps to log and audit rather than only a final answer.
text does stream, but it streams prose written for a human reader and carries no event structure a dashboard can parse reliably; json is machine-readable yet delivers a single result object after the run completes, which is the batch behavior the team is trying to move away from; and markdown is not one of the available output-format values, and a progressively rendered prose format would in any case reintroduce the parsing problem structured events exist to solve.
Exam caveat: streamed events are a progress feed, not a result contract, and event shapes are richer and more incidental than the final result, so a dashboard that hard-codes assumptions about every event type is fragile. Operational check: consume the stream, assert that objects arrive before process exit, and have the dashboard read progress from events while taking the authoritative summary from the final result event.