claude-code - 💡(How to fix) Fix Windows username with space breaks claude-in-chrome native host pipe naming

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…

Fix Action

Fix / Workaround

Diagnostic findings:

  • Native host attempts to create pipe at \.\pipe\claude-mcp-browser-bridge-<username>
  • Node's net.listen rejects the pipe path due to the space, throwing TypeError ERR_INVALID_ARG_TYPE
  • Manual workaround: edit ~/.claude/chrome/chrome-native-host.bat to set USERNAME=NoSpaceVersion before launching claude.exe --chrome-native-host
  • Workaround fixes the host side, but Claude Code's MCP server (claude --chrome) constructs the pipe path independently using os.userInfo() rather than $env:USERNAME, so it still tries to connect to the original (broken) name. Bridge remains broken end-to-end.
RAW_BUFFERClick to expand / collapse

Environment:

  • OS: Windows 11 (x64)
  • Claude Code: [run claude --version and paste here]
  • Username: contains a space (e.g. "Casper Marsman")

Reproduction:

  1. Use Claude Code on a Windows account whose username contains a space
  2. Run claude --chrome and try to use any claude-in-chrome MCP tool
  3. Bridge fails with "Browser extension is not connected"

Diagnostic findings:

  • Native host attempts to create pipe at \.\pipe\claude-mcp-browser-bridge-<username>
  • Node's net.listen rejects the pipe path due to the space, throwing TypeError ERR_INVALID_ARG_TYPE
  • Manual workaround: edit ~/.claude/chrome/chrome-native-host.bat to set USERNAME=NoSpaceVersion before launching claude.exe --chrome-native-host
  • Workaround fixes the host side, but Claude Code's MCP server (claude --chrome) constructs the pipe path independently using os.userInfo() rather than $env:USERNAME, so it still tries to connect to the original (broken) name. Bridge remains broken end-to-end.

Suggested fix: sanitize the username when constructing the pipe path (replace spaces, or use a hash, or the SID), applied consistently on both the native host and MCP server sides.

Logs available on request.

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