# CLAUDE_CODE_OAUTH_REFRESH_TOKEN

> It lets claude auth login sign in with no browser.

**Field:** Artificial Intelligence  
**Category:** Claude Code  
**Also known as:** CLAUDE_CODE_OAUTH_SCOPES

## Think of it like

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

## 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

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.

## 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.

## Why it matters

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

## Common mistake

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

## Three principles

- **Swapped at login.** No browser.
- **Needs the scopes.** Both variables.
- **Not from project files.** Ignored there.

## Related terms

- [Refresh Token](https://learn.benibix.com/term/development/refresh-token)
- [claude auth login Command](https://learn.benibix.com/term/ai/claude-auth-login-command)
- [claude setup-token Command](https://learn.benibix.com/term/ai/claude-setup-token-command)
- [OAuth 2.0](https://learn.benibix.com/term/development/oauth)

---

Source: https://learn.benibix.com/term/ai/claude-code-oauth-refresh-token-variable
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-16
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
