Authentication Failure After Login in v1.0.68 at ssh remote

Resolved 💬 38 comments Opened Aug 5, 2025 by Nozium Closed Nov 14, 2025
💡 Likely answer: A maintainer (ashwin-ant, collaborator) responded on this thread — see the highlighted reply below.

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:

  1. Install claude-code v1.0.68: npm install -g @anthropic-ai/claude-code@1.0.68
  2. Run claude login command
  3. Observe "build something great" success message
  4. Attempt to use any claude command (e.g., claude "Hello")
  5. Receive error: "Invalid API key · Please run /login"
  6. 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

View original on GitHub ↗

38 Comments

eternnoir · 11 months ago

Same problem

sleepdefic1t · 11 months ago

Same.

Max user.
Received: Invalid API key · Please run /login

1.0.67 workaround confirmed working:

npm uninstall -g @anthropic-ai/claude-code
npm install -g @anthropic-ai/claude-code@1.0.67
gemglobalventures · 11 months ago

same issue, workaround above confirmed working.

austinbv · 11 months ago

same issue but downgrading does not fix

ashwin-ant collaborator · 11 months ago

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?

HyperNerd · 11 months ago

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

vmsebas · 11 months ago

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.

twocolddogs · 11 months ago

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…

gemglobalventures · 11 months ago

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.

subasically · 11 months ago

How do you turn off auto update?

gemglobalventures · 11 months ago

slash config and auto update is an option, set it to false

twocolddogs · 11 months ago

Downgrading to 1.0.67 worked for me too

tlockney · 11 months ago

Also ran into this, but downgrading addressed the issue for me.

ctaloi · 11 months ago

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.

mkuppe360 · 11 months ago

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...

arthurcluet · 11 months ago

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...

greggh · 11 months ago

same problem, but the downgrade doesn't fix it for me.

SierraJC · 11 months ago

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/local without the -g parameter, otherwise it will not work.

greggh · 11 months ago
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/local without the -g parameter, 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.

timyal · 11 months ago

Mine is installed natively, downgrading did not work for me...
Still Missing API key · Run /login

JohnPlummer · 11 months ago

Running

npm uninstall -g @anthropic-ai/claude-code
npm install -g @anthropic-ai/claude-code@1.0.67

twice in succession worked for me (or at least it's currently working)

... and now it's not working, tried with and without tmux

digallardox · 11 months ago

same issue here

eternnoir · 11 months ago
gemglobalventures · 11 months ago
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?

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.

twocolddogs · 11 months ago
#1222 (comment) this comment fixed auth issue on 1.0.69.

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.

kitsudog · 11 months ago

Hint

tmux

DDDD

wisegorilla · 11 months ago
Hint tmux DDDD

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.

quanhua92 · 11 months ago
> Hint > tmux > DDDD 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:

  1. Run security unlock-keychain and enter password
security unlock-keychain ~/Library/Keychains/login.keychain-db
  1. run claude and /login again.
  2. Continue to use as usual. Work across tmux window
seanmozeik · 11 months ago

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!

titofebus · 11 months ago

This issue is still happening I'm noticing it happens every day maybe 24 hours? The way I fix it is:

  1. Uninstall Claude Code
  2. Install 1.00.67
  3. LogIn
  4. /Exit
  5. Open Claude Code

This resolves the problem temporarily for at least 24 hours.

With SSH and mosh too.

github-actions[bot] · 11 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/5369
  2. https://github.com/anthropics/claude-code/issues/5244
  3. https://github.com/anthropics/claude-code/issues/5225

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

vinit21 · 11 months ago

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

0xElessar · 11 months ago

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.

abbbe · 8 months ago

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.

IISuperluminaLII · 8 months ago

login through terminal and refresh each conversation or reopen! Thanks for coming to my TedTalk

Nozium · 8 months ago

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.

  1. uninstall currant claude code
# uninstall current node brew Claude Code
npm uninstall -g @anthropics/claude-code

# rm native install Claude
rm -rf ~/.local/bin/claude
rm -rf ~/.local/share/claude/ 
  1. check remains
find ~ -name "*claude*" 2>/dev/null 
  1. if you find old nodebrew Claude Code in your PC. uninstall and remove it.
# find old-node brew
/Users/hogehoge/.nodebrew/node/v18.18.0/bin/claude
/Users/hogehoge/.nodebrew/node/v18.18.0/lib/node_modules/@anthropic-ai/claude-code
/Users/hogehoge/.nodebrew/node/v18.18.0/lib/node_modules/@anthropic-ai/claude-code/vendor/claude-code-jetbrains-plugin
/Users/hogehoge/.nodebrew/node/v18.18.0/lib/node_modules/@anthropic-ai/claude-code/vendor/claude-code-jetbrains-plugin/lib/claude-code-jetbrains-plugin-0.1.11-beta-searchableOptions.jar
/Users/hogehoge/.nodebrew/node/v18.18.0/lib/node_modules/@anthropic-ai/claude-code/vendor/claude-code-jetbrains-plugin/lib/claude-code-jetbrains-plugin-0.1.11-beta.jar
/Users/hogehoge/.nodebrew/node/v18.18.0/lib/node_modules/@anthropic-ai/claude-code/vendor/claude-code.vsix

# list up node brew version 
nodebrew list
nodebrew use v18.18.0
npm list -g --depth=0

# uninstall from old version nodebrew
npm uninstall -g @anthropics/claude-code

# remove nodebrew dir, if remains
rm -rf /Users/hogehoge/.nodebrew/node/v18.18.0/bin/claude
rm -rf /Users/hogehoge/.nodebrew/node/v18.18.0/lib/node_modules/@anthropic-ai/claude-code
  1. if you find vscode and vscode-server extension
# uninstall extensions from vscode and vscode server in vscode interface via GUI

# remove vscode extension
rm -rf  /Users/hogehoge/.vscode/extensions/anthropic.claude-code-2.0.37-darwin-x64

# remove vscode-server extension
rm -rf /Users/hogehoge/.vscode-server/extensions/anthropic.claude-code-2.0.37-darwin-x64
  1. re-install Claude Code
# check your nodebrew version
nodebrew list

# install 
npm install -g @anthropic-ai/claude-code

Build something great!!!

github-actions[bot] · 7 months ago

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.