system-health
Skill5 starsChanged 39 days agoMITView on GitHub
Suggest whether the machine needs a DISK or MEMORY cleanup — and catch the case where Heimdall ITSELF is the hog (runaway orphaned python from the presence keeper). Use when the machine is slow / swapping / laggy, disk or "System Data" is full, memory is exhausted, at the start of a long session, or when the user asks to free up space or RAM. Detection + suggestion only; hands off deep disk cleanup to the mac-deep-clean skill.
6 other projects use a version of this.
Adopted by
Most recently taken up by
- manusco/resonancetheir own version, first seen Oct 22, 2026
- murphytrueman/design-system-opstheir own version, first seen Sep 23, 2026
- Sanexxxx777/curated-claude-codetheir own version, first seen Jun 28, 2026
- erdcpatel/agent-skillstheir own version, first seen Apr 19, 2026
- coffeegrind123/system-health-skilltheir own version, first seen Apr 12, 2026
- gricha/dangerous-skillstheir own version, first seen Mar 23, 2026
Other versions6 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 6
- murphytrueman/design-system-ops★ 197same name
- gricha/dangerous-skills★ 38same name
- manusco/resonance★ 38same name
- Sanexxxx777/curated-claude-code★ 16same name
- coffeegrind123/system-health-skill★ 0same name
- erdcpatel/agent-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository7 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- designmatchSkill
- heimdallSkill
- mac-deep-cleanSkill
- self-improveSkill
- stacksSkill
The file
We split this skill into the rules it gives an agent
1 rule. 0 are common, 1 is distinctive, and 0 are very specific to this project.
0
Common
Most of the 6 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 86
Do NOT auto-delete or auto-reboot.
“Common” is measured: kept by at least 6 in 10 of the 6 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
system-health
A read-only advisor: does this machine need a cleanup, and is Heimdall causing it? It grades disk + memory pressure, counts Heimdall's own leaked python, and SUGGESTS the fix. It never deletes or kills anything unless you explicitly ask for the scoped self-reap.
Pairs with mac-deep-clean (the executor that actually reclaims disk) — shipped with
Heimdall as skills/mac-deep-clean/ and invoked as hmd:mac-deep-clean. This skill is the
trigger — the thing that notices you need it — and it checks the executor is actually
present before ever naming it: the plugin-shipped <plugin>/skills/mac-deep-clean/SKILL.md,
or a copy you installed yourself (~/.claude/skills/mac-deep-clean/SKILL.md or the
project-level equivalent — still counted, and named as plain mac-deep-clean). It falls
back to plain read-only investigation commands when neither exists.
Why this exists (the lesson it encodes)
A long Heimdall session leaks background python: the presence keeper's presence-doctor
spawns mock_cp.py (a mock control-plane) children that get orphaned to launchd (ppid 1)
and are never reaped. One session accumulated ~692 of them, pinning all 16G of RAM and
thrashing swap 17G/17G. heimdall-gc reaps orphaned keeper pidfiles, but NOT these
launchd-reparented children (nothing tracks them) — so they slip the collector. Most of a
real cleanup session was just purging these do-nothing python procs. This advisor is the
check that catches them early.
Run it — the unified core (both axes at once)
bin/heimdall-cleanup is the ONE entrypoint that covers BOTH axes — MEMORY (RAM/swap +
hmd's orphan leak) and DISK (hmd's own reclaimable garbage). It ORCHESTRATES the two
reapers below; it never re-implements them. Reach for it first:
heimdall-cleanup # report (DEFAULT, read-only): unified health + reclaimable-now MB
heimdall-cleanup --json # {severity, memory, disk, procs, reclaim} for programmatic use
heimdall-cleanup --apply # reap hmd's OWN garbage only (orphaned hmd python + gc disk)
heimdall-cleanup --deep # SUGGEST-only handoff to mac-deep-clean (confirm-gated, nothing auto)report is provably read-only (sysmon with no mutating flag + gc run --dry-run + read-only
probes) — the cc-selfheal lesson: a "status" that secretly mutates causes the error it exists
to prevent. It is wired into SessionStart/End via --auto (runs gc always; reaps orphaned hmd
python ONLY on a genuine runaway so a live keeper is never killed). Opt out with
HEIMDALL_NO_CLEANUP=1 or ~/.heimdall/no-cleanup.
The underlying reapers (the core delegates to these — use directly for a single axis)
heimdall-sysmon # MEMORY axis: human report + a SUGGESTION block; exit 0 ok / 1 warn / 2 critical
heimdall-sysmon --quiet # print ONLY when action is advised (ideal at session start)
heimdall-sysmon --json # {severity, disk, memory, procs, ...} for programmatic use
heimdall-gc run # DISK axis: reap merged worktrees / temp / logs / retired claude versionsThree graded sections:
| Section | Signal | WARN / CRIT |
| disk | true free on /System/Volumes/Data (via diskutil — df / lies) | ≥85% used / ≥93% |
| memory | swap in use (vm.swapusage) + wired RAM (vm_stat) | swap ≥40% / ≥70%; wired ≥55% |
| procs | Heimdall's OWN orphaned python (mock_cp.py / presence-doctor, ppid 1) + any interpreter runaway | ≥20 orphans / ≥80; any interpreter ≥120 |
Overall exit code = the worst section. Thresholds override via HMD_SYSMON_* env vars.
Interpret + suggest
- procs WARN/CRIT → Heimdall is leaking. Suggest the scoped self-reap (below). This is the single highest-value action — it's do-nothing python pinning RAM.
- memory WARN/CRIT → reaping does not touch wired RAM (killing procs does not free
non-pageable wired memory). Split the two axes, because they behave differently:
- swap is elastic — macOS sizes it on demand and reclaims it on its own as pressure eases, with no reboot. A high swap % is a symptom to watch, not by itself an action.
- wired is kernel-side. A reboot drops the pages, but any holder that re-arms at boot
re-wires them immediately — so a restart is a temporary reclaim, not the fix. Name
the persistent holder instead:
heimdall-cleanup --advisedetects the cheaply-visible ones (mounted OS/simulator runtime volumes, running hypervisors) and says the holder is unidentified when it cannot see one. Never prescribe a reboot as the fix.
- disk WARN/CRIT → hand off to mac-deep-clean (
hmd:mac-deep-clean; tiered, read-only investigation first, then deletes only caches / dead repos / SDK-simulator bloat) — IF it's present (the plugin-shipped copy, or one you installed). Otherwise the suggestion names manual, read-only investigation commands instead (never a skill absent from this machine).
Do NOT auto-delete or auto-reboot. Suggest; let the user confirm.
The one mutating action — scoped self-reap
heimdall-sysmon --reap-hmd-orphansKills only procs that are (a) orphaned to launchd (ppid 1) and (b) carry Heimdall's own
signature (mock_cp.py, presence-doctor, or a heimdall-tagged python), then stops the
presence spawner so they don't respawn. A foreign python (real parent, or no heimdall
marker) is never matched. The detector and the reaper share ONE matcher (--filter-orphans
is that matcher exposed for testing), so what it counts is exactly what it would kill.
Safety: this only reaps Heimdall's OWN garbage. For anything foreign, or a full disk sweep, defer to the user / mac-deep-clean. Wired RAM is outside Heimdall's reach entirely — say so, and say that a reboot only reclaims it until its holder re-arms.
Optional: proactive nudge at session start
Wire a non-nagging advisory (prints only on WARN/CRIT) into your session start:
# in a SessionStart hook / shell rc:
heimdall-sysmon --quiet || trueLeft opt-in (not auto-wired) so it never adds startup noise or a hook dependency you didn't ask for.
Verification
heimdall-sysmonprints disk / memory / procs sections and a severity, exits 0/1/2.heimdall-sysmon --json | jq .is valid JSON with the three sections.--filter-orphansmatchesmock_cp.py/presence-doctororphans but NOT a foreign python nor a non-orphan (proven bytest/heimdall-sysmon.test.sh).- A reap suggestion appears iff
procsis WARN/CRIT; a mac-deep-clean suggestion iffdiskis WARN/CRIT AND the skill is actually present (plugin-shipped →hmd:mac-deep-clean, user/project-installed →mac-deep-clean) — otherwise a manual read-only fallback (proven by the mac-deep-clean-availability cases intest/heimdall-sysmon.test.shandtest/sys-cleanup.test.sh).
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

