You'll notice
OAuth login's local callback port picking is now configurable and adds a last-resort random free port
What
When Claude Code logs in via OAuth, it opens a temporary local web server to receive the login callback and needs a free network port for it. The function that picks this port now takes a configurable range and fallback port instead of hardcoded values.
- If no port in the configured range is free, and the fallback port is also taken, Claude Code now tries one more thing: asking the operating system to hand it any free port, before giving up.
Why
This makes OAuth login more resilient on machines where the usual port range or fallback port is already in use, reducing login failures due to port conflicts.