{"version":"2.1.281","anchor":"new-sdk-pre-warmed-spare-process-await-claim-plus-claim-s","canonical_anchor":"new-sdk-pre-warmed-spare-process-await-claim-plus-claim-s","heading":"New SDK pre-warmed spare process: --await-claim plus claim_session control request","tier":"use","area":"SDK","url":"https:\/\/changelogs.core-directive.com\/v\/2.1.281\/e\/new-sdk-pre-warmed-spare-process-await-claim-plus-claim-s","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.281","markdown":"### New SDK pre-warmed spare process: --await-claim plus claim_session control request\n\nA hidden `--await-claim` option lets an SDK host start a spare Claude Code process early and bind it to a session later\n\n**What**\n\nThe Agent SDK lets other programs, called hosts, run and control Claude Code. A new hidden command-line option, `--await-claim`, starts Claude Code as a pre-warmed spare for such a host. The spare starts up with host-level options in a neutral directory, skips start-up work that belongs to a specific session, and waits. A new `claim_session` control request, a message the host sends to the running process, then binds it to a session. The option is described as SDK-internal.\n\nIt has these limits:\n\n- It requires `--print` with stream-json input and output.\n\n- It cannot be combined with `--continue`, `--resume` or `--fork-session`.\n\n- It cannot be used together with `CLAUDE_CODE_SUBPROCESS_ENV_SCRUB`.\n\n- A spare rejects claims it cannot accept with reason tokens such as `not_a_spare` and `already_claimed`.\n\nWhen claimed, the process does the session setup it skipped:\n\n- Moves plugins and MCP servers (connections to outside tools) over to the new working directory.\n\n- Starts MCP servers whose start was put off.\n\n- Applies the system prompt, title and agents.\n\n- Checks the permission mode and workspace trust.\n\n- Runs `SessionStart` hooks (commands that run when a session begins), queuing their first-turn messages ahead of the host's.\n\nIf something fails during claiming, the host is told to discard the spare. If the claim is rejected, the spare stays parked and can still be used. `set_cwd` now uses the same directory-moving helper, passing `restartLaunchDirStdioServers` for fresh sessions.\n\n**Why**\n\nA host can keep a Claude Code process already started and hand it a session when one is needed, instead of starting a new process each time.\n\n- Area: SDK\n- Names: `claim_session`\n- Tier: Use it now\n- Useful: 5\/5\n- Signal: 4\/5"}