[BUG] 401 after successful /login on 2.1.87 — token not persisting FOR 12+ hours and 10+ attempts with success print

Resolved 💬 5 comments Opened Mar 29, 2026 by fantomdancer Closed May 17, 2026

Preflight Checklist

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

What's Wrong?

/login completes successfully ("Login successful") but the very next prompt returns 401 "OAuth token has expired". Repeats in a loop. Existing session on 2.1.86 still works fine. New sessions on 2.1.87 cannot authenticate.

What Should Happen?

After a successful /login, the OAuth token should be persisted and all subsequent prompts should authenticate without errors.

Error Messages/Logs

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_011CZWiVQUbGyhHi1KGyvE9h"}

Steps to Reproduce

  1. Open new terminal
  2. Run claude
  3. Complete /login in browser — says "Login successful"
  4. Type anything — 401 immediately
  5. Existing older session (2.1.86) continues to work
  6. Tried VPN, didn't help

Claude Model

None

Is this a regression?

I don't know

Last Working Version

2.1.86

Claude Code Version

2.1.87

Platform

Other

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

  • Plan: Claude Max Account
  • Login method: Claude Max Account (OAuth)
  • No ANTHROPIC_API_KEY set
  • Region: Sri Lanka
  • Request ID: req_011CZWiVQUbGyhHi1KGyvE9h
  • Had 3 active terminal sessions on 2.1.86 yesterday
  • After the issue appeared, 2 of those sessions got logged out (401)
  • 1 session on 2.1.86 remained authenticated and still works
  • I have not logged out of that surviving session

View original on GitHub ↗

This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗