[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:
```bash
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
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗