[BUG] Authentication Key Lost on Claude Code Updates
Environment:
Platform: WSL2 Issue: Frequent reauthorization required
Problem Description: Claude Code frequently requires reauthorization and generation of new API keys, particularly after updates. The existing key appears to be lost during the update process, forcing users to generate new keys and clean up old ones. Impact:
User Experience: Disruptive workflow interruption requiring frequent reauth Organizational Overhead: Multiple developers in organization need to manage key cleanup Analytics Degradation: Messes with Cost Per API Key statistics and tracking Key Management Burden: Accumulation of unused keys requires manual cleanup
Steps to Reproduce:
Authenticate Claude Code with API key Update Claude Code Attempt to use Claude Code Observe authentication failure requiring new key generation
Expected Behavior: Authentication should persist across updates, maintaining the same API key. Actual Behavior: Each update invalidates the existing key, requiring new authentication and key generation. Frequency: Occurs consistently with Claude Code updates on WSL2.
I wonder if this is the same as https://github.com/anthropics/claude-code/issues/1414
Hi! How are you authenticating into Claude Code? Are you using /login, and if so, are you using Max or API? If the latter, which API?
@bcherny I follow the prompts when it asks, which is the oauth flow for API. https://console.anthropic.com/, not using a third party. Most recent update did not cause this, two from other day did.
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.
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.