macos-performance-triage
БесплатноБез исполняемых скриптовНе проверенLive macOS performance triage — attribute heat or high CPU/GPU (WindowServer, a browser/Electron app) to its process. Use when fans spin up, the Mac is hot or…
от laurigates★ 61 звезда на GitHubОб этом скилле
macOS Performance Triage (Apple Silicon)
When to Use This Skill
| Use this skill when... | Use something else when... |
|---|---|
| The Mac is hot/loud/slow and you need to find what's driving it | The machine actually hung or panicked — use macos-incident-postmortem |
WindowServer shows high CPU/GPU and you need to attribute it to a client app |
A security extension (Kandji ESF, XProtect, an EDR) is the hot process — use endpoint-security-cpu |
| One ordinary app (Chrome/Electron, a renderer, a game) is pegging CPU or GPU | launchservicesd is the hot process — use launchservices-health |
| You want a flame graph / deep profile of a specific process | A disk reads near-full or you're reclaiming space — use macos-disk-usage |
| You want a repeatable "what's hot right now" snapshot | syspolicyd/trustd/tccd/auditd are all elevated together (exec storm) — use endpoint-security-cpu |
| You need to attribute a live thermal/CPU/GPU load right now | You want a repeatable baseline scored PASS/WARN/FAIL against thresholds — use macos-performance-benchmark |
Platform Guard
macOS-only. powermetrics, sample, spindump, Instruments, and the
Apple-Silicon power counters macmon reads are Darwin-specific.
test "$(uname -s)" = "Darwin" || { echo "macos-plugin: not Darwin, refusing"; exit 1; }
Core Insight: triage with the USE method; WindowServer is always downstream
Two ideas drive the whole flow:
- USE method (Brendan Gregg) — for each resource ask Utilization,
Saturation, Errors. A bare
ps-by-CPU only answers Utilization. Saturation (run-queue depth, thermal throttle) and Errors (log stream) complete the picture. The method is OS-agnostic; only the tools change. WindowServernever starts its own work. Every cycle it burns was requested by a client app's draw / animation / compositing. Apps build their UI asCALayerhierarchies, hand them to WindowServer via IOSurface, and WindowServer composites (positioning, clipping, masks, shadows, effects) synced to the display refresh. So a hot WindowServer is a symptom — the job is to find the app feeding it (continuous video, GIF/Lottie animation, a software / non-GPU-accelerated render path, layout thrashing).
The deepest tier of Gregg's Linux approach does not transfer: there is no eBPF / bpftrace on macOS. DTrace is the analogue but SIP blocks it from tracing Apple-signed/system processes (including WindowServer) unless SIP is disabled — not worth it for desktop triage. The flow below stays within a normally-secured Mac.
Step 1 — Quick triage: what's hot
Start with a process snapshot, sorted by CPU. -c shows the short command name:
ps -Aceo pid,pcpu,pmem,comm -r | head -16
Then get the Apple-Silicon power/thermal picture. macmon (Rust) is the
preferred tool — it reads the same data as powermetrics (per-cluster P/E-core
load + frequency, GPU, ANE, package power, temps) but without sudo, via a
private IOReport API. One-shot, scriptable snapshot:
macmon pipe -s 1 | jq -c '{cpu_W:.cpu_power, gpu_W:.gpu_power, ane_W:.ane_power, ecpu_usage, pcpu_usage, gpu_usage, temp}'
Live TUI: macmon. Process/thread breakdown TUI: btm (bottom, Rust).
If the tools are missing, offer to install (all Rust, all sudo-free):
brew install macmon bottom samply hyperfine
Read the snapshot:
- A high non-system process at the top → go to Step 3 (profile it) or just identify/close it.
WindowServerhigh → Step 2 (attribute it).kernel_taskhigh → thermal management throttling a real load; find that load.- The whole security stack hot together → this is an exec storm, hand off to
endpoint-security-cpu.
Common phantom offenders
OrbStack Helper— quitting the OrbStack app does not stop the VM; the helper reparents to launchd (PPID 1) and keeps eating ~40–50% CPU / ~20% RAM with no visible app. Confirm withps -Ao pid,ppid,comm | grep -i '[o]rb'(aPPIDof1is the tell) and stop it withorb stop(clean VM shutdown, reversible withorb start), notkill, which skips the VM's own shutdown. Verify:ps -Aceo pid,comm -r | grep -i '[o]rb' || echo stopped. (Disk side of the same tool:macos-disk-usage.)- A backgrounded Electron app (Slack, Discord, VS Code) animating off-screen.
- A browser tab running video/WebRTC/canvas — see Step 2.
Step 2 — Attribute WindowServer / GPU load to the driving app
There is no single first-party "blame" button; attribute in layers, cheapest first:
- Per-process GPU cost (the real lever):
The app with high GPU here is what's loading WindowServer's compositor.sudo powermetrics --samplers tasks --show-process-gpu -n 1 -i 1000 - Activity Monitor → add the GPU column, sort descending; the Window Spy picker m
Установить macos-performance-triage в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Bash(uname *)Bash(ps *)Bash(top *)Bash(pgrep *)Bash(uptime *)Bash(vm_stat*)Bash(sysctl *)Bash(macmon *)Bash(btm *)Bash(sample *)Bash(spindump *)Bash(sudo powermetrics *)Bash(samply *)Bash(hyperfine *)Bash(brew install *)Bash(brew list *)ReadGrepGlobВложенные файлы
FAQ
Что делает скилл macos-performance-triage?
Live macOS performance triage — attribute heat or high CPU/GPU (WindowServer, a browser/Electron app) to its process. Use when fans spin up, the Mac is hot or slow.
Как установить скилл macos-performance-triage?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл macos-performance-triage запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic