Chrome extension connects to Claude desktop app instead of Claude Code when both native messaging hosts exist
Description
When both the Claude desktop app and Claude Code have native messaging hosts configured, the Chrome extension always connects to the Claude desktop app's native host, making Claude Code's browser automation features unusable.
Environment
- Claude Code version: 2.1.12
- Chrome extension version: 1.0.47
- OS: macOS (Darwin 24.6.0)
- Chrome: Latest stable
Steps to Reproduce
- Have Claude desktop app installed (creates
com.anthropic.claude_browser_extension.json) - Enable Chrome integration in Claude Code via
claude --chrome(createscom.anthropic.claude_code_browser_extension.json) - Restart Chrome to pick up native messaging host configs
- Try to use browser automation in Claude Code
Expected Behavior
Claude Code's browser automation tools should connect to the Chrome extension successfully.
Actual Behavior
The Chrome extension connects to the Claude desktop app's native host instead of Claude Code's, resulting in:
Browser extension is not connected. Please ensure the Claude browser extension is installed and running...
Both native messaging host configs allow the same extension ID (fcoeoabgfenejglbffodgkkbkcdhcgfn):
Claude desktop app (com.anthropic.claude_browser_extension.json):
{
"name": "com.anthropic.claude_browser_extension",
"path": "/Applications/Claude.app/Contents/Helpers/chrome-native-host",
"allowed_origins": ["chrome-extension://fcoeoabgfenejglbffodgkkbkcdhcgfn/", ...]
}
Claude Code (com.anthropic.claude_code_browser_extension.json):
{
"name": "com.anthropic.claude_code_browser_extension",
"path": "/Users/<user>/.claude/chrome/chrome-native-host",
"allowed_origins": ["chrome-extension://fcoeoabgfenejglbffodgkkbkcdhcgfn/"]
}
Running ps aux | grep chrome-native-host shows the desktop app's host is spawned:
/Applications/Claude.app/Contents/Helpers/chrome-native-host chrome-extension://fcoeoabgfenejglbffodgkkbkcdhcgfn/
Workaround
Temporarily rename or remove the Claude desktop app's native messaging host 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.bak
Then disable/re-enable the Chrome extension to force a reconnection to Claude Code's native host.
Suggested Fix
Consider one of these approaches:
- Have the Chrome extension provide a way to select which native host to connect to
- Use different extension IDs for Claude desktop vs Claude Code browser integration
- Add detection logic to avoid conflicts when both are installed
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗