mac-disk-cleanup
Skill11 starsChanged 24 days agoMITView on GitHub
Free disk space on a developer Mac safely. Measure first, back up what cannot be rebuilt, then delete. Use when a Mac is low on disk space, or when you clean caches, build output, simulators, containers or old agent worktrees.
- Reads credentials
- Deletes or force-pushes
9 other projects use a version of this.
Adopted by
Most recently taken up by
- alvaroofernaandez/dotfilestheir own version, first seen Nov 29, 2026
- karanmrn/kstackword for word, first seen Nov 29, 2026
- alvaroofernaandez/avaltheir own version, first seen Nov 22, 2026
- Esi-Abolfazl/skillstheir own version, first seen Nov 16, 2026
- stv-io/claude-skillstheir own version, first seen Nov 15, 2026
- deBilla/claude-skillstheir own version, first seen Oct 25, 2026
Used with
Projects with it also use skill-creator.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
SentrySkillskill-creator
Create new agent skills following the Agent Skills specification. Use when asked to "create a skill", "add a new skill", "write a skill", "make a skill", "build a skill", or scaffold a new skill with SKILL.md. Guides through requirements, writing, registration, and verification.
Also in 3 projects that use this
Other versions9 projects use a version of this.
Word for word · 1
- karanmrn/kstack★ 11100% same
Edited · 0
None found.
Wrote their own version · 8
- alvaroofernaandez/aval★ 5same name
- alvaroofernaandez/dotfiles★ 5same name
- Esi-Abolfazl/skills★ 3same name
- Shaybush/claude-skills★ 3same name
- Mateeb11/skills★ 1same name
- deBilla/claude-skills★ 0same name
- MaksimZinovev/mac-disk-cleanup-skill★ 0same name
- stv-io/claude-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 repository155 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- 14-day stale PR closeSkill
- AhoySkill
- api-and-interface-designSkill
- architectSkill
- arenaSkill
- ask-mattSkill
- audit-agent-worktreesSkill
- automate-meSkill
- axiSkill
- babysit-prSkill
- benchmark-checklistSkill
- blast-radiusSkill
- broSkill
- browser-testing-with-devtoolsSkill
- cache-architectureSkill
- chief-of-staffSkill
- chrome-devtools-axiSkill
- ci-cd-and-automationSkill
- claude-handoffSkill
- codebase-designSkill
- code-review-and-qualitySkill
- code-reviewSkill
- code-simplificationSkill
- compact-adviserSkill
- constraint-driven-developmentSkill
- context-engineeringSkill
- correctSkill
- councilSkill
- create-formal-verification-skillSkill
- create-verification-skillSkill
- debugging-and-error-recoverySkill
- delegate-to-modelSkill
- deprecation-and-migrationSkill
- diagnosing-bugsSkill
- documentation-and-adrsSkill
- domain-modelingSkill
- doubt-driven-developmentSkill
- figure-it-outSkill
- file-prSkill
- frontend-ui-engineeringSkill
- full-sendSkill
- full-stopSkill
- gh-axiSkill
- git-guardrails-claude-codeSkill
- git-workflow-and-versioningSkill
- gnhfSkill
- grillingSkill
- grill-meSkill
- grill-with-docsSkill
- handoffSkill
- hill-climbSkill
- howSkill
- idea-refineSkill
- implementSkill
- implement-specSkill
- improve-codebase-architectureSkill
- incremental-implementationSkill
- interrogateSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
5 rules. 0 are common, 2 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 7 edited versions we read keep these.
2
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 30
Prefer the tool's own clean-up command.
- Very specific: line 43
Do not run docker volume prune or docker system prune --volumes without approval.
- Distinctive: line 47
Before you delete anything that is not a rebuildable cache, make a copy or confirm that one exists.
- Very specific: line 58
Delete by exact path. Never use a wildcard over a home folder, and never rm -rf a path built from a variable that can be empty.
- Very specific: line 65
Run df -h /System/Volumes/Data again.
“Common” is measured: kept by at least 6 in 10 of the 7 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
Mac disk clean-up
Order: measure, classify, back up, delete, measure again. Delete only what you can rebuild or what a human approved.
1. Measure
df -h /System/Volumes/Data
du -xhd1 ~ 2>/dev/null | sort -hr | head -20
du -xhd1 ~/Library 2>/dev/null | sort -hr | head -20Go down into the largest folders until each large item has a name and a size. Record the free space now. You compare against it at the end.
2. Classify
| Class | Examples | Action |
| Rebuildable cache | ~/Library/Caches/*, ~/.npm/_cacache, ~/.cache/*, ~/Library/Caches/Homebrew, ~/.gradle/caches, ~/.cargo/registry/cache | Delete with the tool's own command when it has one. |
| Build output | node_modules, target, .next, dist, build, DerivedData in projects that you do not use now | Delete. The project rebuilds them. |
| Tool data | Docker images and volumes, Xcode simulators and device support, old SDKs, Ollama or other model weights | Use the tool's command. Volumes can hold real data: ask first. |
| Agent work | Old git worktrees and clones | Use audit-agent-worktrees. Never delete them as plain folders. |
| User data | Documents, Desktop, Downloads, Photos, Mail, app data, databases, .env files, keys | Never delete. Report the size and let the human decide. |
Prefer the tool's own clean-up command. It knows what is safe:
npm cache clean --force
brew cleanup --prune=all
docker system df # look first
docker image prune -a # images can be pulled again
xcrun simctl delete unavailable
pnpm store prune
uv cache clean
go clean -cacheDo not run docker volume prune or docker system prune --volumes without approval. Volumes can hold the only copy of a database.
3. Back up
Before you delete anything that is not a rebuildable cache, make a copy or confirm that one exists. Examples: a git remote that holds every commit, a Time Machine snapshot, or an archive on another disk.
tmutil listlocalsnapshots /
tar -czf <backup-dir>/<name>.tar.gz -C <parent> <folder>A backup on the same disk does not free space. Put it on another disk, or confirm the remote copy instead.
4. Delete
- Delete by exact path. Never use a wildcard over a home folder, and never
rm -rfa path built from a variable that can be empty. - Move user-visible files to the Trash (
trash <path>or Finder), so the human can restore them. - Close the app that owns a cache before you delete the cache.
- Empty the Trash only when the human approves.
5. Measure again
Run df -h /System/Volumes/Data again. Report the free space before and after, each item that you removed with its size, each backup path, and each large item that you left for the human.
APFS local snapshots can hold deleted data. If free space did not change, run tmutil listlocalsnapshots / and tell the human. Do not delete snapshots without approval.
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.

