Authentication Failure After Login in v1.0.68 at ssh remote
Bug Description
Title: Bug: Login fails on fresh install of @anthropic-ai/claude-code
v1.0.68
Description:
After a fresh installation of @anthropic-ai/claude-code version 1.0.68 via
npm, the user is unable to complete the login process. The initial
authentication flow fails, preventing any use of the CLI tool. This issue
seems to be present in recent versions, as noted in community discussions.
Affected Version:
1.0.68
Steps to Reproduce:
- Install claude-code v1.0.68: npm install -g @anthropic-ai/claude-code@1.0.68
- Run claude login command
- Observe "build something great" success message
- Attempt to use any claude command (e.g., claude "Hello")
- Receive error: "Invalid API key · Please run /login"
- Repeated login attempts show same behavior
Expected Behavior:
After successful login with "build something great" message, the API key
should be properly stored and subsequent commands should execute without
authentication errors.
Actual Behavior:
Despite showing successful login message, all commands fail with "Invalid
API key" error, requiring repeated (unsuccessful) login attempts.
Workaround:
Downgrading to version 1.0.67 resolves the issue:
npm uninstall -g @anthropic-ai/claude-code
npm install -g @anthropic-ai/claude-code@1.0.67
Environment(remote machine):
- Node.js version: v20.18.1
- npm version: 10.8.2
- Operating System: macOS 15.4.1
- Shell: /bin/zsh
Additional Information:
- Issue appears to be a regression introduced in v1.0.68
- v1.0.67 works correctly with the same API key and environment
- No changes to system configuration or API key between version tests
- Clearing npm cache and reinstalling did not resolve the issue
Impact:
This bug prevents all new users installing the latest version from using
Claude Code, significantly impacting the onboarding experience.
Environment Info
- Platform: darwin
- Terminal: ssh-session
- Version: 1.0.68
- Feedback ID: 530cb681-f159-4a1c-8979-a864ea7b0b9a
38 Comments
Same problem
Same.
Max user.
Received:
Invalid API key · Please run /login1.0.67 workaround confirmed working:
same issue, workaround above confirmed working.
same issue but downgrading does not fix
Hi all, are you saying that downgrading without doing anything else (logging in again) fixed the issue? Did you get logged out when you were previously logged in, or was this on a fresh install?
Same issue but downgrading also did not fix.
edit - After some time, i was able to re-auth on the downgraded version. Not sure what changed otherwise
edit 2 - The problem returned 8/5/25 22:10 PST
Downgrading the version did work for me. Although the 'Missing API key · Run /login' message still appears, Claude Code is working correctly again and no longer gives me the error I had before. In other words, the API key message persists, but it doesn't prevent the tool from functioning.
Also having this issue with 1.0.69 over ssh, no issues with token on local machine. Downgrading isn’t working.
Actually having issues even doing a full uninstall…
Again same issue, 1.0.68 auto updating to 69. Turned off auto update and downgraded and logged in and it's working again but the message " Missing API key · Run /login" persists but the tool is working again.
How do you turn off auto update?
slash config and auto update is an option, set it to false
Downgrading to 1.0.67 worked for me too
Also ran into this, but downgrading addressed the issue for me.
Same issue here, only seems to happen over SSH/MOSH. I've seen it happen here and there when logged in remotely in the past, but this time I can't get the auto to settle in. I am using the $200 Max plan and I have an API key in my ENV but I have Claude set to ignore it.
Same issue here. Uninstalling the VS Code extension for Claude Code, setting /config auto-update to False, downgrading to 1.0.67 and then logging in again has given me access to Claude Code again, but I still see the error message "Missing API key · Run /login" despite being authenticated with claude.ai using my max plan login...
Same issue here (remote SSH, macOS). Downgrading did not work, but as a temporary workaround I installed the binary beta version:
https://docs.anthropic.com/en/docs/claude-code/setup#native-binary-installation-beta
Seems to work for now...
same problem, but the downgrade doesn't fix it for me.
Downgrade worked for me.
If your claude is the "local install" version (you've run
claude migrate-installer), you need to perform the npm downgrade in~/.claude/localwithout the-gparameter, otherwise it will not work.Mine's installed globally, and the downgrade didn't work for me. No change. Just my luck.
Edit:
for no reason I can explain, running the uninstall and install of the downgraded version a second time worked.
Mine is installed natively, downgrading did not work for me...
Still Missing API key · Run /login
Running
twice in succession worked for me (or at least it's currently working)
... and now it's not working, tried with and without tmux
same issue here
https://github.com/anthropics/claude-code/issues/1222#issuecomment-3013457571 this comment fixed auth issue on 1.0.69.
it happened to me when it was auto upgraded. Working fine then following upgrade it prompted to login and kept asking even after clicking authorize or pasting code. Downgrading worked for me for now.
I'm not sure this is the entire issue as this is a new problem in last 3 days whereas the linked comment seems to be from a while ago.
Hint
tmuxDDDD
This did end up being tmux on my end. Logged out and logged back in outside of tmux and the problem is gone. As long as I keep from launching claude in tmux, the problem seems to be resolved.
I am using 1.0.71 inside tmux. I have that problem recently as well. But tmux is crucial for my workflow so I need to do the following:
Having this problem too with SSH and mosh, on both NPM and Native versions of CC. On the Mac (M1 Ultra) itself it works properly, but connecting via SSH and running CC always says invalid API token. Downgrading, local vs native etc doesn't seem to solve it. Up until a few days ago it was working perfectly!
This issue is still happening I'm noticing it happens every day maybe 24 hours? The way I fix it is:
This resolves the problem temporarily for at least 24 hours.
With SSH and mosh too.
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
Downgrade to version 1.0.60 for it to work !
npm install -g @anthropic-ai/claude-code@1.0.60
Login, it will create required login key
And then upgrade to latest version by npm install -g @anthropic-ai/claude-code
Same issue here.
Fantastic work Anthropics. Do you test your code a bit before release? or AI writes it and you publish it without any testing? Code quality is abysmal nowadays. this is EXTREMELY simple issue which can also be easily detected during testing.
This worked only https://github.com/anthropics/claude-code/issues/1222#issuecomment-3164503563
Downgrade to 1.0.67 solved the problem for me. I still see Missing API key message, but claude accepts commands. Claude runs under tmux on MacOS Mini M4 silicon. I log into that machine remotely over ssh.
login through terminal and refresh each conversation or reopen! Thanks for coming to my TedTalk
For my case, remove old node brew version Claude Code dir and VS-Code Extension (not only vs code but also vs code-server) and extensions logs.
This may happen by upgrading node brew version(v18.18.0 -> over v20 for install latest) without uninstall.
My work around is bellow. (This may minimum but RISK is not evaluated)
I hope this make little help to veteran Claude Code user.
Build something great!!!
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.