[Bug] Authentication fails with cached browser session - 401 error
Resolved 💬 3 comments Opened Mar 31, 2026 by giraudremi92 Closed Apr 3, 2026
Bug Description
claude code --feedback
Title: Authentication fails with browser cache - Error 401 (requires private browsing)
Description:
I encountered a persistent 401 "Authentication Failed" error when trying to use Claude Code, despite having an active Pro subscription.
Steps to reproduce:
1. Run `claude code auth login`
2. Browser opens with cached session
3. Complete authentication flow
4. Claude Code shows "API Usage Billing" but returns 401 errors on every request
Root cause:
Browser cache was interfering with the OAuth authentication process.
Solution found:
Using private/incognito browsing mode during `claude code auth login` resolved the issue completely.
Suggestion:
- Claude Code should either force a fresh browser session during auth
- Or display a helpful error message: "If authentication fails, try using private browsing mode"
- Or automatically detect auth failures and suggest clearing browser cache
Environment:
- OS: Linux (Ubuntu)
- Claude Code version: 2.1.88
- Account type: Pro subscription with additional usage enabled
- Browser: (your browser here)
Impact:
This wasted significant troubleshooting time and could affect other users with similar cached sessions.
**Environment Info**
- Platform: linux
- Terminal: gnome-terminal
- Version: 2.1.88
- Feedback ID: 8f4de978-7f93-49f1-83cb-2efa70dc5c89
**Errors**
```json
[{"error":"Error: spawn /home/alki-remi/n/lib/node_modules/@anthropic-ai/claude-code/vendor/ripgrep/x64-linux/rg EACCES\n at ChildProcess._handle.onexit (node:internal/child_process:285:19)\n at onErrorNT (node:internal/child_process:483:16)\n at process.processTicksAndRejections (node:internal/process/task_queues:90:21)","timestamp":"2026-03-31T09:08:36.944Z"}]This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗