Claude in Chrome: Native host conflict between Claude Desktop app and Claude Code
Description
When both the Claude Desktop app and Claude Code are installed, the Chrome extension's native messaging fails to connect to Claude Code. This is because both apps register native messaging hosts for the same Chrome extension ID, causing a conflict.
Environment
- OS: macOS
- Claude Code version: 2.1.15
- Chrome extension version: 1.0.40
- Claude Desktop app: Installed
Steps to Reproduce
- Have both Claude Desktop app and Claude Code installed
- Install the Claude in Chrome extension
- Run
claude --chrome - Attempt to use any Chrome tool (e.g., navigate to a URL)
Expected Behavior
Claude Code should be able to control Chrome via the extension.
Actual Behavior
The connection fails with ENOENT errors in the debug logs:
[Claude in Chrome] Socket error: Error: connect ENOENT /var/folders/.../claude-mcp-browser-bridge-username
The error occurs because Claude Code tries to connect to a Unix socket that doesn't exist - the Chrome extension is using the Claude Desktop app's native host instead of Claude Code's native host.
Root Cause
Two native messaging host manifests are registered in ~/Library/Application Support/Google/Chrome/NativeMessagingHosts/:
com.anthropic.claude_browser_extension.json(from Claude Desktop app)
- Points to
/Applications/Claude.app/Contents/Helpers/chrome-native-host - Includes extension ID
fcoeoabgfenejglbffodgkkbkcdhcgfn
com.anthropic.claude_code_browser_extension.json(from Claude Code)
- Points to
~/.claude/chrome/chrome-native-host - Includes extension ID
fcoeoabgfenejglbffodgkkbkcdhcgfn
Both manifests list the same extension ID in allowed_origins, causing the conflict.
Workaround
Renaming or removing the Claude Desktop app's native host config resolves the issue:
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.bak
Then restart Chrome.
Suggested Fix
The two products should either:
- Use different extension IDs for their respective Chrome integrations
- Share a single native host that can route to the appropriate backend
- Implement a mechanism to detect which product is active and use the correct native host
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗