{"version":"2.1.336","anchor":"headless-sign-in-before-refusal-new-sdk-claude-authenticate","canonical_anchor":"headless-sign-in-before-refusal-new-sdk-claude-authenticate","heading":"Programs built on Claude Code can sign a user in before startup is refused","tier":"notice","area":"SDK","scope":"individual","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.336\/e\/headless-sign-in-before-refusal-new-sdk-claude-authenticate","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.336","markdown":"### Programs built on Claude Code can sign a user in before startup is refused\n\nIn headless stream-json mode, Claude Code can now run a sign-in flow for the host program before it would refuse to start.\n\n**What**\n\nSome programs run Claude Code in the background and talk to it through JSON messages instead of a terminal (the `stream-json` input format). In that setup, when Claude Code would otherwise refuse to start, it now first answers a few control messages that let the host program sign the user in: `initialize`, `claude_authenticate`, `claude_oauth_callback` and `claude_oauth_wait_for_completion`.\n\nThis only happens when:\n\n- input is `stream-json`\n\n- no terminal is attached\n\n- none of several startup options is used, such as resume, continue or background\n\nIf the managed settings on the computer change during sign-in, or cannot be read, Claude Code does not save the sign-in and asks you to sign in again. The sign-in also gives up after a time limit.\n\n**Why**\n\nPrograms that embed Claude Code can now sign a user in when a company policy would otherwise stop it from starting.\n\n- Area: SDK\n- Names: `claude_authenticate`, `claude_oauth_callback`, `claude_oauth_wait_for_completion`\n- Tier: You'll notice\n- Useful: 3\/5\n- Signal: 3\/5\n- Scope: individual\n- Heads-up: no"}