{"version":"2.1.274","anchor":"headless-sdk-sessions-now-detect-and-re-inject-a-changed-sys","canonical_anchor":"headless-sdk-sessions-now-detect-and-re-inject-a-changed-sys","heading":"Headless SDK sessions now detect and re-inject a changed system prompt mid-session","tier":"internal","area":"SDK","scope":null,"heads_up":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.274\/e\/headless-sdk-sessions-now-detect-and-re-inject-a-changed-sys","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.274","markdown":"### Headless SDK sessions now detect and re-inject a changed system prompt mid-session\n\nHeadless SDK sessions now detect a changed system prompt mid-session and re-inject it into the transcript\n\n**What**\n\nIn headless SDK sessions (Claude Code used programmatically rather than interactively), a new check compares whether the system prompt was already sent against whether the caller's `systemPromptSnapshot` has since changed. If it has changed, the new system prompt is pushed into the session transcript as an event and telemetry is recorded, before the system prompt is applied for that turn.\n\n**Why**\n\nThis lets a long-running headless session pick up a system prompt change partway through, rather than being stuck with whatever prompt was set at the start of the session.\n\n- Area: SDK\n- Names: `systemPromptSnapshot`\n- Tier: Under the hood\n- Useful: 2\/5\n- Signal: 1\/5"}