{"name":"CLAUDE_CODE_OAUTH_REFRESH_TOKEN","slug":"claude-code-oauth-refresh-token","family":"env","title":"Environment variables","noun":"environment variable","description":"OAuth refresh token for Claude.ai authentication. When set, `claude auth login` exchanges this token directly instead of opening a browser. Requires `CLAUDE_CODE_OAUTH_SCOPES`. Useful for provisioning authentication in automated environments","description_source":"docs","described_by":{"doc":"claude-code\/env-vars","title":"Environment variables"},"presence":{"first_seen":"2.1.138","removed_in":null,"in_current_build":true,"newest_mined":"2.1.308","builds":149,"mined_builds":149,"first_cited":{"version":"2.1.59","released_at":"2026-02-25 23:38:34","spans":2}},"aliases":[],"entries":[{"version":"2.1.304","anchor":"managed-folder-check-on-policy-refresh-oauth-login-from-ref","heading":"Refresh-token login now saves your plan and rate-limit tier","line":"Logging in with `CLAUDE_CODE_OAUTH_REFRESH_TOKEN` now fetches your profile and saves your subscription type and rate-limit tier","released_at":"2026-10-19 19:47:15","reason":"found in this entry's text, named in this entry"},{"version":"2.1.300","anchor":"oauth-login-paths-gain-an-org-pin-verification-step-before-c","heading":"Login now checks your organisation before saving new credentials","line":"Signing in now checks the new token against the organisation required by managed settings before saving it, and fails if it does not match","released_at":"2026-10-14 14:27:26","reason":"found in this entry's text"},{"version":"2.1.271","anchor":"oauth-scope-default-no-longer-hardcodes-userinference","heading":"OAuth scope default no longer hardcodes 'user:inference'","line":"CLAUDE_CODE_OAUTH_SCOPES no longer defaults to 'user:inference' when unset","released_at":"2026-09-14 19:45:19","reason":"found in this entry's text"},{"version":"2.1.225","anchor":"claude-remote-tools-bridge-url-added-to-the-remote-settings-","heading":"CLAUDE_REMOTE_TOOLS_BRIDGE_URL added to the remote-settings env filter","line":"Remotely managed settings can no longer redirect your bridge connection by setting that URL variable.","released_at":"2026-08-07 23:08:56","reason":"found in this entry's text"},{"version":"2.1.59","anchor":"headless-login-via-refresh-token","heading":"Headless Login via Refresh Token","line":null,"released_at":"2026-02-25 23:38:34","reason":"found in this entry's text"}],"entries_total":5,"docs":[{"source":"claude-code","path":"env-vars","title":"Environment variables","documented":true},{"source":"claude-code","path":"self-hosted-environments-testing","title":"Test self-hosted environments end to end","documented":false}],"docs_total":2,"gates":[],"related":[{"name":"CLAUDE_CODE_OAUTH_401_WAIT_MS","slug":"claude-code-oauth-401-wait-ms","description":"Milliseconds Claude Code waits for a rotated token after an API call returns 401 while its OAuth token comes from `CLAUDE_CODE_OAUTH_TOKEN` or the OAuth token file descriptor source; `0` skips the wait. Default `60000` when `CLAUDE_CODE_REMOTE_SESSION_ID` is set and `0` otherwise; minimum `0`."},{"name":"CLAUDE_CODE_OAUTH_CLIENT_ID","slug":"claude-code-oauth-client-id","description":"Overrides the OAuth client ID in Claude Code's OAuth configuration, and is passed as the client ID when logging in from `CLAUDE_CODE_OAUTH_REFRESH_TOKEN`. An empty value is ignored."},{"name":"CLAUDE_CODE_OAUTH_SCOPES","slug":"claude-code-oauth-scopes","description":"CLAUDE_CODE_OAUTH_SCOPES no longer defaults to 'user:inference' when unset"},{"name":"CLAUDE_CODE_OAUTH_TOKEN","slug":"claude-code-oauth-token","description":"Three artifact environment variables are now recognised, with the API token stripped from spawned processes as a secret."},{"name":"CLAUDE_CODE_OAUTH_TOKEN_FILE_DESCRIPTOR","slug":"claude-code-oauth-token-file-descriptor","description":"Login tokens are warmed at startup, and skipped entirely for token-based auth."}],"url":"https:\/\/changelogs.core-directive.com\/reference\/env\/claude-code-oauth-refresh-token","family_url":"https:\/\/changelogs.core-directive.com\/reference\/env.json"}