| name | claude-in-chrome-troubleshooting |
| description | Diagnoses macOS Claude in Chrome MCP native-host conflicts between Claude.app (Cowork) and Claude Code CLI sockets. Use when mcp__claude-in-chrome__* tools fail, return Browser extension is not connected, or behave erratically after updates. Not for Linux or Windows hosts, general Chrome automation, Claude.app desktop bugs, network outages, or Chrome Web Store install issues. |
| version | 1.0.1 |
| risk | critical |
| source | community |
When to Use
mcp__claude-in-chrome__* tools fail with "Browser extension is not connected"
- Browser automation works erratically or times out
- After updating Claude Code or Claude.app
- When switching between Claude Code CLI and Claude.app (Cowork)
- Native host process is running but MCP tools still fail
When NOT to use:
- Linux or Windows users — this skill covers macOS-specific paths and tools (
~/Library/Application Support/, osascript, $TMPDIR)
- General Chrome automation issues unrelated to the Claude extension
- Claude.app desktop issues (not browser-related)
- Network connectivity problems
- Chrome extension installation issues (use Chrome Web Store support)
Prerequisites
- macOS host (this skill is macOS-only; paths and commands use
osascript, getconf DARWIN_USER_TEMP_DIR, and ~/Library/Application Support/)
- Google Chrome installed
- Claude in Chrome extension installed from the Chrome Web Store
- Claude Code CLI and/or Claude.app installed
- Shell access (bash/zsh)
Procedure
Step 1: Identify the Primary Conflict
Claude.app (Cowork) and Claude Code CLI each register a competing native messaging host in Chrome. They use incompatible socket formats and locations. Only one can be active at a time.
| Component | Native Host Binary | Socket Location |
|---|
| Claude.app (Cowork) | /Applications/Claude.app/Contents/Helpers/chrome-native-host | /tmp/claude-mcp-browser-bridge-$USER/<PID>.sock |
| Claude Code CLI | ~/.local/share/claude/versions/<version> --chrome-native-host | $TMPDIR/claude-mcp-browser-bridge-$USER (single file) |
Both register native messaging configs in Chrome:
com.anthropic.claude_browser_extension.json → Claude.app helper
com.anthropic.claude_code_browser_extension.json → Claude Code wrapper
If the wrong config is active, the wrong binary runs, creating sockets in a format/location the MCP client doesn't expect. Result: "Browser extension is not connected" even though everything appears to be running.
Step 2: Run Quick Diagnosis
ps aux | grep chrome-native-host | grep -v grep
ls -la "$(getconf DARWIN_USER_TEMP_DIR)/claude-mcp-browser-bridge-$USER" 2>&1
ls -la /tmp/claude-mcp-browser-bridge-$USER/ 2>&1
lsof -U 2>&1 | grep claude-mcp-browser-bridge
ls ~/Library/Application\ Support/Google/Chrome/NativeMessagingHosts/com.anthropic*.json
Step 3: Disable the Conflicting Native Host
If you use Claude Code CLI for browser automation (not Cowork):
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.disabled
cat ~/Library/Application\ Support/Google/Chrome/NativeMessagingHosts/com.anthropic.claude_code_browser_extension.json
If you use Cowork (Claude.app) for browser automation:
mv ~/Library/Application\ Support/Google/Chrome/NativeMessagingHosts/com.anthropic.claude_code_browser_extension.json \
~/Library/Application\ Support/Google/Chrome/NativeMessagingHosts/com.anthropic.claude_code_browser_extension.json.disabled
You cannot use both simultaneously. Pick one and disable the other.
Step 4: Toggle Script (Optional)
Add this to ~/.zshrc or run directly:
chrome-mcp-toggle() {
local CONFIG_DIR=~/Library/Application\ Support/Google/Chrome/NativeMessagingHosts
local CLAUDE_APP="$CONFIG_DIR/com.anthropic.claude_browser_extension.json"
local CLAUDE_CODE="$CONFIG_DIR/com.anthropic.claude_code_browser_extension.json"
if [[ -f "$CLAUDE_APP" && ! -f "$CLAUDE_APP.disabled" ]]; then
mv "$CLAUDE_APP" "$CLAUDE_APP.disabled"
[[ -f "$CLAUDE_CODE.disabled" ]] && mv "$CLAUDE_CODE.disabled" "$CLAUDE_CODE"
echo "Switched to Claude Code CLI"
echo "Restart Chrome and Claude Code to apply"
elif [[ -f "$CLAUDE_CODE" && ! -f "$CLAUDE_CODE.disabled" ]]; then
mv "$CLAUDE_CODE" "$CLAUDE_CODE.disabled"
[[ -f "$CLAUDE_APP.disabled" ]] && mv "$CLAUDE_APP.disabled"
-la /com.anthropic*.json* 2>/dev/null
}
Usage: chrome-mcp-toggle then restart Chrome (and Claude Code if switching to CLI).
Step 5: Full Reset Procedure (Claude Code CLI)
If quick fixes don't work, perform a full reset:
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.disabled 2>/dev/null
cat > ~/.claude/chrome/chrome-native-host << 'EOF'
LATEST=$(ls -t ~/.local/share/claude/versions/ 2>/dev/null | head -1)
exec "$HOME/.local/share/claude/versions/$LATEST" --chrome-native-host
EOF
chmod +x ~/.claude/chrome/chrome-native-host
pkill -f chrome-native-host
rm -rf /tmp/claude-mcp-browser-bridge-$USER/
rm -f "$(getconf DARWIN_USER_TEMP_DIR)/claude-mcp-browser-bridge-$USER"
osascript -e 'quit app "Google Chrome"' && sleep 2 && open -a "Google Chrome"
ps aux | grep chrome-native-host | grep -v grep
ls -la "$(getconf DARWIN_USER_TEMP_DIR)/claude-mcp-browser-bridge-$USER"
Step 6: Diagnostic Deep Dive
If the above steps don't resolve the issue, run the full diagnostic:
echo "=== Native Host Binary ==="
ps aux | grep chrome-native-host | grep -v grep
echo -e "\n=== Socket (Claude Code location) ==="
ls -la "$(getconf DARWIN_USER_TEMP_DIR)/claude-mcp-browser-bridge-$USER" 2>&1
echo -e "\n=== Socket (Claude.app location) ==="
ls -la /tmp/claude-mcp-browser-bridge-$USER/ 2>&1
echo -e "\n=== Native Host Open Files ==="
pgrep -f chrome-native-host | xargs -I {} lsof -p {} 2>/dev/null | grep -E "(sock|claude-mcp)"
echo -e "\n=== Active Native Messaging Configs ==="
ls ~/Library/Application\ Support/Google/Chrome/NativeMessagingHosts/com.anthropic*.json 2>/dev/null
echo -e "\n=== Custom Wrapper Contents ==="
cat ~/.claude/chrome/chrome-native-host 2>/dev/null || echo "No custom wrapper"
echo -e "\n=== TMPDIR ==="
echo "TMPDIR=$TMPDIR"
echo "Expected: $(getconf DARWIN_USER_TEMP_DIR)"
Pitfalls
-
MCP connects at startup only. If the browser bridge wasn't ready when Claude Code started, the connection will fail for the entire session. The fix is: ensure Chrome + extension are running with correct config, THEN restart Claude Code. Do not skip the Claude Code restart.
-
Multiple Chrome Profiles. If the Claude extension is installed in multiple Chrome profiles, each spawns its own native host and socket, causing confusion. Fix: Only enable the Claude extension in ONE Chrome profile.
-
Multiple Claude Code Sessions. Running multiple Claude Code instances causes socket conflicts. Fix: Only run one Claude Code session at a time, or use /mcp to reconnect after closing other sessions.
-
Hardcoded Version in Wrapper. The wrapper at ~/.claude/chrome/chrome-native-host may have a hardcoded version that becomes stale after updates.
cat ~/.claude/chrome/chrome-native-host
Fix: Use the dynamic version wrapper shown in the Full Reset Procedure (Step 5).
-
TMPDIR Not Set. Claude Code expects TMPDIR to be set to find the socket.
echo $TMPDIR
export TMPDIR="${TMPDIR:-$(getconf DARWIN_USER_TEMP_DIR)}"
-
Cannot use both hosts simultaneously. Claude.app (Cowork) and Claude Code CLI native hosts are mutually exclusive. You must disable one for the other to work.
Verification
After applying fixes, verify the connection is working:
ps aux | grep chrome-native-host | grep -v grep
ls -la "$(getconf DARWIN_USER_TEMP_DIR)/claude-mcp-browser-bridge-$USER"
ls ~/Library/Application\ Support/Google/Chrome/NativeMessagingHosts/com.anthropic*.json
echo $TMPDIR
File Reference
| File | Purpose |
|---|
~/.claude/chrome/chrome-native-host | Custom wrapper script for Claude Code |
/Applications/Claude.app/Contents/Helpers/chrome-native-host | Claude.app (Cowork) native host |
~/.local/share/claude/versions/<version> | Claude Code binary (run with --chrome-native-host) |
~/Library/Application Support/Google/Chrome/NativeMessagingHosts/com.anthropic.claude_browser_extension.json | Config for Claude.app native host |
~/Library/Application Support/Google/Chrome/NativeMessagingHosts/com.anthropic.claude_code_browser_extension.json | Config for Claude Code native host |
$TMPDIR/claude-mcp-browser-bridge-$USER | Socket file (Claude Code) |
/tmp/claude-mcp-browser-bridge-$USER/<PID>.sock | Socket files (Claude.app) |
Related Skills
- Any skill that uses
mcp__claude-in-chrome__* tools for browser automation may trigger this troubleshooting skill when those tools fail.
Original skill by @jeffzwang from @ExaAILabs. Enhanced and updated for current versions of Claude Desktop and Claude Code.