Skip to content

[Bug] Claude Desktop native messaging host intercepts Chrome extension connection, blocking Claude Code integration #20341

@darkneo29

Description

@darkneo29

Description

When both Claude Desktop app and Claude Code are installed on macOS, the Chrome extension fails to connect to Claude Code with the error: "Browser extension is not connected."

Root Cause

Both Claude Desktop and Claude Code register native messaging host configurations in ~/Library/Application Support/Google/Chrome/NativeMessagingHosts/ with the same allowed_origins extension IDs. The Claude Desktop config (com.anthropic.claude_browser_extension.json) takes precedence, causing the Chrome extension to connect to Claude Desktop's native host instead of Claude Code's.

Environment

  • OS: macOS (Darwin 25.2.0)
  • Claude Code Version: 2.1.17
  • Chrome Extension ID: fcoeoabgfenejglbffodgkkbkcdhcgfn

Steps to Reproduce

  1. Have both Claude Desktop app and Claude Code installed
  2. Install the Claude Chrome extension
  3. Run claude --chrome
  4. Try to use any Chrome integration tool
  5. Error: "Browser extension is not connected"

Workaround

Replace the Claude Desktop native host config to point to Claude Code:

# Backup the Claude Desktop config
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

# Create new config pointing to Claude Code
cat > ~/Library/Application\ Support/Google/Chrome/NativeMessagingHosts/com.anthropic.claude_browser_extension.json << 'EOF'
{
  "name": "com.anthropic.claude_browser_extension",
  "description": "Claude Browser Extension Native Host",
  "path": "/Users/USERNAME/.claude/chrome/chrome-native-host",
  "type": "stdio",
  "allowed_origins": [
    "chrome-extension://dihbgbndebgnbjfmelmegjepbnkhlgni/",
    "chrome-extension://fcoeoabgfenejglbffodgkkbkcdhcgfn/",
    "chrome-extension://dngcpimnedloihjnnfngkgjoidhnaolf/"
  ]
}
EOF

# Restart Chrome

Expected Behavior

Claude Code and Claude Desktop should be able to coexist without conflicting native messaging host registrations. Possible solutions:

  • Use different native messaging host names for each application
  • Add a mechanism to switch between Claude Desktop and Claude Code connections
  • Detect the conflict and provide a clear error message with resolution steps

Additional Context

The /chrome reconnect option opens Chrome briefly then closes without properly installing the native messaging host when this conflict exists.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:toolsbugSomething isn't workinghas reproHas detailed reproduction stepsplatform:macosIssue specifically occurs on macOSstaleIssue is inactive

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions