claude-code - 💡(How to fix) Fix [BUG] /login does not auto-open browser in PowerShell/cmd on Windows 11 (works in VS Code integrated terminal)

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

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…
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet (similar but distinct from #60041 which is about ECONNREFUSED on callback after the browser already opened)
  • This is a single bug report
  • I am using the latest version of Claude Code

What's Wrong?

/login (and claude auth login) no longer auto-opens the default browser in standard PowerShell or cmd on Windows 11. Only the OAuth URL is printed; the browser is never launched. The flow falls back to manual paste mode.

Critically, the exact same Claude Code binary in the VS Code integrated terminal opens the browser correctly — so this is not a system-level URL handler problem; it's specific to the CLI's browser-launching path when running outside VS Code.

What Should Happen?

/login should auto-open the default browser (Edge) with the OAuth authorize URL, as it did up until ~last week.

Steps to Reproduce

  1. Open a new PowerShell 7 (or cmd) window — not the VS Code integrated terminal.
  2. Run claude and then /login (or claude auth login).
  3. Observe: only the URL is printed in the terminal. No browser opens.
  4. Open VS Code, run the same claude/login from its integrated terminal.
  5. Observe: Edge opens automatically with the OAuth URL as expected.

Environment Verification (system URL handler is healthy)

  • Default browser registered correctly: HKCU:\...\http\UserChoiceMSEdgeHTM
  • Start-Process "https://example.com" from the same PowerShell session does open Edge correctly.
  • BROWSER env var is unset (also tested with BROWSER=C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe — no change).
  • No proxy / no custom Anthropic env vars.

So the OS-level URL association works; it appears the CLI's spawn of the browser is silently no-op'ing in non-VS-Code shells.

Is this a regression?

Yes — worked normally until approximately one week before this report.

Claude Code Version

2.1.143

Platform

Anthropic API (Claude Max subscription)

Operating System

Windows 11

Terminal/Shell

PowerShell 7 (also reproduces in cmd.exe). Does NOT reproduce in VS Code integrated terminal.

Additional Information

Likely related to the OAuth flow changes around v2.1.126 ("Pasteable OAuth code... when browser callback cannot reach localhost"). Possibly the CLI is now preemptively skipping the browser-open step in certain shell environments, or a regression broke the spawn helper for non-VS-Code shells.

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] /login does not auto-open browser in PowerShell/cmd on Windows 11 (works in VS Code integrated terminal)