mac-patrollisted
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