{"version":"2.1.332","anchor":"sdk-onprocessexit-option","canonical_anchor":"sdk-onprocessexit-option","heading":"SDK hosts can be told when the Claude Code process exits","tier":"use","area":"Agents","scope":"individual","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.332\/e\/sdk-onprocessexit-option","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.332","markdown":"### SDK hosts can be told when the Claude Code process exits\n\nThe SDK now calls an `onProcessExit` option when the Claude Code process it started exits\n\n**What**\n\nThe SDK lets your own program start and drive Claude Code as a separate process. It now accepts an `onProcessExit` option, which it calls when that process exits. If your handler throws an error, the error is logged and the SDK continues.\n\n**Why**\n\nPrograms built on the SDK can now notice when the Claude Code process ends and react to it.\n\n- Area: Agents\n- Names: `onProcessExit`\n- Tier: Use it now\n- Useful: 4\/5\n- Signal: 2\/5\n- Scope: individual\n- Heads-up: no"}