CLI cannot connect to Chrome extension: socket bridge never established

Resolved 💬 3 comments Opened Apr 16, 2026 by svpjeff Closed Apr 19, 2026

Environment

  • Claude Code: v2.1.110
  • macOS: Darwin 24.6.0
  • Chrome: Google Chrome (not a variant)
  • Extension: fcoeoabgfenejglbffodgkkbkcdhcgfn v1.0.68
  • Chrome Profile: Profile 3 (non-Default)

Problem

mcp__claude-in-chrome__tabs_context_mcp always returns "Browser extension is not connected" even though the native messaging host is running and the Unix socket is created successfully.

Investigation Details

What works

  • /chrome shows Status: Enabled, Extension: Installed
  • Chrome extension spawns the native messaging host correctly
  • Native host creates a Unix socket at /tmp/claude-mcp-browser-bridge-<user>/<pid>.sock
  • The native host responds to pings when tested manually

What doesn't work

  • Neither claude nor claude --chrome connects to the socket. Verified via lsof -U — only the native host PID is bound to the socket; no CLI process ever connects as a client.
  • A fresh session started with claude --chrome has the same issue — not a stale session problem.

Complication: Desktop app native host takes priority

The Chrome extension's service worker tries two native messaging hosts in order:

  1. com.anthropic.claude_browser_extension → Claude Desktop app
  2. com.anthropic.claude_code_browser_extension → Claude Code CLI

When Claude Desktop is installed, the extension connects to the Desktop host first, so the CLI host is never called. We disabled the Desktop host file to force fallback to the CLI host — the CLI's native host then runs successfully, but the CLI still never connects to the socket.

Native messaging host files

  • com.anthropic.claude_browser_extension.json/Applications/Claude.app/Contents/Helpers/chrome-native-host (Desktop)
  • com.anthropic.claude_code_browser_extension.json~/.claude/chrome/chrome-native-host (CLI)

Additional issue

  • Selecting "Reconnect extension" from /chrome menu crashes/closes the Chrome window every time.

Expected Behavior

The CLI session should discover and connect to the Unix socket created by the native host in /tmp/claude-mcp-browser-bridge-<user>/, enabling browser automation tools.

Steps to Reproduce

  1. Have both Claude Desktop and Claude Code CLI installed
  2. Install Claude in Chrome extension
  3. Run claude --chrome
  4. Open Chrome, click the Claude extension icon
  5. Call any mcp__claude-in-chrome__* tool → "Browser extension is not connected"
  6. Verify native host is running: ps aux | grep chrome-native-host
  7. Verify socket exists: ls /tmp/claude-mcp-browser-bridge-$USER/
  8. Verify no CLI connection: lsof -U | grep claude-mcp-browser shows only the native host, not the CLI

View original on GitHub ↗

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