From system-check
Detect and clean up stray processes spawned by Claude Code sessions (orphaned node, playwright, chromium, tmux panes, background shells)
How this skill is triggered — by the user, by Claude, or both
Slash command
/system-check:cleanup-claude-procsThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Find and clean up processes left behind by prior Claude Code sessions — orphaned `node`/`claude` CLIs, headless browsers from Playwright MCP, lingering tmux panes from `omc-teams`, and background shells started via `run_in_background` whose parent has exited.
Find and clean up processes left behind by prior Claude Code sessions — orphaned node/claude CLIs, headless browsers from Playwright MCP, lingering tmux panes from omc-teams, and background shells started via run_in_background whose parent has exited.
Capture the PID tree of THIS running Claude instance so we never kill ourselves:
SELF_PID=$$
SELF_PPID=$(ps -o ppid= -p $$ | tr -d ' ')
# Walk up to find the claude process anchoring this session
SELF_TREE=$(pstree -p $SELF_PPID 2>/dev/null | grep -oE '\([0-9]+\)' | tr -d '()' | sort -u)
echo "Protected PIDs: $SELF_PID $SELF_PPID $SELF_TREE"
Gather candidates across these categories. Use ps -eo pid,ppid,etimes,user,command and filter.
Claude CLI / node orphans
ps -eo pid,ppid,etimes,command | awk '
/claude-code|claude --|\.claude\/|@anthropic-ai\/claude-code/ && $2 == 1 {print}
'
Playwright / headless Chromium from MCP
ps -eo pid,ppid,etimes,command | grep -E 'playwright|chrome.*--headless|chromium.*--remote-debugging' | grep -v grep
OMC background shells / tmux panes
tmux list-sessions 2>/dev/null | grep -E 'omc-|claude-' || true
ps -eo pid,ppid,etimes,command | grep -E '\.omc/|omc-teams|ralph|ultrawork' | grep -v grep
Orphaned run_in_background shells (ppid=1, long etime, bash/sh)
ps -eo pid,ppid,etimes,command | awk '$2 == 1 && $3 > 300 && /\/bin\/(ba)?sh/ {print}'
Orphaned long-running CLI tails/follows owned by the user (ppid=1)
Anything that Claude kicked off via run_in_background (log tails, watch, jobs --watch, gh run watch, amplify ... --watch, kubectl logs -f, etc.) can outlive its parent shell and end up as a PPID=1 orphan. These are easy to miss because they're not node/chromium.
ps -eo pid,ppid,etimes,user,command | awk -v u="$USER" '
$2 == 1 && $3 > 300 && $4 == u &&
/aws logs tail|--follow|tail -[fF]|watch |gh run watch|kubectl .*-f|amplify .*--watch|docker logs -f/ {print}
'
Remove any PID in the current session's tree from the candidate list.
Show a table: PID | PPID | Age | Category | Command (truncated). Example:
PID PPID AGE CATEGORY COMMAND
12345 1 2h14m claude-orphan node /home/user/.nvm/.../claude-code
12892 1 47m playwright chromium --headless --remote-debugging-port=...
13044 1 3h01m bg-shell /bin/bash -c 'npm run test:e2e'
If list is empty: report "No stray Claude-spawned processes found." and exit.
Unless --yes was passed, ask: "Kill these N processes? (yes/no/select)"
yes → kill allno → exitselect → prompt per PIDUnless --dry-run (then print what would be killed and exit).
for PID in $TARGETS; do
kill -TERM "$PID" 2>/dev/null
done
sleep 2
for PID in $TARGETS; do
if kill -0 "$PID" 2>/dev/null; then
kill -KILL "$PID" 2>/dev/null
echo "SIGKILL: $PID"
else
echo "SIGTERM ok: $PID"
fi
done
tmux list-sessions 2>/dev/null | awk -F: '/^omc-|^claude-/ {print $1}' | while read s; do
tmux kill-session -t "$s" && echo "Killed tmux session: $s"
done
✓ Terminated 3 processes (2 TERM, 1 KILL)
✓ Closed 1 tmux session (omc-team-abc123)
SELF_TREE first.yes or --yes flag for actual kills.pstree is unavailable, fall back to walking /proc/<pid>/status PPid chain./oh-my-claudecode:cleanup-claude-procs
/oh-my-claudecode:cleanup-claude-procs --dry-run
/oh-my-claudecode:cleanup-claude-procs --yes
pgrep -af claude-code | grep -v $$ and warn the user.npx claudepluginhub artificiallysocial/marketplace --plugin system-checkProvides behavioral guidelines to reduce common LLM coding mistakes, focusing on simplicity, surgical changes, assumption surfacing, and verifiable success criteria.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.