Claude in Chrome: native host spawns but Claude Code CLI never attaches to bridge socket — "Browser extension is not connected" (macOS 26.2 + Chrome 148)
Summary
On macOS 26.2 with Chrome 148, the Claude in Chrome extension is installed, enabled, and active, but Claude Code consistently reports "Browser extension is not connected." Claude Desktop's browser integration works fine with the same extension on the same machine.
After extensive debugging, the extension does successfully spawn Claude Code's native messaging host and the host creates a listening socket — but no Claude Code CLI session ever attaches to that socket, including a freshly launched claude --chrome session. Everything that is configurable (native host manifest, claude.ai account, Chrome profile, host binary) is correct; the failure is in the native-messaging bridge handshake itself.
Environment
- OS: macOS 26.2 (build 25C56, Darwin 25.x), Apple Silicon
- Chrome: 148.0.7778.216
- Claude Code: 2.1.160
- Node: v24.12.0
- Claude in Chrome extension: 1.0.74 (installed/enabled in Chrome "Profile 1", which is the active/last-used profile)
- Extension ID:
fcoeoabgfenejglbffodgkkbkcdhcgfn - Both Claude Desktop and Claude Code installed
- claude.ai account on the extension matches the account Claude Code is authenticated with (verified)
What works
- Native host manifest present and valid:
~/Library/Application Support/Google/Chrome/NativeMessagingHosts/com.anthropic.claude_code_browser_extension.json→~/.claude/chrome/chrome-native-host(executable) - The extension does trigger Chrome to spawn the native host. Verified process:
…/versions/2.1.160 --chrome-native-host, a child of the Chrome process, with live stdio pipes to Chrome (FDs 0/1) — i.e. the extension ↔ native host link is up - The native host creates a listening Unix socket:
/tmp/claude-mcp-browser-bridge-<user>/<host-pid>.sock(0600) - Claude Desktop's browser integration works correctly with the same extension
What doesn't work
- Any
mcp__claude-in-chrome__*tool /list_connected_browsers→ "Browser extension is not connected." lsofon the bridge socket shows only the native host holding it — no CLI client ever connects, even when actively invoking browser tools or running/chromein a--chromesession. Native hosts spawn and later die with no CLI ever attaching./chrome→ "select browser" throws:Couldn't list connected browsers: JSON Parse error: Unexpected identifier "Browser"— the CLI appears toJSON.parse()the plain-text"Browser extension is not connected…"error string (secondary error-handling bug).
Steps to reproduce
- Install both Claude Desktop and Claude Code on macOS 26.2 / Chrome 148.
- Install the Claude in Chrome extension (v1.0.74), signed into the same claude.ai account as Claude Code.
- Run
claude --chrome(or/chrome→ Reconnect). - Any browser tool returns "Browser extension is not connected."
Diagnostics / evidence
- Native host PPID = Chrome's PID; stdio pipes to Chrome present → extension↔host bridge is established.
- Listening socket
<host-pid>.sockcreated in/tmp/claude-mcp-browser-bridge-<user>/. lsof <socket>→ only the native host (2.1.160 … FD 6u unix …), never a CLI client.- Confirmed same claude.ai account on both sides.
- Confirmed extension is installed/enabled in the active Chrome profile (Profile 1 of 4).
Things tried (none resolved it)
- Applied the #20887 workaround: repointed the Desktop manifest (
com.anthropic.claude_browser_extension)path→ Claude Code's native host binary. Result: the extension then spawned Claude Code's native host (confirmed), socket created — but still no CLI attach. /chrome→ "Reconnect extension" multiple times.- Toggled the extension off/on in
chrome://extensions. - Fully quit & reopened Chrome multiple times.
- Reduced to a single Claude Code session (single-session limit, ref #26120) and retried.
- Killed stale native host processes and deleted the bridge socket dir for a clean slate, then reconnected.
- Launched a fresh
claude --chromesession from scratch — still "not connected."
Conclusion
Everything configurable is verified correct, and the extension↔native-host link is confirmed up. The break is specifically that the Claude Code CLI never connects to the native host's bridge socket, so the handshake never completes. This matches a cluster of unresolved reports on macOS 26 + recent Chrome: #31971 (macOS 26 + Chrome 145), #46658 (Chrome 147), #20663 (macOS 26.2). Filing fresh per the auto-close note on those.
Two concrete asks:
- Fix the bridge handshake (CLI not attaching to the native host socket) on macOS 26 / Chrome 148.
- Handle the non-JSON "not connected" response in
/chrome→ select browser so it doesn't throwJSON Parse error: Unexpected identifier "Browser".
4 Comments
**Update: resolved — and it turned out not to be a version regression.**
It's now working, including on 2.1.160 (the exact version that was failing in the report above) — so the binary/version was not the cause.
What fixed it: re-authenticating the Claude Code session (sign out, sign back in). After that the extension connected immediately, and the native-host bridge handshake that previously never completed now succeeds.
In hindsight the canonical error was hinting at this the whole time — "…ensure you are logged into claude.ai with the same account as Claude Code." The account was already correct; the problem appears to have been a stale/invalid CLI auth token, not a wrong account. Refreshing the credentials let the handshake complete.
Honest caveat on attribution: around the same time I also did a forced clean reinstall (
claude install --force) and a full restart of both the CLI and Chrome, so I can't isolate re-auth as the sole cause with 100% certainty. But it's the most likely decisive step, since the same version + config + binary failed before it and worked after.Two notes for maintainers:
/chrome→ select-browserJSON Parse error: Unexpected identifier "Browser"noted above still stands as a separate minor bug (the CLIJSON.parse()-ing the plain-text error string).Posting in case it helps anyone else who lands here. 🙏
Thank you! That was the only thing I didn't try, and it worked
Confirming this fix worked for me too (macOS, Claude Code CLI + Claude in Chrome extension).
Same symptom: extension installed, correct account logged in, native-messaging host spawned and listening on the bridge socket, but the CLI session's
tabs_context_mcpalways returned "Browser extension is not connected." I had already tried disabling the Desktop app's native-host manifest, full Chrome restarts, re-verifying the account, fresh CLI sessions, and even uninstalling/reinstalling the extension — none of it helped (this was tracked in a duplicate report, #75434, closed in favor of #73903).What actually fixed it:
claude auth logoutfollowed byclaude auth login(re-authenticating the CLI itself, not the extension or the Google account). Ran it in a separate terminal to avoid killing the active session, then immediately re-testedtabs_context_mcpin the still-running Claude Code session — it connected on the first try.So +1 to the stale/invalid CLI auth token diagnosis. Agree with the suggestion above that a clearer error message here (pointing at CLI re-auth) would save a lot of people a native-messaging rabbit hole, since the generic "Browser extension is not connected" strongly implies the problem is on the extension side.
+1, same failure mode — additional data point on the native host lifecycle and cloud bridge
Environment:
fcoeoabgfenejglbffodgkkbkcdhcgfn)Confirms the same core finding: native host manifest, binary, and extension ID all check out, and the host process comes up and listens correctly, but the CLI never seems to hold a stable connection to it.
Two additional things I traced that might narrow this down further:
1. Native host log shows repeated short-lived sessions, not a single stable one:
This repeats over and over, with gaps ranging from ~1 second to ~30 minutes between host restarts. This looks consistent with Chrome's Manifest V3 service worker idle-suspend behavior tearing down the native messaging port whenever the extension's service worker goes inactive — i.e. the host isn't crashing, it's being told to shut down because Chrome killed the connection on its end.
2. The extension's cloud relay is healthy and unrelated to the failure. Inspecting the extension's own service worker DevTools (
chrome://extensions→ "service worker"), the WebSocket towss://bridge.claudeusercontent.com/chrome/<user-id>establishes with101 Switching Protocols, stays open, and receives regular{"type":"pong"}heartbeats. So the extension↔cloud pairing is fine — the break is entirely local, between the extension's service worker and the native host process.Given both this thread's finding (CLI never attaches to the socket) and mine (the local native port keeps getting torn down by what looks like MV3 suspend behavior), my guess is these are two symptoms of the same underlying issue: if the port only exists in short-lived windows, a CLI session started or polling outside that window would never find it live to attach to — matching "socket exists, but no CLI client ever holds it."
Happy to share full native host logs if useful.