Follow Discord
Sweep 06 Nov 2026 · 01:32Z Build v2.1.319 537 read Stable v2.1.311 Latest v2.1.318 Next v2.1.319 Feeds RSS JSON llms.txt llms-full.txt Unofficial

Claude Code v2.1.314 ·

Handling of host-supplied and environment OAuth tokens tightened

Claude Code no longer swaps a host-supplied login for the one saved on the machine, and treats CLAUDE_CODE_OAUTH_TOKEN more carefully

Group of 4 You'll notice Improvements
JSON All of v2.1.314
You'll noticeTier: how much it should matter to you
2Useful: my rating, 1 to 5
2Signal: worth watching, 1 to 5
Bash ToolArea: what it touches
ImprovementsKind: in v2.1.314,
ImprovementsSection of the release

Unclear What the new check tests is not known, so it is unclear in which setups the token is now removed.

What

Claude Code can be signed in by a token handed to it by the program that started it, or through the CLAUDE_CODE_OAUTH_TOKEN environment variable (a named value set outside Claude Code). Several places that handle these tokens changed:

  • On a 401 (the server refusing the login), a session whose login came from a host-supplied token, including one passed through a file descriptor, no longer switches to the login saved on the machine, because it may be a different account. The new message reads: "OAuth 401: the login this session is using was refused. The login saved on this machine was not used because it may be a different account. Sign in again in the app that started this session, or run /login."
  • The login source is now reported as "env" only when the stored access token matches CLAUDE_CODE_OAUTH_TOKEN or the other environment token source. Before, any set CLAUDE_CODE_OAUTH_TOKEN counted. When the variable is set, the file-descriptor token lookup is skipped.
  • CLAUDE_CODE_OAUTH_TOKEN is removed from the environment given to shell commands when dropShellOAuthToken is set or when a new check passes. Before, dropShellOAuthToken was the only condition.
  • When CLAUDE_CODE_OAUTH_TOKEN is set, loading policy limits now runs the same reset it ran only for credentials not held in the saved store.

Why

A session started by another app can no longer quietly change to a different account when its login is refused; you are asked to sign in again instead. If you sign in with CLAUDE_CODE_OAUTH_TOKEN, which credential Claude Code uses and whether the token reaches commands it runs may differ from before.

Read from
Names in the bundleCLAUDE_CODE_OAUTH_TOKEN
Since it was published

The entry above is what we published on the day. These lines were added later, as Anthropic's own pages caught up, and they sit beside the original rather than replacing it.

Added since A small documentation edit on Authentication touched a line naming CLAUDE_CODE_OAUTH_TOKEN after this was published. 5. `CLAUDE_CODE_OAUTH_TOKEN` environment variable. A long-lived OAuth token generated by [`claude setup-token`](#generate-a-long-lived-token). Use this for CI pipelines and scripts where browser login isn't available. If you run `/login` w… authentication see the edit
How sure we are
Something disagreesSomething we can check disagrees with this entry, or the writer said they could not settle it.
The writer flagged doubtWhat the new check tests is not known, so it is unclear in which setups the token is now removed.
Anthropic's documentation agreesA small documentation edit on Authentication touched a line naming CLAUDE_CODE_OAUTH_TOKEN after this was published.

See this entry in the whole of v2.1.314 →

Feedback