Skip to content

[BUG] Claude code for VS Code OAuth token expiry not handled gracefully #33291

Description

@jmrobison

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

Subject: Claude Code stuck on authentication — OAuth token expiry not handled gracefully

Hi Anthropic Support,

I wanted to report an issue I experienced with Claude Code today (March 11, 2026).

Issue: Claude Code became stuck and was unable to authenticate. It did prompt me to re-authenticate but did not provide a clear recovery path within the app and never accepted the web-based auth.

Error received:
API Error: 401
{"type":"error","error":{"type":"authentication_error","message":"OAuth token has expired. Please obtain a new token or refresh your existing token."},"request_id":"req_011CYwhCxavYrSe3gQJ8ZcWR"}

Resolution: Running 'claude auth login' from the command line resolved the issue.

Suggested improvement: Claude Code for VS Code could detect an expired OAuth token and either automatically refresh it or better process when the user re-authenticates, rather than getting stuck / timing out silently. The auth web page could provide a token to enter directly instead of just reporting "all set".

Note: This occurred during the broader Claude.ai/Claude Code elevated errors incident reported on the status page today, and is likely an edge case during an outage.

Thanks for looking into this!

What Should Happen?

Claude should continue after web-based auth says success. (Or should indicate a connectivity problem and let the user know to try later when connectivity is restored and not ask for OAUTH in the first place.)

Error Messages/Logs

Error received:
  API Error: 401
  {"type":"error","error":{"type":"authentication_error","message":"OAuth token has expired. Please obtain a new token or refresh your existing token."},"request_id":"req_011CYwhCxavYrSe3gQJ8ZcWR"}

Steps to Reproduce

Simulate connectivity issue with OAUTH server during outage.
Run through web-based auth prompt
Notice that Claude Code for VS code cannot re-auth and continues to throw the same error.

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

No response

Claude Code Version

2.1.72

Platform

Other

Operating System

macOS

Terminal/Shell

VS Code integrated terminal

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:authbugSomething isn't workingplatform:vscodeIssue specifically occurs in VS CodestaleIssue is inactive

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions