Repository navigation
Description
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?
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

Activity
github-actions commentedon Mar 30, 2026
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
Omrigotlieb commentedon Mar 30, 2026
@bcherny , I genuinely admire your posts and your way of thinking. You consistently bring clarity and depth to the developer tooling space.
I wanted to raise this because I believe it reflects a broader issue, not just an isolated case. I am seeing frequent 401 authentication errors in Claude Code that force me to run /login again and again, sometimes every few minutes. From the reports I’ve seen, other users appear to be experiencing similar behavior.
This has a real impact on usability. It interrupts active workflows, breaks concentration, and makes long coding sessions much harder than they should be. In practice, repeated auth failures turn a powerful tool into something difficult to rely on for sustained engineering work.
I’m a paying Max user and I want to use Claude Code heavily, but this issue creates constant friction during normal usage. Authentication should be stable enough that users can stay focused on building, not repeatedly re-establishing a session.
I’d really appreciate it if you and the team could investigate and address this. Claude Code has huge potential, but persistent re-login loops are the kind of reliability issue that can seriously damage the experience for power users.
Please help Claude Code remember me for longer than a few minutes :)
github-actions commentedon May 2, 2026
Closing for now — inactive for too long. Please open a new issue if this is still relevant.
github-actions commentedon Jun 21, 2026
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.