Claude in Chrome: Extension connects to Claude.app native host instead of Claude Code

Resolved 💬 4 comments Opened Jan 25, 2026 by chrismlittle123 Closed Feb 28, 2026

Bug Description

When both Claude.app (desktop app) and Claude Code are installed, the Chrome extension always connects to Claude.app's native messaging host instead of Claude Code's, even when Claude Code initiates the browser automation.

Root Cause Analysis

After investigation, I found the root cause in the extension's service worker (service-worker.ts-qgEiMtH4.js):

const s=[
  {name:"com.anthropic.claude_browser_extension",label:"Desktop"},
  {name:"com.anthropic.claude_code_browser_extension",label:"Claude Code"}
];
for(const n of s) try {
  const a=chrome.runtime.connectNative(n.name);
  // ... ping test ...
  // If successful, keeps this connection and breaks loop
}

The extension tries native hosts in a hardcoded order:

  1. com.anthropic.claude_browser_extension (Claude.app) - first priority
  2. com.anthropic.claude_code_browser_extension (Claude Code) - second priority

If Claude.app's native host responds to the ping, it's used and Claude Code's host is never tried.

Environment

  • Claude Code version: 2.1.15
  • Chrome Extension version: 1.0.40
  • OS: macOS Darwin 25.2.0
  • Browser: Google Chrome

Steps to Reproduce

  1. Have both Claude.app and Claude Code installed
  2. Run Claude Code with --chrome flag
  3. Try to use browser automation tools (e.g., tabs_context_mcp)
  4. Observe that Claude.app's native host (/Applications/Claude.app/Contents/Helpers/chrome-native-host) is invoked instead of Claude Code's (~/.claude/chrome/chrome-native-host)

Evidence

Running ps aux | grep chrome-native-host shows:

/Applications/Claude.app/Contents/Helpers/chrome-native-host chrome-extension://fcoeoabgfenejglbffodgkkbkcdhcgfn/

Claude Code's native host is never invoked, so the socket file for MCP communication is never created.

Workaround Attempted

Renaming Claude.app's manifest:

mv "~/Library/Application Support/Google/Chrome/NativeMessagingHosts/com.anthropic.claude_browser_extension.json" \
   "~/Library/Application Support/Google/Chrome/NativeMessagingHosts/com.anthropic.claude_browser_extension.json.backup"

This doesn't fully resolve the issue as Chrome may need to be restarted, and it breaks Claude.app's browser integration.

Suggested Fix

The extension should:

  1. Allow users to choose which native host to use in settings, OR
  2. Detect which Claude process (Claude.app or Claude Code) initiated the browser session and connect to the appropriate host, OR
  3. Reverse the priority order (try Claude Code first, then Claude.app), OR
  4. Allow passing a parameter/environment variable to indicate preference

Impact

Users who have both Claude.app and Claude Code installed cannot use Claude Code's browser automation features.

View original on GitHub ↗

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