CLAUDE_CODE_DISABLE_AUTH_REFRESH_LOCK
Updated by Alex Sorokoletov
CLAUDE_CODE_DISABLE_AUTH_REFRESH_LOCK is a Claude Code environment variable: Turns off the lock that coordinates a GCP or AWS credential refresh across processes. With the lock on, one process refreshes and opens a single login browser instead of each process opening its own. Added in v2.1.286. Added in v2.1.286 and still present in v2.1.294. It is listed in the official reference.
| Status | Present in v2.1.294 |
|---|---|
| Added | Added in v2.1.286 |
| Category | Authentication |
| Official docs | Listed |
How to set it
For one session, export it in the shell that starts Claude Code:
export CLAUDE_CODE_DISABLE_AUTH_REFRESH_LOCK=<value>
claudeTo apply it to every session, add it to the env object of a settings file:
// ~/.claude/settings.json
{
"env": {
"CLAUDE_CODE_DISABLE_AUTH_REFRESH_LOCK": "<value>"
}
}Release notes that mention it
- Claude Code Version Tracker: Undocumented Env Vars, Feature Gates & Models
- claude-code-env-vars-v2-1-286
Related variables
CLAUDE_CODE_HOST_AUTH_REFRESH_TIMEOUT_MSCLAUDE_CODE_SDK_HAS_HOST_AUTH_REFRESHANTHROPIC_AUTH_TOKEN: Alternative bearer token; takes priority over API key.CLAUDE_BG_AUTH_SNAPSHOT_PATH: Path for snapshotting background session auth credentials to disk.CLAUDE_CODE_ENABLE_PROXY_AUTH_HELPER: Set to "1" to enable the proxy auth helper subsystem.CLAUDE_CODE_OAUTH_REFRESH_TOKEN: OAuth refresh token.CLAUDE_CODE_PROXY_AUTH_HELPER_TTL_MS: Cache TTL for helper-returned credentials.CLAUDE_CODE_SDK_HAS_OAUTH_REFRESH: Signals to the Claude Code runtime that the SDK caller has already provided an OAuth refresh token.
Frequently asked questions
What does CLAUDE_CODE_DISABLE_AUTH_REFRESH_LOCK do?
Turns off the lock that coordinates a GCP or AWS credential refresh across processes. With the lock on, one process refreshes and opens a single login browser instead of each process opening its own. Added in v2.1.286.
Which Claude Code version has CLAUDE_CODE_DISABLE_AUTH_REFRESH_LOCK?
Added in v2.1.286 and still present in v2.1.294.
How do I set CLAUDE_CODE_DISABLE_AUTH_REFRESH_LOCK?
Export it before starting Claude Code (export CLAUDE_CODE_DISABLE_AUTH_REFRESH_LOCK=value), or add it to the "env" object in ~/.claude/settings.json to apply it to every session.
All variables, searchable: Claude Code environment variables.