Frequent 401 Authentication Errors Requiring Re-login

Resolved 💬 4 comments Opened Mar 30, 2026 by Omrigotlieb Closed May 2, 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?

Please run /login · API Error: 401 {"type":"error","error":{"type":"authentication_error","message":"Invalid authentication credentials"},"request_id":""}

This forces me to re-authenticate repeatedly and significantly disrupts my workflow.

Impact:

Happens every few minutes
Interrupts ongoing tasks
Makes the tool very difficult to use reliably

Environment:

Using Claude Code
Max subscription plan
(Add OS / terminal / version if relevant)

What Should Happen?

Expected behavior:
Authentication should persist, and I should not need to log in repeatedly during active usage.

Actual behavior:
Session appears to expire or become invalid frequently, requiring /login again.

Additional context:
This happens consistently during normal usage, not after long idle periods.

Error Messages/Logs

Steps to Reproduce

Steps to Reproduce:

Open Claude Code in the terminal
Log in using /login
Start working normally (e.g., run prompts, edit code, or interact with the agent)
Continue working for a few minutes

Observe that the session becomes invalid and the following error appears:

Please run /login · API Error: 401 {"type":"error","error":{"type":"authentication_error","message":"Invalid authentication credentials"},"request_id":""}
Re-run /login
Repeat steps 3–5

If you want to make it stronger (more “engineer-proof”), you can add:

Reproducibility: 100% (or “very frequent”)
Workaround: Re-running /login, but issue recurs within minutes

Claude Model

Not sure / Multiple models

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.1.87

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

<img width="2470" height="277" alt="Image" src="https://github.com/user-attachments/assets/744c0a63-8d43-4363-837b-9116ab34561f" />

View original on GitHub ↗

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