Diagnoses macOS system-level slowness, heat, and fleet-wide timeouts by analyzing load averages, leaked child processes, fork storms, and busy loops. Use when the Mac feels slow or hot, fans spin up, or everything times out at once.
Ships in daymade-macos. 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.
Read when SKILL.md points to them; scripts run unread.
Find what is making the Mac slow or hot, attribute it to an owner, and act within the shared-machine boundary. The skill's job is a correct, evidence-backed attribution — not process cleanup.
A fleet-wide symptom is an environment problem until proven otherwise. When independent apps, hooks or agents all start timing out or crawling at the same time, check shared resource pressure before blaming each component. Check the machine first; pursue an individual defect when its own evidence distinguishes it from that shared pressure.
sysctl -n vm.loadavg; uptime
Expected: three numbers, e.g. { 3.12 4.01 5.20 }. Read against the core
count, not an absolute: single digits are calm on a modern Mac; tens are busy;
hundreds signal severe scheduling or wait pressure and everything on
the machine can be affected — hooks time out, keystrokes lag, pushes stall. A
load in the hundreds with no obvious culprit in the CPU column usually means
hundreds of small processes, not one big one.
Treat load as a triage signal, not a causal verdict or a count of busy CPU cores. Overload can coexist with an individual hook's repeated work. Before deriving a CPU rate or process-creation rate, use the measurement controls: calibrate units, measure elapsed time and state the sampler's coverage.
LOAD_DOCTOR_DIR='<absolute directory containing this SKILL.md>'
bash "$LOAD_DOCTOR_DIR/scripts/load_census.sh"
Resolve that directory from the loaded Skill entry; the caller's project directory is not the Skill directory. The census readings answer different questions:
For retained agent/MCP children, read Stateful agent and MCP children before treating them as waste.
Trace the parent chain of the suspect until it ends at something ownable:
ps -o pid,ppid,etime,command -p <pid> # then repeat on its PPID
launchctl list | awk '$2 != "-" && $2 != "0"' # jobs with abnormal last-exit codes
The launchctl filter also prints its header line, and many system daemons
sit at status -9 (SIGKILL) permanently — that is routine noise, not a crash
loop. The respawn-loop signal is a job whose PID keeps changing between
runs, not any single status value.
Attribution determines which product/session owns it, whether it is supposed to be long-lived (a daemon) or short-lived (a helper that forgot to die), and who is allowed to stop it.
Continue past a generic interpreter or shared daemon to the actual business operation: use the relevant command, working directory, parent chain and, when needed, repository/ref or deployed version. Select only decision-bearing fields and redact credentials; never dump the environment. Group a launcher and its children as one task when the chain supports that grouping; distinguish separate jobs that happen to use the same executable or shared parent.
For “what are these processes doing?”, lead with that work and its current state, not a CPU ranking. Follow Writing the report for the explanation format and short-lived-process evidence. Identify the work separately from whether it is faulty or causes the reported lag; keep an unknown task, owner, lifecycle or causal link explicit.
For recurring conflicts, retries, or timeouts in scheduled jobs, trace duplicate scheduled work through the active producer routes and their receiving system.
If a slow round is still in progress, capture its stage evidence before it exits.
For an idle Node/Vite preview, follow development preview watchers before changing the shared process. It covers effective watcher scope, safe reuse and page/HMR preservation alongside CPU measurement.
| Shape | Signature | Typical cause |
|---|---|---|
| Leak candidate | retained child count grows after comparable work finishes, or helpers outlive their documented lifecycle | missing cleanup; confirm workload and lifecycle before calling it a leak |
| Fan-out / pool | many children correlate with active sessions or a stable configured pool | per-thread ownership can be expensive without being a leak |
| Storm | many processes with seconds-short etimes, high fork rate | unthrottled loop (test replay, batch scan, retry without backoff) |
| Busy loop candidate | sustained CPU with repeated hot work and no expected progress; verify with a bounded stack/progress probe | app polling without sleep |
| Cascade | load high but suspects scattered | a system service amplifying each new process (security scans, file-sync, Spotlight) |
The fix is different for each: a confirmed leak wants the spawner fixed or restarted, a storm wants throttling at the loop, a busy loop wants the app relaunched or its scan disabled, a cascade wants fewer new processes, not faster ones.
On a shared machine, diagnosis is read-only; remediation has an owner.
A verified PID identifies the target; it does not establish exclusive use. In a Spotlight case, normal exit was followed immediately by launchd restart for unfinished work or IPC despite disabled overrides. Treat that observation as a failed durable stop, not permission to chase new PIDs or restart the login session. A lost override's cause remains unknown unless its change is traced.
~/.claude/references/irreversible-gates.md
§终止进程 (parent-chain trace, visible-window check, side-effect list,
SIGTERM first — never -9 first — and post-kill readback including
terminal mouse-mode reset via ~/scripts/pty-tui-reset/pty-tui-reset.sh).sysctl -n vm.loadavg and the census, then exercise the user's original
capability through its actual consumer. Disabling a service can relieve load
while removing that capability: report mitigation until it works again.
Before a configuration reload, establish whether its scope includes other
threads/services. Compare target and non-target helpers before/after; an
unchanged master PID does not prove that other helpers were unaffected.For a memory complaint, measure pressure and activity alongside process counts:
sysctl vm.swapusage
vm_stat -c 4 2
ps -axo pid,ppid,rss,command
Read the page size printed by vm_stat; its first row is cumulative and later
rows show interval activity. Existing swap allocation does not establish current
thrashing: inspect swap-in/out activity over the sampled window and report that
window. RSS totals can count shared resident pages repeatedly and are not unique
physical memory. For a suspect, use vmmap -summary <pid> to distinguish its
reported physical footprint from RSS; retain separately reported GPU/IOKit
allocations instead of silently adding unlike counters. A large allocation or
compressed-memory snapshot alone does not identify retained objects or a leak.
Apple's memory guide defines memory pressure using free memory, swap rate, wired memory and cached files. The executing agent interprets those signals and the observed workload; the census does not mechanically classify a leak.
Worked cases with real probe outputs live in references/incident-playbook.md — read it when the census shows something you have not seen before, or when you need a precedent for the report you are about to write.
launchctl list shows a non-zero last-exit code and a PID that keeps
changing.ps -Ao pid= snapshots a few seconds apart identify surviving new PIDs:
count the PIDs that appear only in the second
(comm -13 <(sort old.txt) <(sort new.txt) | wc -l, divided by the interval).
This is a lower bound, not the fork rate: children born and exited between
snapshots are invisible. A small difference does not rule out a storm. Follow
the measurement controls above when this gap could change the diagnosis.What SKILL.md sets; muted values are Claude Code's defaults
6 skills in this plugin
/capture-screenProgrammatic screenshot capture on macOS. Find window IDs with Swift CGWindowListCopyWindowInfo, control application windows via AppleScript (zoom, scroll, select), and capture with screencapture. Use when automating screenshots, capturing application windows for documentation, or building multi-shot visual workflows./developing-ios-appsBuilds and ships iOS/macOS apps with XcodeGen, SwiftUI and SPM: Xcode build fixes, device deployment, Apple Developer signing/notarization, CI/CD pipelines. Use for XcodeGen project.yml setup, "Library not loaded @rpath" crashes, code-signing errors (Error -25294, adhoc fallback), or Electron notarization failures. Not for TCC permission dialogs (use macos-permissions) or disk cleanup (use macos-cleaner).//daymade-macos:macos-load-doctorfrom daymade-macos
npx claudepluginhub daymade/claude-code-skills --plugin daymade-macosOther plugins' skills for the same job