agentleFS
dennisonbertramdennisonbertram/claude-mac-guardian/skills/disk-usage/SKILL.md

disk-usage

Skill1 starsChanged 7 months agoMITView on GitHub

This skill should be used when the user asks to "check disk usage", "is my drive full", "what's using my disk", "disk space", "free up space", or mentions low storage. Reports free space, largest directories, caches, Time Machine local snapshots, Xcode simulator footprint, and node_modules sizes, then writes a JSON result to ~/.mac-guardian/data/.

4 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

4 rules. 0 are common, 2 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 3 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    When invoked by daily-health-report, return JSON path only.

    line 46
  2. Distinctive:

    Read-only. Never delete caches, snapshots, DerivedData, or node_modules.

    line 50
  3. Distinctive:

    If the user asks to clean up after seeing the report, explain what the commands would be and prompt for confirmation.

    line 51
  4. Very specific:

    Do not call sudo.

    line 52

“Common” is measured: kept by at least 6 in 10 of the 3 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

disk-usage

Surveys storage usage on macOS without deleting anything.

When to invoke

Trigger on phrases like: "check disk usage", "is my drive full", "what's using my disk", "disk space", "free up space".

What to check

1. Per-volume free space — df -h. Filter to apfs and hfs volumes. For each volume:

  • / free ≥ 20 GB or ≥ 15%: ok.
  • / free 10–20 GB or 5–15%: info.
  • / free 5–10 GB or 2–5%: warn.
  • / free < 5 GB or < 2%: critical.

2. Top 20 home directories by size — du -shx ~/* 2>/dev/null | sort -rh | head -20. Record as raw. Individual dirs ≥ 50 GB get an info finding.

3. Library caches — du -shx ~/Library/Caches 2>/dev/null. If ≥ 20 GB, info "Library caches at <size>".

4. System / user log sizes — du -shx ~/Library/Logs /private/var/log 2>/dev/null. Record in raw.

5. Time Machine local snapshots — tmutil listlocalsnapshots / 2>/dev/null. Report the count. ≥ 10 snapshots: info.

6. Xcode / iOS simulator footprint — du -shx ~/Library/Developer/CoreSimulator/Devices ~/Library/Developer/Xcode/DerivedData ~/Library/Developer/Xcode/iOS\ DeviceSupport 2>/dev/null. Sum ≥ 30 GB: info. Sum ≥ 100 GB: warn.

7. node_modules across common dev roots (optional and guarded) — only run when the user's home has a Develop/ or Projects/ or code/ directory: find ~/Develop ~/Projects ~/code -type d -name node_modules -maxdepth 6 -prune -exec du -shx {} + 2>/dev/null | sort -rh | head -20. Guard this with a soft timeout (use timeout 60s if gtimeout or coreutils timeout is available; otherwise include only if find completes within reason, and skip with an info finding "skipped — search would take too long" if not).

8. Large Downloads / Trash — du -shx ~/Downloads ~/.Trash 2>/dev/null. Each ≥ 10 GB: info.

Output contract

Standard envelope. Write to ~/.mac-guardian/data/disk-usage-<ISOdate>.json.

Top-level severity = max across all checks. Summary example: "44 GB free on / (warn). Biggest: ~/Library/Caches 38 GB, DerivedData 27 GB."

Handoff

  • On direct invocation: bash ${CLAUDE_PLUGIN_ROOT}/scripts/render-single.sh disk-usage.
  • When invoked by daily-health-report, return JSON path only.

Safety

  • Read-only. Never delete caches, snapshots, DerivedData, or node_modules.
  • If the user asks to clean up after seeing the report, explain what the commands would be and prompt for confirmation.
  • Do not call sudo.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.