[BUG] Frequent mid-session 401 errors

Status Fixed / completed
Maintainer reply None cached
Activity 3 comments · opened Apr 16, 2026 · closed Apr 24, 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?

After recent update (within last week), getting frequent mid-session 401 errors in Claude Code in the desktop app (Windows 11).

Failed to authenticate. API Error: 401 {"type":"error","error":{"type":"authentication_error","message":"Invalid authentication credentials"},"request_id":"req_011Ca7eMZaEWxrcefZLfmC8e"}

I have to close out of the app and restart it, which is disruptive to work flow. Prior to this I could remain logged in and active for days.

What Should Happen?

Claude Code should not log me out mid-session.

Error Messages/Logs

Steps to Reproduce

Use Claude Code in desktop (Windows 11), be inactive for any short period of time (30 minutes?) and come back to make a subsequent request.

Claude Model

Sonnet (default)

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

1.2773.0 (884b37)

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

VS Code integrated terminal

Additional Information

_No response_

View original on GitHub ↗

3 Comments

github-actions[bot] · 6 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/40830
  2. https://github.com/anthropics/claude-code/issues/18225
  3. https://github.com/anthropics/claude-code/issues/36911

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

eat-sleep-code · 6 months ago

This appears to have just started in the last week, did not exist in prior builds (i.e. the linked issues).

Although this is concerning that two of the linked issues are a month or more old and this is not resolved!

github-actions[bot] · 5 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.