mcpField
M
macos-disk-cleanup

macos-disk-cleanup

github.com/tejas-kaleOther038 installsUpdated 3d ago
Repository

About macos-disk-cleanup

macOS Disk Cleanup is a guided skill for measuring disk usage and removing reclaimable files on macOS. It separates rebuildable quick wins from data that needs individual approval, then checks the space reclaimed.

Key features

  1. 01Measure disk and directory usage
  2. 02Classify deletions by risk
  3. 03Run safe cleanup commands
  4. 04Request approval for sensitive data
  5. 05Compare disk usage before and after

Use cases

  1. 01Finding large directories on a Mac
  2. 02Clearing rebuildable development caches
  3. 03Reviewing app data before deletion
  4. 04Checking cleanup results and snapshots

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/tejas-kale/skills --skill macos-disk-cleanup

After installing, type/macos-disk-cleanupin Claude Code to confirm it loaded.

Bundled filesagents/openai.yamlreferences/paths.md

Details

From the project README

macOS Disk Cleanup

Measure before deleting, spend the safe wins first, and treat anything holding local-only state as confirm-first — it needs the user's explicit go-ahead, because nothing re-downloads it.

Process

  1. Measure top-level and home usage.
  2. Drill into the largest user-owned directories.
  3. Classify every candidate as a quick win or confirm-first, and present the two groups separately.
  4. Run the quick wins; ask before each confirm-first deletion.
  5. Re-measure and report the delta.

Done when every consumer above ~1G is classified, each confirm-first deletion was individually approved, and a before/after df -h / frames what the run actually freed.

Measure

# 1. Top-level
du -sh /System /Users /private /Applications /Library 2>/dev/null | sort -rh

# 2. Home breakdown
du -sh ~/Library ~/Code ~/Downloads 2>/dev/null | sort -rh

# 3. Library breakdown
du -sh ~/Library/Application\ Support/* ~/Library/Caches/* ~/Library/Group\ Containers/* 2>/dev/null | sort -rh | head -20

Aim the drill-down with the user's profile:

ProfileCheck firstTypical gain
DeveloperHomebrew, uv/npm/pip, DerivedData, simulators10–20G
AI/ML userOllama unused models, HuggingFace, LM Studio5–15G
Chrome-heavyOptGuideOnDeviceModel, GoogleUpdater~5G

Quick Wins

Everything here rebuilds or re-downloads on demand — run without asking.

CommandFreesNotes
brew cleanup --prune=all2–10GCached installers
uv cache clean --force1–10Guv package cache
npm cache clean --force500M–2Gnpm cache
pip3 cache purge100–500Mpip cache
pre-commit clean200–500Mpre-commit envs
rm -rf ~/Library/Developer/Xcode/DerivedData500M–5GRebuilds on demand
xcrun simctl delete unavailable1–10GUnused iOS simulators

Path catalog

For the per-path verdicts — Chrome, AI model caches, dev tool caches, and the confirm-first app data — read references/paths.md before proposing any deletion outside the quick wins above.

After Cleanup

df -h / lags because APFS local snapshots still hold the freed blocks. Check tmutil listlocalsnapshots / and tell the user they thin themselves within ~24h — the number is already correct underneath, so the next move is to wait rather than clean again.

Comments

Markdown supported