claude-in-chrome-troubleshooting – Agents & Automation skill for AI agents
Diagnose and fix Claude in Chrome MCP extension connectivity issues. Use when mcp__claude-in-chrome__* tools fail, return "Browser extension is not connected", or behave erratically.
Install the claude-in-chrome-troubleshooting skill with one command
Pick the tool you use, copy the command and paste it in your terminal. The skill lands in that tool's skills folder and is ready in your next session.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/claude-in-chrome-troubleshooting-6db9b.tgz | tar xz -C ~/.claude/skills
Call it in Claude Code: /claude-in-chrome-troubleshooting – then describe the task you want done.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/claude-in-chrome-troubleshooting-6db9b.tgz | tar xz -C ~/.codex/skills
Call it in Codex: $claude-in-chrome-troubleshooting – then describe the task you want done.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/claude-in-chrome-troubleshooting-6db9b.tgz | tar xz -C ~/.hermes/skills
Call it in Hermes Agent: /claude-in-chrome-troubleshooting – then describe the task you want done.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/claude-in-chrome-troubleshooting-6db9b.tgz | tar xz -C ~/.deepcode/skills
Call it in DeepSeek: /claude-in-chrome-troubleshooting – then describe the task you want done.
SKILL.md content
Claude in Chrome MCP Troubleshooting
Use this skill when Claude in Chrome MCP tools fail to connect or work unreliably.
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) - 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)
The Claude.app vs Claude Code Conflict (Primary Issue)
Background: When Claude.app added Cowork support (browser automation from the desktop app), it introduced a competing native messaging host that conflicts with Claude Code CLI.
Two Native Hosts, Two Socket Formats
| 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) |
Why They Conflict
1. Both register native messaging configs in Chrome:
com.anthropic.claude_browser_extension.json→ Claude.app helpercom.anthropic.claude_code_browser_extension.json→ Claude Code wrapper
2. Chrome extension requests a native host by name
3. If the wrong config is active, the wrong binary runs
4. The wrong binary creates sockets in a format/location the MCP client doesn't expect
5. Result: "Browser extension is not connected" even though everything appears to be running
The Fix: Disable Claude.app's Native Host
If you use Claude Code CLI for browser automation (not Cowork):
# Disable the Claude.app native messaging 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.disabled
# Ensure the Claude Code config exists and points to the wrapper
cat ~/Library/Application\ Support/Google/Chrome/NativeMessagingHosts/com.anthropic.claude_code_browser_extension.jsonIf you use Cowork (Claude.app) for browser automation:
# Disable the Claude Code native messaging config
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.disabledThese paths and coexistence failures are historical observations, not a universal current-version restriction. Confirm the active host, versions and profile first; use supported reconnect/repair before changing registrations.
Toggle Script
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
# Currently using Claude.app, switch to Claude Code
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
# Currently using Claude Code, switch to Claude.app
mv "$CLAUDE_CODE" "$CLAUDE_CODE.disabled"
[[ -f "$CLAUDE_APP.disabled" ]] && mv "$CLAUDE_APP.disabled" "$CLAUDE_APP"
echo "Switched to Claude.app (Cowork)"
echo "Restart Chrome to apply"
else
echo "Current state unclear. Check configs:"
ls -la "$CONFIG_DIR"/com.anthropic*.json* 2>/dev/null
fi
}Usage: chrome-mcp-toggle then restart Chrome (and Claude Code if switching to CLI).
Treat the toggle as an optional local workaround only after confirming the conflict. Back up registrations and refuse destination collisions before any move; the script below is illustrative and does not implement those checks. Closing Chrome can interrupt unrelated work: preserve tabs/forms and obtain authorization before restarting. Diagnostic process arguments/configuration may contain private paths or values; redact before sharing. Do not install the toggle in shell startup without an explicit request.
Quick Diagnosis
# 1. Which native host binary is running?
ps aux | grep chrome-native-host | grep -v grep
# Claude.app: /Applications/Claude.app/Contents/Helpers/chrome-native-host
# Claude Code: ~/.local/share/claude/versions/X.X.X --chrome-native-host
# 2. Where is the socket?
# For Claude Code (single file in TMPDIR):
ls -la "$(getconf DARWIN_USER_TEMP_DIR)/claude-mcp-browser-bridge-$USER" 2>&1
# For Claude.app (directory with PID files):
ls -la /tmp/claude-mcp-browser-bridge-$USER/ 2>&1
# 3. What's the native host connected to?
lsof -U 2>&1 | grep claude-mcp-browser-bridge
# 4. Which configs are active?
ls ~/Library/Application\ Support/Google/Chrome/NativeMessagingHosts/com.anthropic*.jsonCritical Insight
MCP connects at startup. If the browser bridge wasn't ready when Claude Code started, the connection will fail for the entire session. The fix is usually: ensure Chrome + extension are running with correct config, THEN restart Claude Code.
Full Reset Procedure (Claude Code CLI)
# 1. Ensure correct config is active
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
# 2. Preserve existing wrapper/configuration and use the installed client's supported repair.
# Do not select an executable by directory modification time or overwrite a working wrapper.
# 3. Inspect exact host PID and socket ownership/path first.
# Stop only the confirmed process for the affected session, with approval.
# Remove only its confirmed stale socket after exit; do not recursively delete bridge directories.
# 4. Restart Chrome
osascript -e 'quit app "Google Chrome"' && sleep 2 && open -a "Google Chrome"
# 5. Wait for Chrome, click Claude extension icon
# 6. Verify correct native host is running
ps aux | grep chrome-native-host | grep -v grep
# Should show: ~/.local/share/claude/versions/X.X.X --chrome-native-host
# 7. Verify socket exists
ls -la "$(getconf DARWIN_USER_TEMP_DIR)/claude-mcp-browser-bridge-$USER"
# 8. Restart Claude CodeOther Common Causes
Multiple Chrome Profiles
If you have the Claude extension installed in multiple Chrome profiles, each spawns its own native host and socket. This can cause confusion.
Fix: Only enable the Claude extension in ONE Chrome profile.
Multiple Claude Code Sessions
Running multiple Claude Code instances can cause 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.
Diagnosis:
cat ~/.claude/chrome/chrome-native-host
# Bad: exec "/Users/.../.local/share/claude/versions/2.0.76" --chrome-native-host
# Verify the target is the intended installed version; modification time is not version ordering.Fix: Use supported client repair to regenerate the wrapper; preserve a backup and verify the intended executable before changing it.
TMPDIR Not Set
Claude Code expects TMPDIR to be set to find the socket.
# Check
echo $TMPDIR
# Should show: /var/folders/XX/.../T/
# Fix: Add to ~/.zshrc
export TMPDIR="${TMPDIR:-$(getconf DARWIN_USER_TEMP_DIR)}"Diagnostic Deep Dive
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\… (full content is in the download package)
Related skills
- clickup-automation – Automate ClickUp project management including tasks, spaces, folders, lists, comments…
- close-automation – Automate Close CRM tasks via Rube MCP (Composio): create leads, manage calls/SMS, handle…
- interview – Phase 1 of building a Claude Managed Agent — interview the founder about the one job the…
- pylabrobot – Develops and reviews PyLabRobot lab-automation resources, liquid-handling plans, offline…
- cmux – Control cmux workspaces, panes, surfaces, and agent sessions safely from macOS terminal…
- coda-automation – Automate Coda tasks via Rube MCP (Composio): manage docs, pages, tables, rows, formulas…
- codex-fable5 – Apply Fable-inspired discipline to Codex work: inspect first, track goals and findings…
- codex-subagent – Launch Codex CLI as an isolated subagent for bounded coding, review, or verification…