/fix-chrome-connection:chrome-devtools-mcp-cleanupfrom MSApps Fix Chrome Connection
Diagnoses and cleans up stale chrome-devtools-mcp processes colliding on a shared Chrome profile directory. Use when state-changing tools error with 'browser already running' while list_pages still works.
Ships in MSApps Fix Chrome Connection. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Different server from Claude-in-Chrome. This is for
chrome-devtools-mcp(DevTools Protocol; toolsnew_page,take_snapshot,navigate_page,evaluate_script,lighthouse_audit). Not the Claude-in-Chrome extension (mcp__Claude_in_Chrome__*). Both can be down independently — see the sibling/fix-chrome-connectionskill for the extension.
list_pages works (read-only) but every state-changing tool errors with:
The browser is already running for /.cache/chrome-devtools-mcp/chrome-profile. Use --isolated to run multiple browser instances.
Root cause: ≥2 concurrent chrome-devtools-mcp@latest parents, each spawning Chromium pinned to the shared profile dir. The Chrome that the current MCP tries to start collides with one started by a stale MCP parent from an earlier session.
The permanent fix is configuration: run chrome-devtools-mcp with --isolated so each session gets its own profile. This skill is the one-time cleanup for hosts where stale parents accumulated before that fix.
Use deliberately — NOT from a scheduled-task runner. Killing processes on a shared Mac is destructive; the user must opt in.
Trigger phrases: "fix chrome-devtools-mcp", "chrome-devtools wedged", "browser is already running for chrome-profile", "stale chrome-devtools parents", "card #223 cleanup".
# 1. List all chrome-devtools-mcp parent processes
ps -eo pid,etime,command | awk '/chrome-devtools-mcp@latest/ && !/awk/'
# 2. List Chromium children spawned by them (pinned to chrome-profile)
ps -eo pid,ppid,etime,command \
| awk '/chrome-devtools-mcp\/chrome-profile/ && !/awk/'
# 3. Show the lock file holder
ls -la ~/.cache/chrome-devtools-mcp/chrome-profile/SingletonLock 2>/dev/null
If only ONE parent shows up: the wedge is unrelated to staleness. Check the server's args with claude mcp get chrome-devtools (this skill does not read ~/.claude.json directly, since it can contain secrets). It should list --isolated. If missing, tell the user to add it themselves (claude mcp remove then claude mcp add ... -- npx chrome-devtools-mcp@latest --isolated) and restart Claude Code.
# Identify orphaned parents — those whose ppid is 1 (init) or whose parent
# is a long-dead Claude session (stat of /proc/<ppid> equivalent on macOS:
# we just check if the ppid resolves to a live `claude` process).
ps -eo pid,ppid,etime,command | awk '/chrome-devtools-mcp@latest/ && !/awk/' \
| while read pid ppid etime cmd; do
parent_alive=$(ps -p "$ppid" -o command= 2>/dev/null | grep -c claude || true)
printf "%s\tppid=%s\tparent_alive=%s\tetime=%s\n" "$pid" "$ppid" "$parent_alive" "$etime"
done
Show the user the PID list and get an explicit OK for each PID before killing it. Identify the parent owned by the current session (its ppid corresponds to your active Claude Code process — pgrep -f "claude.*-l" | head or check the session you're running in). Keep that one; kill the others:
# Pseudocode — REVIEW each PID before running. Replace <ORPHAN_PID> with the
# pid of a parent whose own parent is dead / non-Claude.
kill -TERM <ORPHAN_PID> # graceful
sleep 2
kill -KILL <ORPHAN_PID> 2>/dev/null # if it's still around
# Then sweep their Chromium children:
pkill -f 'chrome-devtools-mcp/chrome-profile' || true
Don't pkill -f chrome-devtools-mcp@latest blindly — that nukes your active session's parent too.
# 1. Only ONE parent should remain (the active session's).
ps -eo pid,ppid,etime,command | awk '/chrome-devtools-mcp@latest/ && !/awk/' | wc -l
# 2. Lock file should be either gone or owned by the surviving parent.
ls -la ~/.cache/chrome-devtools-mcp/chrome-profile/SingletonLock 2>/dev/null
# 3. From your active Claude Code session, smoke-test:
# list_pages → should still work
# new_page("https://example.com") → should succeed without "browser already running"
# take_snapshot → should succeed
Run claude mcp get chrome-devtools and confirm the args include --isolated. With it, each session gets its own Chromium profile directory under a tmp path, so there are no more SingletonLock collisions even with multiple Claude Code windows open.
--isolated is the upstream-blessed flag and is one line of config. Per-PID (--userDataDir /tmp/chrome-devtools-mcp-${PID}) requires shell expansion that claude mcp doesn't do, and accumulates orphan profile dirs that need their own cleanup pass. The --isolated flag handles cleanup automatically when the parent exits.
rm -rf ~/.cache/chrome-devtools-mcp/chrome-profile/ while a session is active — corrupts the running Chromium's state.pkill -f chrome-devtools-mcp@latest blindly — kills your active session's parent too./fix-chrome-connectionWhat SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub msapps-mobile/claude-plugins --plugin fix-chrome-connection3 skills in this plugin
/chrome-health-checkQuickly checks whether the Claude in Chrome MCP connection is working and reports the status. Use when the user says "is chrome connected?", "check chrome", "chrome status", "test chrome connection", "is the chrome extension working?", or any variation of wanting to know if Chrome is reachable before starting browser-based work. Also use proactively before running Chrome automation tasks if there's any doubt the connection is live.
/fix-chrome-connectionUse when: tabs_context_mcp fails, Chrome MCP is broken, user says "fix Chrome", "reconnect Chrome", "Chrome extension not responding", or after switching Claude Desktop accounts. Diagnoses and repairs broken Claude-in-Chrome MCP connections step by step. Local-only: reads Claude Desktop's own log, never reads browser storage or credentials, never pushes anything.
Other plugins' skills for the same job