Source Intelligence

DisclaimerUnofficial, and not affiliated with Anthropic. Nearly all of this is read straight out of what ships: npm bundles, captured prompts, published docs. Anthropic's own notes go in verbatim, marked as theirs. The rest is my reading, and every entry carries the strings behind it. If one looks wrong, vote it down and say why.

All of v2.1.59 Home All releases olderv2.1.58 v2.1.61newer
Claude Code v2.1.59

Headless Login via Refresh Token

What

Log in to Claude Code non-interactively by providing an OAuth refresh token via environment variables, enabling automated CI/CD and headless deployments without a browser.

Usage
export CLAUDE_CODE_OAUTH_REFRESH_TOKEN="your-refresh-token"
export CLAUDE_CODE_OAUTH_SCOPES="user:inference"
claude /login
Details
  • CLAUDE_CODE_OAUTH_SCOPES is required when using the refresh token — the CLI exits with a helpful error message if missing
  • Scopes should be space-separated (e.g., "user:profile user:inference user:sessions:claude_code user:mcp_servers")
  • Bypasses the browser-based OAuth flow entirely
Evidence

Refresh token login flow (search for "CLAUDE_CODE_OAUTH_REFRESH_TOKEN")

Strings lifted out of the shipped bundle, so the claim above can be checked against them.

See this entry in the whole of v2.1.59 →