[BUG] MacOS: Failed to start OAuth callback server: Failed to start server. Is port 0 in use?
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Issue Summary:
Persistent "OAuth error: Failed to start OAuth callback server: Failed to start server. Is port 0 in use?" preventing authentication with Claude subscription account.
Environment:
macOS (Macbook Pro M2)
iTerm terminal
Claude Code version 2.0.37
Fresh installation completed
No VPN, firewall disabled, no proxy restrictions
Steps Taken:
Multiple fresh installations and reinstalls
Removed duplicate installations
Ran claude install --force and claude migrate-installer
Cleared authentication: rm -rf ~/.config/claude-code/auth.json
Complete terminal restarts
Complete computer restarts
Verified network connectivity to required endpoints
What Should Happen?
Expected Behavior:
Should successfully authenticate with Claude subscription account (option 1).
Actual Behavior:
OAuth callback server fails to start, preventing any authentication.
OAuth error: Failed to start OAuth callback server: Failed to start server. Is port 0 in use?
<img width="571" height="291" alt="Image" src="https://github.com/user-attachments/assets/ff95f0ac-9e51-4083-b28a-9941994861a1" />
<img width="571" height="254" alt="Image" src="https://github.com/user-attachments/assets/7891f70a-f7c5-4402-8b04-4dd1f4cda15f" />
Error Messages/Logs
OAuth error: Failed to start OAuth callback server: Failed to start server. Is port 0 in use?
When selecting option: 1. Claude account with subscription · Pro, Max, Team, or Enterprise
Steps to Reproduce
- $ claude
- Let's get started.
Choose the text style that looks best with your terminal
To change this later, run /theme
❯ 1. Dark mode ✔ <- select
- Claude Code can be used with your Claude subscription or billed based on API usage through your
Console account.
Select login method:
❯ 1. Claude account with subscription · Pro, Max, Team, or Enterprise <- select
Claude Model
None
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.0.37
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
iTerm2
Additional Information
_No response_
This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗