{"version":"2.1.327","anchor":"new-host-auth-env-var-claude-code-host-auth-ask-at-start-let","canonical_anchor":"new-host-auth-env-var-claude-code-host-auth-ask-at-start-let","heading":"Host apps can hand Claude Code a credential at start-up","tier":"use","area":"Host Integration","scope":"org","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.327\/e\/new-host-auth-env-var-claude-code-host-auth-ask-at-start-let","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.327","markdown":"### Host apps can hand Claude Code a credential at start-up\n\nA new variable, CLAUDE_CODE_HOST_AUTH_ASK_AT_START, makes Claude Code ask the app embedding it for a sign-in credential at start\n\n**What**\n\nSome apps run Claude Code inside themselves and supply its sign-in credentials. Such an app can already pass a credential to a session that is already running. A new environment variable, `CLAUDE_CODE_HOST_AUTH_ASK_AT_START`, now lets it hand one over at start-up. It joins the host sign-in variables `CLAUDE_CODE_HOST_AUTH_ENV_VAR` and `CLAUDE_CODE_HOST_CREDS_FILE`.\n\n- At start, Claude Code asks the host for a credential when `CLAUDE_CODE_HOST_AUTH_ASK_AT_START` and `CLAUDE_CODE_SDK_HAS_HOST_AUTH_REFRESH` are set and no gateway is in use.\n\n- This works only when `CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST` and `CLAUDE_CODE_HOST_AUTH_ENV_VAR` are also set. The credential is written into the variable that `CLAUDE_CODE_HOST_AUTH_ENV_VAR` names.\n\n- For Amazon Bedrock, when the variable is set and the named variable is `AWS_BEARER_TOKEN_BEDROCK`, Claude Code no longer supplies its own AWS access key, secret key, profile, config file or credentials file.\n\n- While the variable is set, another environment lookup returns an empty value instead.\n\n- A `not_refused` status is sent only to a host that set `CLAUDE_CODE_HOST_AUTH_ASK_AT_START`.\n\n**Why**\n\nThis only matters to apps and SDK integrations that embed Claude Code. Ordinary command-line users are not affected. It lets such an app provide the credential when Claude Code starts, rather than only to a session that is already running.\n\n- Area: Host Integration\n- Names: `CLAUDE_CODE_HOST_AUTH_ASK_AT_START`, `CLAUDE_CODE_HOST_AUTH_ENV_VAR`, `CLAUDE_CODE_HOST_CREDS_FILE`\n- Tier: Use it now\n- Useful: 4\/5\n- Signal: 3\/5\n- Scope: org\n- Heads-up: no"}