claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG] Claude code requires users to constantly login

Open scrapebros opened this issue 6 months ago • 11 comments

[BUG] Claude code requires users to constantly login

Claude code requires user to authenticate using the web almost every day which is excessive and unnecessary, should not be required to do this every day

Get this screen when I just authenicated last night: ╭──────────────────────────╮ │ ✻ Welcome to Claude Code │ ╰──────────────────────────╯

██████╗██╗ █████╗ ██╗ ██╗██████╗ ███████╗ ██╔════╝██║ ██╔══██╗██║ ██║██╔══██╗██╔════╝ ██║ ██║ ███████║██║ ██║██║ ██║█████╗ ██║ ██║ ██╔══██║██║ ██║██║ ██║██╔══╝ ╚██████╗███████╗██║ ██║╚██████╔╝██████╔╝███████╗ ╚═════╝╚══════╝╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚══════╝ ██████╗ ██████╗ ██████╗ ███████╗ ██╔════╝██╔═══██╗██╔══██╗██╔════╝ ██║ ██║ ██║██║ ██║█████╗ ██║ ██║ ██║██║ ██║██╔══╝ ╚██████╗╚██████╔╝██████╔╝███████╗ ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝

Browser didn't open? Use the url below to sign in:

claude --version 1.0.9 (Claude Code)

scrapebros avatar Jun 07 '25 13:06 scrapebros

That is definitely not right! Which option are you using to sign in - Anthropic Console or a Claude subscription? What OS are you running? There are some differences in how the credentials are managed - e.g. MacOS stores as a keychain entry.

ant-kurt avatar Jun 07 '25 19:06 ant-kurt

This is claude code with a max subscription (I have the 20X and 5X subscriptions happens on both).

I'm seeing this behavior across multiple machines, they're all on: root@ai-code:~# uname -a Linux ai-code 6.8.12-9-pve #1 SMP PREEMPT_DYNAMIC PMX 6.8.12-9 (2025-03-16T19:18Z) x86_64 x86_64 x86_64 GNU/Linux root@ai-code:~#

scrapebros avatar Jun 08 '25 00:06 scrapebros

I saw this quite a bit a couple weeks ago but not as much starting last week.

michael-hedgineer avatar Jun 08 '25 22:06 michael-hedgineer

I'm seeing this too. It comes up multiple times a day at random times. I'm using nvm managed node in WSL2.

dwymark avatar Jun 09 '25 00:06 dwymark

Me as well. Recent change in behavior and very frustrating. Occurs in both WSL and on my Darwin machine; in both cases I am using a locally installed claude in ~/.claude.

nikomatsakis avatar Jun 09 '25 12:06 nikomatsakis

I am having the same issue.

  • Claude Code Max
  • Ubuntu machine (no wsl)

emregunel avatar Jun 09 '25 13:06 emregunel

What version of claude (claude --version), (claude update) are you folks running - could you ensure you are on latest? Anything specific that triggers it (updating settings, having multiple session in parallel?)

igorkofman avatar Jun 09 '25 22:06 igorkofman

What version of claude (claude --version), (claude update) are you folks running - could you ensure you are on latest? Anything specific that triggers it (updating settings, having multiple session in parallel?)

for me — it's when I use the same .claude path for linux & mac — the mac version deletes .credentials.json — log at https://github.com/anthropics/claude-code/issues/1414

max-sixty avatar Jun 10 '25 00:06 max-sixty

1.0.6 (Claude Code)

I am not sure this is the root cause for me, but I have noticed it seems to happen more when the SSH session ends or if I get into a situation where I;m experiencing #1422 and have to use control-c or control-z to escape it.

Is something overwriting the file or editing it after authentication and messing up the stored key? That'd be my guess but haven't investigated it.

scrapebros avatar Jun 10 '25 00:06 scrapebros

I always update to the latest version as soon as it's available. I tend to run 3-4 sessions on the same wsl2 instance at a given time. Unclear what the exact trigger is.

Another thing I have noticed is that the theme will change from light to dark around the same time that this bug occurs. This will happen mid-session sometimes, and the next Claude I open shows me the oauth prompt.

dwymark avatar Jun 10 '25 04:06 dwymark

Same for me in WSL2. It seems like it happens more when I use Ctrl+C to exit a session. I'm using ZSH and remoting into IntelliJ on WSL2 via JetBrains Gateway

dinhphieu avatar Jun 17 '25 07:06 dinhphieu

Not sure of the cause. I constantly have trouble with claude path when installing to local and switch back to global, I think this was somehow causing login to constantly trigger. Reinstalling to local fixed this for me.

cjoelrun avatar Jul 02 '25 17:07 cjoelrun

I have the same issue all the time! I connect to my laptop via SSH and have to re-login every time

svilupp avatar Aug 10 '25 06:08 svilupp

Same issue (at least once a day on Xcode 26 beta 7), it drove me so crazy that I switched to ChatGPT even though I prefer Claude...

Not to mention the fact that despite my max plan, I quickly reach the limit, whereas with ChatGPT+, which is much cheaper, I've never been blocked (on a Swift project). (and this is definitely not to promote them, because I much prefer Claude, but it's becoming increasingly unusable as a developer...)

Yelles avatar Sep 02 '25 20:09 Yelles

same issue. I have a feeling this is related somehow to utilization. I've upped my usage in the recent weeks, hitting multiple opus limits and noticed that "turns" got a lot slower during higher utilization times. I am pretty sure that is somehow Antropic combating account sharing issues and whatever other usage policy vilolations might be there.

romanathappymoney avatar Sep 09 '25 20:09 romanathappymoney

I'm getting 401 errors daily since the upgrade to the new claude code. I previously didn't have to reauth after my very first authentication when setting claude code up.

Running Sequoia 15.6.1 (24G90),

VSCode Version: 1.105.0 (Universal) Commit: 03c265b1adee71ac88f833e065f7bb956b60550a Date: 2025-10-08T14:09:35.891Z Electron: 37.6.0 ElectronBuildId: 12502201 Chromium: 138.0.7204.251 Node.js: 22.19.0 V8: 13.8.258.32-electron.0 OS: Darwin arm64 24.6.0

Edited to also add: I've never been close to claude limits as far as I'm aware, I don't think it's that.

whatformat avatar Oct 17 '25 06:10 whatformat

Same issue with Claude vscode plugin, login using pro subscription.

undo-git-pull avatar Oct 21 '25 07:10 undo-git-pull

same issue +1

tmatei avatar Oct 21 '25 22:10 tmatei

I'm having the same issue since I updated to the new Visual Studio Code extension that now shows instead of the terminal. It is the most annoying thing ever... After I write my whole prompt I get the damn API Error: 401 {"type":"error","error":{"type":"authentication_error","message":"OAuth token has expired. Please obtain a new token or refresh your existing token"} · Please run /login

Will this be fixed at some point? Can I go back to the previous VSCode extension?

jvlobo avatar Oct 22 '25 09:10 jvlobo

happen to me, need to /login almost every morning. claude version: 2.0.25 (Claude Code) macos intel: MacBook Pro (Retina, 15-inch, Mid 2015)

yusufmalikul avatar Oct 23 '25 02:10 yusufmalikul

fix this already ...

The problem is that the auth token is only valid for like ~6 hours, maybe a bit more and after it expires the refresh tokens job is to refresh it. But it simply does not do that.

Thats literally what oauth is ment to do and they messed that up somehow.

ViktorTrojan avatar Oct 23 '25 23:10 ViktorTrojan

Same issue, sounds like @ViktorTrojan is onto something, anyone @claude looking at this?

BenHMatrix avatar Oct 25 '25 09:10 BenHMatrix

Experiencing this issue way more recently as well. I have to login every day whereas I used to not. I have a Max subscription, using Claude Code on the latest VSCode extension that has the GUI.

FrenchMajesty avatar Nov 05 '25 11:11 FrenchMajesty

This is happening to me after logging in just 10 minutes ago. It kicked me out, and then suddenly started kicking me out aggressively.

wongjustin99 avatar Nov 15 '25 15:11 wongjustin99

Just noting I started seeing this issue last week. I'm on v2.0.61. I'm using the subscription option to login.

ndurell avatar Dec 08 '25 15:12 ndurell

It's SO annoying having to log in several times each day seemingly once per day per project - flitting between 5-10 repos means I'm doing this workflow 5-10 times per day.

thclark avatar Dec 10 '25 06:12 thclark

it looks like the OAUTH token expires in only about 8 hours or so.

jellefoks avatar Dec 13 '25 04:12 jellefoks