/chrome "Select Browser" fails with `JSON Parse error: Unexpected identifier "Browser"` — extension launches native host but immediately drops (EOF), never registers as connected
Summary
Running /chrome → Select Browser in the Claude Code CLI fails with:
Couldn't list connected browsers: JSON Parse error: Unexpected identifier "Browser"
Investigation shows two distinct bugs:
- UI bug —
list_connected_browsersreturns the plain-text stringBrowser extension is not connected…, and the "Select Browser" flow feeds that string toJSON.parse(), which throwsUnexpected identifier "Browser". The user should see the real message, not a JSON parse error. - Connection bug (root cause) — the Chrome extension launches the native messaging host but immediately drops the connection (
Chrome disconnected (EOF received)), so no browser ever registers as connected.
Environment
- macOS (Darwin 25.5.0). Default browser is Arc; Chrome is secondary and used directly (not relevant to the failure).
- Claude Code CLI 2.1.173 (
~/.local/share/claude/versions/2.1.173). - Chrome latest; "Claude in Chrome" extension
fcoeoabgfenejglbffodgkkbkcdhcgfn(verified via a clean uninstall/reinstall). - Native-host component reports version 0.1.0.
- Both Claude Desktop and Claude Code CLI are installed.
Evidence the plumbing is correct
- Chrome launches the CLI native host:
PID … = ~/.local/share/claude/versions/2.1.173 --chrome-native-host, with Google Chrome as the parent process. - The host creates and listens on
/tmp/claude-mcp-browser-bridge-<user>/<pid>.sock. - The native messaging manifest
com.anthropic.claude_code_browser_extension.jsonlists the installed extension id inallowed_origins. - The running CLI session and the launched host are the same install (2.1.173) — there is no version split between client and host.
- The extension is signed into claude.ai with the same account as the CLI.
Evidence of the failure
The native-host log repeatedly shows, within seconds of each other:
[INFO chrome-native-host] Chrome native host starting (version 0.1.0)
[INFO chrome-native-host] Socket server listening for connections
[INFO chrome-native-host] Chrome disconnected (EOF received)
[INFO chrome-native-host] Shutting down chrome native host
The extension connects to the host, then immediately disconnects (EOF), so no browser is ever registered. Both list_connected_browsers and switch_browser return Browser extension is not connected… instantly (switch_browser does not push a Connect prompt or wait). This was reproduced on both the Desktop native host (com.anthropic.claude_browser_extension) and the CLI native host (com.anthropic.claude_code_browser_extension), which points to an extension-side handshake drop rather than a host- or config-specific issue.
Things tried that did NOT help
- Quit Claude Desktop completely.
- Full Chrome restart (
Cmd+Q) — multiple times. - Re-verified the extension is logged into claude.ai with the same account as the CLI.
- Temporarily disabled the Desktop native-messaging manifest to force the extension onto the CLI host (the extension does fall back and the CLI host launches — but it still EOF-drops).
- Clean uninstall + reinstall of the "Claude in Chrome" extension.
- Restarted the Claude Code CLI session.
Expected
list_connected_browsers lists the connected Chrome instance, and /chrome → Select Browser lets me pick it.
Actual
Extension launches the native host then immediately disconnects (EOF); no browser registers; the CLI surfaces a misleading JSON Parse error: Unexpected identifier "Browser" because it JSON-parses a plain-text error string.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗