What
Some programs control Claude Code by sending it messages as JSON, using --input-format stream-json. When Claude Code fails to start in that setup, it can answer with an assistant message beginning "Claude Code didn't start." followed by a success result whose terminal_reason is turn_setup_failed.
This happens only when all of these hold:
- a verdict from the host program is available
--input-formatis stream-json--no-session-persistenceis not usedCLAUDE_BRIDGE_REATTACH_SESSIONis not set- a user message arrives within a time limit
Why
A program driving Claude Code this way gets a readable explanation that startup failed, instead of no reply at all.
--input-format
Run Claude Code programmatically modified, high confidence
* **Pending wakeups**: in a run whose prompt you passed as text rather than with `--input-format stream-json`, when Claude has scheduled a [self-paced `/loop` wakeup](/docs/en/scheduled-tasks#let-claude-choose-the-interval), the run waits …see the edit
--input-format
Tools reference modified, high confidence
In a run with the `-p` flag whose prompt you pass as text rather than with `--input-format stream-json`, both defaults are 10 minutes instead of 30, because the run [waits for background commands after its result](/docs/en/headless#backgro…see the edit
One source agreesOne thing we can check says the same as this entry.
Anthropic's documentation agrees
--input-format on Run Claude Code programmatically