Headless mode's startup-failure errors now include a structured reason code
When Claude Code fails to start in headless mode (running without an interactive interface, using stream-json output), the error-reporting helper now accepts a startupFailureReason and a resultIndex, and includes both in the emitted stream-json error object. One concrete reason value is session_held_by_background, used when a session is already held by a background process.
This gives tools and scripts consuming stream-json output a structured way to detect and handle specific headless startup failures, such as a session being locked by another background process, instead of just seeing a generic error.