[BUG] Claude Code Login Authentication Not Persisting for Subscriber Users on remote SSH in MAC
Issue Summary
Claude Code successfully completes login flow but immediately shows "Missing API key" error, preventing subscriber users from using the tool. The authentication token is not being persisted after successful login.
Environment
- OS: macOS (Apple Silicon)
- Claude Code Version: v1.0.69
- Node Version: v24.5.0 (via NVM)
- Installation Method: npm global (
@anthropic-ai/claude-code) - User Type: Claude.ai subscriber (not API key user)
Bug Description
- Run
claudecommand to start Claude Code - Execute
/logincommand - Browser authentication completes successfully
- Terminal shows "Login successful" message
- Immediately after, Claude Code shows "Missing API key · Run /login" error
/statuscommand showsAuth Token: nonedespite successful login
Expected Behavior
After successful login, the authentication token should be persisted and the user should be able to use Claude Code without seeing "Missing API key" errors.
Actual Behavior
/login ⎿ Login successful ╭───────────────────────────────────────────────────╮ │ ✻ Welcome to Claude Code! │ │ │ │ /help for help, /status for your current setup │ │ │ │ cwd: /[REDACTED]/mobile-apps/temp │ ╰───────────────────────────────────────────────────╯ ? for shortcuts Missing API key · Run /login
Status Output
Claude Code v1.0.69 L Session ID: [REDACTED] Working Directory L /[REDACTED]/mobile-apps/temp System Diagnostics • /doctor ⚠ Config mismatch: running npm-global but config says npm-global Account L Auth Token: none Model • /model L Default (claude-sonnet-4-20250514)
Steps Taken to Troubleshoot
1. Complete System Cleanup
- Removed all Claude-related directories system-wide:
sudo find / -type d \( -name ".claude" -o -name "claude" -o -name ".anthropic" -o -name ".claude-artifacts" \) -exec rm -rf {} +
Cleared all config directories: bashrm -rf ~/.claude* rm -rf ~/.config/claude* rm -rf ~/.local/share/claude* rm -rf ~/.cache/claude* rm -rf ~/Library/Application\ Support/claude*
- Reinstallation Attempts
Uninstalled and reinstalled via npm: bashnpm uninstall -g @anthropic-ai/claude-code npm install -g @anthropic-ai/claude-code
Attempted installation via Homebrew Cask
- Configuration Attempts
Tried setting install method: claude config set --global installMethod npm-global Attempted to create manual config files in various locations Checked and fixed directory permissions
- Login Method Variations
Standard login: /login Force login: /login --force No-browser login: /login --no-browser Attempted /auth command (but user is subscriber, not API key user)
- Environment Checks
Verified no conflicting environment variables Checked for multiple Claude installations Removed old Node.js versions via NVM Cleared npm cache
Additional Information
The "Config mismatch" warning shows identical values ("running npm-global but config says npm-global") Authentication appears to complete successfully in the browser The issue persists across terminal restarts and system reboots No error messages are shown during the login process
Reproduction Steps
Install Claude Code via npm: npm install -g @anthropic-ai/claude-code Run claude Execute /login Complete browser authentication Observe "Auth Token: none" in /status despite successful login
Found 3 possible duplicate issues:
- https://github.com/anthropics/claude-code/issues/5118
- https://github.com/anthropics/claude-code/issues/5166
- https://github.com/anthropics/claude-code/issues/5167
If your issue is a duplicate, please close it and 👍 the existing issue instead.
This issue will be automatically closed as a duplicate in 3 days if there are no additional comments. To prevent auto-closure, please 👎 this comment.
🤖 Generated with Claude Code
Hey, this is still not working for me
Solution here https://github.com/anthropics/claude-code/issues/1222#issuecomment-3164503563
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.