{"version":"2.1.317","anchor":"headless-runs-send-a-final-host-exit-code-step-ultrathinkty","canonical_anchor":"headless-runs-send-a-final-host-exit-code-step-ultrathinkty","heading":"Headless runs pass their exit code through a final step before exiting","tier":"internal","area":"Headless Mode","scope":"individual","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.317\/e\/headless-runs-send-a-final-host-exit-code-step-ultrathinkty","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.317","markdown":"### Headless runs pass their exit code through a final step before exiting\n\nHeadless runs now hand their exit code to a final step before exiting, and each user turn carries two extra pieces of information\n\n**Unclear.** What the new final step does with the exit code, and whether it changes what a headless run outputs or reports, is not known.\n\n**What**\n\nIn headless mode, where Claude Code runs without its interactive screen, it used to exit directly when a run finished. It now passes the exit code (the number a program reports when it ends, used by scripts to tell success from failure) through a final step first. That step also receives the output format, the SDK address and the connection being used. The SDK is the kit for building your own programs on top of Claude Code.\n\nOther changes in the same area:\n\n- each user turn now records whether ultrathink was typed\n\n- each user turn now carries information about widget views\n\n- Claude Code now handles a list of withdrawn files\n\n**Why**\n\nThese are groundwork for capabilities that programs built on the SDK can use.\n\n- Area: Headless Mode\n- Tier: Under the hood\n- Useful: 1\/5\n- Signal: 1\/5\n- Scope: individual\n- Heads-up: no"}