[BUG] Claude Code Login Authentication Not Persisting for Subscriber Users on remote SSH in MAC

Resolved 💬 4 comments Opened Aug 6, 2025 by achank89 Closed Aug 6, 2025

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

  1. Run claude command to start Claude Code
  2. Execute /login command
  3. Browser authentication completes successfully
  4. Terminal shows "Login successful" message
  5. Immediately after, Claude Code shows "Missing API key · Run /login" error
  6. /status command shows Auth Token: none despite 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*

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

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

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

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

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗