Skip to content
BENIBIX Learn

CLAUDE_CODE_OAUTH_REFRESH_TOKEN

AI⌨️ Claude CodeConfiguration

Also known as CLAUDE_CODE_OAUTH_SCOPES

It lets claude auth login sign in with no browser.

Think of it like

It is like you swap a ticket at the desk. You get a new wristband.

Example

Lucy builds machines for her team with a script. It sets the refresh token and scopes, then runs claude auth login, so each machine is signed in when it starts.

Why it matters

A machine with no screen can still be signed in to a Claude plan.

Definition

CLAUDE_CODE_OAUTH_REFRESH_TOKEN holds a refresh token for a Claude account. When it is set, claude auth login trades it for a login with no browser. It needs a second one too, with the list of scopes the token was made with. Claude Code ignores both in project or local settings.

Example code

bash
export CLAUDE_CODE_OAUTH_REFRESH_TOKEN=your-refresh-token
export CLAUDE_CODE_OAUTH_SCOPES="user:profile user:inference"
claude auth login
Sign a new machine in from a script.

Common mistake

Setting the token but not the scopes. The login needs both of them.

Key takeaways

  1. 1
    Swapped at login. No browser.
  2. 2
    Needs the scopes. Both variables.
  3. 3
    Not from project files. Ignored there.