Windows username with space breaks claude-in-chrome native host pipe naming

Resolved 💬 2 comments Opened May 8, 2026 by caspermarsman-ctrl Closed Jun 6, 2026

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.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗