← ClaudeAtlas

mac-patrollisted

Clean up a Mac that has slowed to a crawl under an always-on agent CLI: find and remove orphaned MCP children, idle agent sessions, stuck CPU hogs, hung headless LLM calls and stuck OS daemons. Triggers: "/mac-patrol", "clean up my mac", "my mac is slow", "kill zombies", "high load average", "why is my machine crawling". Wraps mac_patrol.py. Order matters: MEASURE first (is it growing? is it burning RIGHT NOW, by CPU-time delta?), only then kill. A stable pair of zombies is normal, not a leak; a renderer stuck for 12h is the opposite, and the robot handles that one itself. macOS-first; Linux works; Windows is partial (no delta measure).
tonydzi/claude-mac-patrol · ★ 0 · AI & Automation · score 70
Install: claude install-skill tonydzi/claude-mac-patrol
# mac-patrol — the procedure Engine: `mac_patrol.py` (single source of the logic — do not reimplement it here). This file is the ORDER OF OPERATIONS around the engine. Every step below was paid for on a live machine; the traps are annotated with what they actually cost. ## Step 0 — "slow" is not one disease, and load average is not the evidence Three different complaints, three different culprits. Jumping straight to zombies means fixing at random. | What the human feels | Culprit | Probe | |---|---|---| | Cursor stutters, windows repaint in jerks | swap / WindowServer under someone else's load | `sysctl vm.swapusage`, `memory_pressure \| tail -3` | | Beachball, disk churns, Spotlight search empty | indexers (`mds_stores`, `corespotlightd`, `installd`) | CPU delta on those (Step 1) | | Everything at once, apps take seconds to open | memory eaten by MCP copies | Step 1b | ⚠️ **Load average on a Mac with dozens of sessions means almost nothing.** Measured: load 233 while only 4% of the CPU was busy — the processes were queued on MEMORY, not on the CPU. The honest pair of numbers is `free CPU %` from `top` plus `swap used`. Load is a before/after prop, not a diagnosis. ## Step 1 — MEASURE (never kill blind) ```bash top -l 1 -n 0 | head -12 # load avg + memory ps aux | awk '$8 ~ /^Z/ {print $2, $8}' # zombies (state Z) python3 mac_patrol.py --dry-run # every decision, no action memory_pressure | tail -3 # the TRUTH about memory