claude-code - 💡(How to fix) Fix Claude in Chrome extension: hard-coded native-host priority makes CLI unreachable when Claude Desktop is also installed [1 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#51949Fetched 2026-04-23 07:40:37
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Author
Participants
Timeline (top)
labeled ×4

On a machine with both Claude Desktop and the Claude Code CLI installed, the Claude in Chrome extension always bonds to the Desktop native host, so CLI mcp__claude-in-chrome__* tools return "No Chrome extension connected". There is no user-facing way to override this.

Root Cause

Root cause (from bundled code)

Fix Action

Fix / Workaround

Secondary aggravating factor: Claude Desktop's hnr() in app.asar rewrites com.anthropic.claude_browser_extension.json on every launch, unconditionally (no check for existing file or user preference). So manual workarounds that rename/disable the manifest get clobbered.

  1. User setting in the extension options page to pick the preferred host — "Desktop" / "Claude Code" / "Auto".
  2. Invert the default priority when the CLI host is detectable on disk. The CLI install is more recent and opt-in; Desktop is a baseline install for many users.
  3. Document a supported workaround. At minimum, publish whatever Anthropic recommends — don't leave users to reverse-engineer the service worker.

Local workaround (in case others hit this)

Code Example

const s = [
  {name: "com.anthropic.claude_browser_extension",      label: "Desktop"},
  {name: "com.anthropic.claude_code_browser_extension", label: "Claude Code"}
];
for (const a of s) {
  const t = chrome.runtime.connectNative(a.name);
  // send ping; on pong, bond and stop probing
}
RAW_BUFFERClick to expand / collapse

Summary

On a machine with both Claude Desktop and the Claude Code CLI installed, the Claude in Chrome extension always bonds to the Desktop native host, so CLI mcp__claude-in-chrome__* tools return "No Chrome extension connected". There is no user-facing way to override this.

Environment

  • macOS (Darwin 25.4.0)
  • Claude Code CLI 2.1.117
  • Claude Desktop 1.3561.0
  • Claude in Chrome extension 1.0.68 (extension id fcoeoabgfenejglbffodgkkbkcdhcgfn)

Repro

  1. Install Claude Desktop. It writes ~/Library/Application Support/Google/Chrome/NativeMessagingHosts/com.anthropic.claude_browser_extension.json.
  2. Install Claude Code CLI. It writes com.anthropic.claude_code_browser_extension.json alongside.
  3. Start Chrome, let the extension bond.
  4. From the CLI, call any mcp__claude-in-chrome__* tool.

Result: "No Chrome extension connected". Expected: tool succeeds regardless of whether Desktop is also installed.

Root cause (from bundled code)

The extension's service worker hard-codes priority:

const s = [
  {name: "com.anthropic.claude_browser_extension",      label: "Desktop"},
  {name: "com.anthropic.claude_code_browser_extension", label: "Claude Code"}
];
for (const a of s) {
  const t = chrome.runtime.connectNative(a.name);
  // send ping; on pong, bond and stop probing
}

(Lifted from assets/service-worker.ts-Cw4emUEP.js in extension 1.0.68. Desktop is tried first; if it responds, the CLI host is never tried.)

Secondary aggravating factor: Claude Desktop's hnr() in app.asar rewrites com.anthropic.claude_browser_extension.json on every launch, unconditionally (no check for existing file or user preference). So manual workarounds that rename/disable the manifest get clobbered.

What I'd like fixed (preference order)

  1. User setting in the extension options page to pick the preferred host — "Desktop" / "Claude Code" / "Auto".
  2. Invert the default priority when the CLI host is detectable on disk. The CLI install is more recent and opt-in; Desktop is a baseline install for many users.
  3. Document a supported workaround. At minimum, publish whatever Anthropic recommends — don't leave users to reverse-engineer the service worker.

Local workaround (in case others hit this)

I built a small local switch: a dispatcher at the desktop manifest's path and the manifest locked with chflags uchg so Claude Desktop's launch-time rewrite silently fails (the install code swallows the EPERM into a M.debug(...) log — confirmed by observing manifest mtime across a desktop-app restart). The dispatcher reads a mode file to decide whether to exit (fall through to CLI host) or exec the real desktop binary. claude-chrome cli|desktop flips the mode.

Happy to share the scripts if useful — local-only, no reason to publish them in a repo unless the pattern turns out to be the long-term answer.

extent analysis

TL;DR

The issue can be mitigated by implementing a user setting in the extension options page to pick the preferred host or inverting the default priority when the CLI host is detectable on disk.

Guidance

  • The extension's service worker hard-codes priority, trying the Desktop host first, which causes the issue. Consider modifying this behavior to allow user preference or dynamic detection of the CLI host.
  • To verify the issue, check the com.anthropic.claude_browser_extension.json and com.anthropic.claude_code_browser_extension.json files in the ~/Library/Application Support/Google/Chrome/NativeMessagingHosts/ directory to see which host is being used.
  • A temporary workaround could involve manually renaming or disabling the Desktop host manifest, but this may be clobbered by Claude Desktop's launch-time rewrite.
  • Consider documenting a supported workaround, such as the local switch described in the issue, to help users who encounter this issue.

Example

No code snippet is provided as the issue does not require a specific code change, but rather a modification to the extension's behavior or a user-facing setting.

Notes

The issue is specific to the interaction between Claude Desktop, Claude Code CLI, and the Claude in Chrome extension on macOS. The solution may not apply to other environments or versions of the software.

Recommendation

Apply a workaround, such as the local switch described in the issue, until a more permanent solution is implemented. This allows users to manually switch between the Desktop and CLI hosts, providing a temporary fix for the issue.

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