.claude/skills/cleanup/SKILL.md
Kill orphaned Claude Code processes, remove old versions, and report memory/disk usage. Use when the system feels slow or after crashes.
npx skillsauth add JLighter/dotfiles cleanupInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Kill orphaned Claude Code processes (bun workers, subagents, MCP servers) and remove old binary versions.
Survey orphaned processes before cleanup:
echo "=== Orphaned bun workers (PPID=1) ===" && \
ps -eo pid,ppid,tty,rss,command | grep 'worker-service\.cjs.*--daemon' | grep -v grep | awk '$2 == 1' && \
echo "=== Detached claude subagents ===" && \
ps -eo pid,ppid,tty,rss,command | grep 'claude.*--output-format.*stream-json' | grep -v grep | awk '$3 == "??"' && \
echo "=== Detached MCP servers ===" && \
ps -eo pid,ppid,tty,rss,command | grep 'node.*mcp-server' | grep -v grep | awk '$3 == "??"' && \
echo "=== Memory summary ===" && \
ps -eo rss,command | grep -E '(worker-service|claude.*stream-json|node.*mcp-server)' | grep -v grep | awk '{sum += $1} END {printf "Total RSS: %.0f MB\n", sum/1024}' && \
echo "=== Old Claude versions ===" && \
CURRENT=$(claude --version 2>/dev/null | awk '{print $1}') && \
for f in ~/.local/share/claude/versions/*; do \
v=$(basename "$f"); size=$(du -sh "$f" | awk '{print $1}'); \
if [ "$v" = "$CURRENT" ]; then echo " $v ($size) [CURRENT]"; else echo " $v ($size) [OLD - will remove]"; fi; \
done
Show the user what was found and how much memory it's using.
Ask the user for confirmation before killing anything.
Run cleanup:
~/.claude/hooks/cleanup-processes.sh
Report results:
echo "=== Cleanup log ===" && tail -5 ~/.claude/logs/cleanup.log
Show current memory after cleanup:
ps -eo rss,command | grep -E '(worker-service|claude.*stream-json|node.*mcp-server)' | grep -v grep | awk '{sum += $1} END {printf "Remaining RSS: %.0f MB\n", sum/1024}'
development
Launch UX review (visual hierarchy, interaction, user flow). Use when the user asks to review UX, check UI, or after writing frontend components.
development
Deep security audit of the codebase. Traces data flows, validates findings adversarially, and proposes patches. Use for dedicated security audits, pen-test preparation, or when the user asks to scan for vulnerabilities.
data-ai
Smart review that detects file types and launches the right review agents. Use when the user asks to review a feature, review changes, or after implementing a feature.
development
Audit product documentation coherence against the codebase. Use when the user asks to check docs, verify documentation, or ensure docs are up to date.