claude-code - 💡(How to fix) Fix [BUG] claude auth login fails with socket closed unexpectedly after password change [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#53362Fetched 2026-04-26 05:17:44
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Timeline (top)
labeled ×4commented ×1

Error Message

Error: Login failed: The socket connection was closed unexpectedly

Error Messages/Logs

RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

Version: 2.1.119 OS: macOS arm64 (Apple Silicon) Error: Login failed: The socket connection was closed unexpectedly Triggered by: Changed claude.ai password

Network diagnostics all pass:

Telemetry shows tengu_oauth_token_refresh_failure on every startup. Clean reinstall of claude-code does not help. rm -rf ~/.claude and reinstall does not help. Issue persists for 8+ hours.

What Should Happen?

claude auth login should complete successfully and save credentials so Claude Code can connect to the API.

Error Messages/Logs

Steps to Reproduce

  1. Change claude.ai account password (login via gmail).
  2. Run: claude auth login
  3. Browser opens, click Authorize
  4. Browser shows "You're all set up for Claude Code"
  5. Terminal shows: Login failed: The socket connection was closed unexpectedly
  6. Claude Code is completely unusable - every startup shows tengu_oauth_token_refresh_failure

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

No response

Claude Code Version

Claude Code v2.1.119

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

No response

extent analysis

TL;DR

The issue is likely related to the OAuth token refresh mechanism failing after a password change, and a potential workaround involves investigating the tengu_oauth_token_refresh_failure error.

Guidance

  • Investigate the tengu_oauth_token_refresh_failure error to understand why the OAuth token refresh is failing, potentially due to the changed password.
  • Try revoking the existing authorization and re-authorizing Claude Code to obtain a new OAuth token.
  • Check if there are any specific requirements or restrictions for OAuth token refresh after a password change in the Anthropic API documentation.
  • Verify if the issue persists when using a different authorization method or credentials.

Example

No specific code snippet can be provided without more information on the Claude Code implementation, but checking the OAuth token refresh logic and error handling may be a good starting point.

Notes

The issue seems to be related to the interaction between Claude Code and the Anthropic API, specifically with OAuth token refresh after a password change. Without more information on the API documentation or the implementation details of Claude Code, it's difficult to provide a more specific solution.

Recommendation

Apply workaround: Investigate the tengu_oauth_token_refresh_failure error and try revoking the existing authorization to re-obtain an OAuth token, as this may help resolve the issue temporarily until a more permanent fix is available.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [BUG] claude auth login fails with socket closed unexpectedly after password change [1 comments, 2 participants]