[BUG] Windows: `claude auth login` / OAuth browser doesn't open automatically in Git Bash — no fallback to cmd.exe /c start (regression since 2.1.141)

Status Open
Reported on v2.1.139
Maintainer reply None cached
Activity 0 comments · opened Aug 24, 2026

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?

On Windows, claude auth login (and any other OAuth flow driven by the CLI, e.g. /mcp authentication) does not open the default browser automatically when running from a Git Bash (MSYS2/MINGW64) shell. The command prints the login URL and device code, and the user has to copy-paste them by hand.

This used to work — the browser opened automatically in earlier versions. It broke as a regression starting with v2.1.141 (auto-update, 2026-05-14): the browser-open logic changed and, in a Git Bash session where BROWSER and DISPLAY are unset, there is no fallback to cmd.exe /c start anymore. The equivalent issue for MCP auth in the same environment (#59194) documents the same regression and root cause, but was auto-closed as stale/"not planned" without a fix; the underlying claude auth login case (not just MCP) is still broken.

What Should Happen?

On Windows, when BROWSER is unset and there's no DISPLAY (i.e. a normal Git Bash session, not X11), the CLI should fall back to cmd.exe /c start "" <url> (or an equivalent native Windows browser-open call), the same way it apparently did before v2.1.141, instead of silently doing nothing and leaving the user to copy-paste the URL by hand.

Error Messages/Logs

No error is printed — the CLI prints the OAuth URL and device code as normal and waits for the code, it just never spawns a browser process. Confirmed via Task Manager: no new browser process appears after running `claude auth login`.

Steps to Reproduce

  1. On Windows, open Git Bash (MINGW64) — the default shell bundled with Git for Windows.
  2. Do not set a BROWSER environment variable.
  3. Run claude auth login.
  4. Expected: the default browser (Chrome, correctly registered as the Windows default handler for http/https on this machine) opens automatically to the OAuth URL.
  5. Actual: nothing opens. The CLI prints the URL and code and waits; the user has to copy the URL into a browser by hand and then copy the resulting code back into the terminal.
  6. Workaround that restores the old behavior: add { "env": { "BROWSER": "cmd.exe /c start \"\"" } } to ~/.claude/settings.json, as documented in the comments on #59194. This should not be necessary — it worked with zero configuration before v2.1.141.

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

2.1.139

Claude Code Version

2.1.237 (Claude Code)

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Other

Additional Information

This is the claude auth login / general OAuth-CLI-flow instance of the exact regression described in #59194 ("OAuth browser does not open for HTTP MCP servers on Windows"), which was auto-closed as stale/"not planned" in June without a fix. Filing separately since #59194 is closed and the underlying regression (no cmd.exe fallback since 2.1.141 in a Git-Bash/no-DISPLAY environment) is still present for at least the claude auth login flow, not just MCP auth. Also closed/related: #44350 (dup), #30902 (dup).

Workaround for anyone hitting this in the meantime: ~/.claude/settings.json{ "env": { "BROWSER": "cmd.exe /c start \"\"" } } (the empty quotes after start are required — that's the window-title argument start expects). Would be good if this became the default behavior on Windows again rather than something every affected user has to independently discover and configure by hand.

View original on GitHub ↗