[BUG] Still not fixed the auth bug? How long?
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?
This was reported countless times. Yes this is a duplicate or triplicate or so on. I open a new issue to raise awareness. Why every time I have to click the login? It is getting annoying seriously.
What Should Happen?
Should work next day too like it did.
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_011CUPpHpFKkG3u8tCspjLBh"} · Please run /login
Steps to Reproduce
Work in Code. Stop working, move on with your life. Come back next day. Say something to Claude because you forgot about the damn bug (and maybe hope it's been fixed?). Surprise, after you typed everything instead of seeing the Cogitating and such, you get the error. Is this supposed to be a smart system? Why can't remember I was logged in yesterday? Alzheimer perhaps.
Claude Model
Not sure / Multiple models
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
claude --version 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_011CUPpwhTrDNdARF6ZLzKXy"} · Please run /login
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Cursor
Additional Information
Delete this issue after you read it, it is just meant as a bump, hey fix it already, it is annoying.
12 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
Yes Claude this is a duplicate, a deliberate duplicate because you did not fix the problem yet.
I found a way to fix the annoyance! Instead of starting with what work I need done, I politely say hi! This way I get either a reply or a 401. Somebody loses some tokens for the random hi, but oh well...
<img width="696" height="173" alt="Image" src="https://github.com/user-attachments/assets/d8fa92e5-2cec-4b1c-bad0-6aa5ee54baea" />
for the VS cod extension, the code claude login stopped working at all. It works well in the terminal mode, but in the extension the login just fails. I use /login and authenticate my Claude Max account, but then in the extension just nothing happens.
Cannot effectively work with code claude now, please help! this is started after claude v2 upgrade I think.
Extension output:
Hi everyone 👋 I encountered the same issue —
the Claude Code VS Code extension couldn’t log in or connect even though I have a Claude Pro subscription.
After some digging, I found the root cause and the full fix 👇
⚠️ Root Cause
The VS Code extension itself doesn’t handle authentication.
It relies entirely on the Claude CLI for login and token management.
If you haven’t installed or logged in via the CLI, the extension will fail with errors like:
❌ “Missing API key”
❌ “Unable to connect to Anthropic services”
❌ “401 Unauthorized”
✅ Solution: Link the VS Code extension to your Claude CLI login
1️⃣ Install Claude CLI
npm install -g @anthropic-ai/claude-code
2️⃣ Log in using your Claude Pro subscription
claude login --method=claudeai
💡 This will open a browser window for you to log in with your Claude.ai account.
After successful login, a file ~/.claude.json will be created to store your session.
3️⃣ Verify your login
claude whoami
You should see:
Using Claude.ai Subscription
✅ That means your Pro account is active and recognized.
4️⃣ Open VS Code again
Once the CLI is logged in, the VS Code extension will automatically detect your session —
no need to enter any API key or credentials manually.
🧰 Optional: If you use a local proxy
Add these environment variables to .vscode/settings.json:
{
"claude-code.environmentVariables": [
{ "name": "HTTP_PROXY", "value": "http://127.0.0.1:your" },
{ "name": "HTTPS_PROXY", "value": "http://127.0.0.1:your" }
]
}
Adjust the proxy address/port to match your setup.
🧠 Explanation
As of Claude Code v2.0.26,
the VS Code extension is just a front-end interface for the CLI.
All login, authentication, and API calls go through the CLI backend.
So the correct setup order is:
🪄 Install CLI → Log in (Pro) → Open VS Code
💬 In short
The extension doesn’t log in directly — it mirrors the CLI’s login session.
Make sure your CLI is logged in with Claude Pro, and the plugin will start working instantly.
How long? Is there anybody even working on this bug? Is it in attention to somebody that this is actually ANNOYING????
Happened again. Seriously, I will redirect the monthly 200$ to Codex if this keeps happening.
Took me a while and several tries to fix this but in the end it worked, here's what I did:
/costinto the Claude Code extension you should see your current plan.This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.
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.