claude-code - 💡(How to fix) Fix CLI can't connect to extension while Claude Desktop on same machine can [1 comments, 2 participants]

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…
GitHub stats
anthropics/claude-code#50820Fetched 2026-04-20 12:12:09
View on GitHub
Comments
1
Participants
2
Timeline
8
Reactions
0
Timeline (top)
labeled ×6commented ×1cross-referenced ×1

claude --chrome in a terminal session fails to connect to the Claude browser extension. Every mcp__claude-in-chrome__* tool call returns:

Browser extension is not connected. Please ensure the Claude browser extension is installed and running…

The same extension, same Chrome, same macOS user works fine when driven from Claude Desktop. So the extension, native messaging host, and manifest are all healthy — the CLI is the only thing that can't pair.

Root Cause

claude --chrome in a terminal session fails to connect to the Claude browser extension. Every mcp__claude-in-chrome__* tool call returns:

Browser extension is not connected. Please ensure the Claude browser extension is installed and running…

The same extension, same Chrome, same macOS user works fine when driven from Claude Desktop. So the extension, native messaging host, and manifest are all healthy — the CLI is the only thing that can't pair.

RAW_BUFFERClick to expand / collapse

Summary

claude --chrome in a terminal session fails to connect to the Claude browser extension. Every mcp__claude-in-chrome__* tool call returns:

Browser extension is not connected. Please ensure the Claude browser extension is installed and running…

The same extension, same Chrome, same macOS user works fine when driven from Claude Desktop. So the extension, native messaging host, and manifest are all healthy — the CLI is the only thing that can't pair.

Environment

  • macOS 15 (Darwin 25.4.0), Apple Silicon
  • Claude Code CLI: 2.1.114 (at /Users/<user>/.local/share/claude/versions/2.1.114)
  • Google Chrome: 147.0.7727.57, single Default profile
  • Claude extension: id fcoeoabgfenejglbffodgkkbkcdhcgfn, v1.0.68
  • /chrome menu reports: Status Enabled, Extension Installed

Reproduction

  1. Launch Chrome. Extension auto-connects to its native host on startup.
  2. In a fresh terminal: claude --chrome.
  3. In the session, invoke any mcp__claude-in-chrome__* tool (e.g. tabs_context_mcp).
  4. Tool returns "Browser extension is not connected".
  5. In parallel, launch Claude Desktop and drive the same extension from there — it works.

Also reproduced with claude --dangerously-skip-permissions --chrome and with claude --chrome alone.

What I verified on the machine

  • Native messaging manifest is registered and points at a valid wrapper: ~/Library/Application Support/Google/Chrome/NativeMessagingHosts/com.anthropic.claude_code_browser_extension.json → path: /Users//.claude/chrome/chrome-native-host → allowed_origins: chrome-extension://fcoeoabgfenejglbffodgkkbkcdhcgfn/
  • Wrapper is executable and exec's /Users/<user>/.local/share/claude/versions/2.1.114 --chrome-native-host.
  • The native host process is running as a child of Chrome (ps shows … 2.1.114 --chrome-native-host, PPID = Chrome PID).
  • It has a listening Unix socket: /tmp/claude-mcp-browser-bridge-<user>/<native-host-pid>.sock (mode srw-------).
  • lsof -p <cli-pid> on the CLI process shows no fd connected to that socket dir — the CLI never opens the bridge.
  • Chrome extension's service-worker DevTools console is empty during the failing MCP calls — the extension receives nothing from the CLI.
  • Timing: native host was spawned ~1s after Chrome started, before the CLI launched. A stale "Claude Desktop" manifest com.anthropic.claude_browser_extension.json.disabled exists alongside, but its host name differs, so it shouldn't be in the way.
  • Restarting Chrome, restarting the CLI, and "Reconnect extension" from the /chrome menu did not change behavior.

Expected

CLI session pairs with the running native host and tabs_context_mcp returns tab information, same as when Claude Desktop drives the extension.

Actual

CLI never connects to the bridge socket; extension service worker sees no messages; MCP tools report "Browser extension is not connected".

Notes / hypotheses

Looks like a CLI-side pairing/discovery bug: the native host and socket are up, but the CLI doesn't register with the extension or connect to the existing socket. Could be related to the host being spawned on Chrome startup (before any CLI exists) and the CLI not adopting it afterwards.

Happy to collect additional logs — is there a DEBUG=… or verbose flag that would surface the CLI-side handshake attempt?

extent analysis

TL;DR

The issue is likely due to the CLI failing to connect to the existing native host socket, and a potential workaround is to investigate the CLI's socket connection logic.

Guidance

  • Verify the native host socket path and permissions to ensure the CLI has access to it.
  • Check the CLI's logging or debugging options (e.g., DEBUG flag) to surface the handshake attempt and identify potential issues.
  • Investigate the CLI's socket connection logic to see if it's correctly adopting the existing native host socket spawned by Chrome.
  • Consider adding logging or debugging statements to the CLI code to understand its behavior when attempting to connect to the native host.

Example

No code snippet is provided as it's not clearly supported by the issue, but investigating the CLI's socket connection logic could involve checking the code responsible for establishing the connection to the native host socket.

Notes

The issue seems to be specific to the CLI and its interaction with the native host socket. The fact that the extension works with Claude Desktop suggests that the issue is not with the extension or the native host itself. Further investigation into the CLI's behavior and logging is necessary to identify the root cause.

Recommendation

Apply workaround: Investigate the CLI's socket connection logic and logging to understand its behavior and identify potential issues, as the root cause is likely related to the CLI's failure to connect to the existing native host socket.

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