/mac-disk-cleaner:mac-cleanupfrom mac-disk-cleaner
Cleans safe Mac cache locations (Chrome, npm, Yarn, pip, SwiftPM, Gradle, Homebrew), reports freed space, and flags oversized folders for manual review.
Ships in mac-disk-cleaner. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Clean up safe Mac cache locations, report how much space was freed, and flag any oversized folders worth reviewing manually.
Use this skill when the user says things like: "clean my Mac", "free up disk space", "clear cache", "my Mac is slow", "running out of space", "Mac cleanup", "disk cleanup", "tidy up my Mac", "ניקוי מק", "פנה מקום", "המק שלי מלא", "nettoyage Mac", "limpiar Mac", or any similar request about freeing storage on a Mac.
Also runs automatically when triggered as a scheduled task.
Work through each phase in order. Communicate with the user in whatever language they used.
Environment note: This skill works in both Claude Code (native Bash tool) and Cowork (Desktop Commander). Use whichever shell execution method is available in your environment to run the bash commands below.
Run these two commands and record the results:
df -h / | tail -1
du -sh \
~/Library/Caches/Google/ \
~/Library/Caches/pip/ \
~/Library/Caches/node-gyp/ \
~/Library/Caches/org.swift.swiftpm/ \
~/.gradle/caches/ \
~/Library/Caches/Homebrew/ \
2>/dev/null
Note the "Avail" column from df as before_avail and record each cache size.
Run each command. If a command fails (permission denied, not found), note it and continue — do not abort.
# Google Chrome disk cache (passwords/history/bookmarks are in Application Support, NOT here — safe to delete)
rm -rf ~/Library/Caches/Google/ 2>/dev/null; true
# npm cache
npm cache clean --force 2>/dev/null; true
# Yarn cache
yarn cache clean 2>/dev/null; true
# pip cache
rm -rf ~/Library/Caches/pip/ 2>/dev/null; true
# Swift Package Manager cache (auto-regenerated on next build)
rm -rf ~/Library/Caches/org.swift.swiftpm/ 2>/dev/null; true
# Gradle caches (auto-regenerated on next build)
rm -rf ~/.gradle/caches/ 2>/dev/null; true
# Homebrew — prefer brew cleanup, fall back to rm
brew cleanup 2>/dev/null || rm -rf ~/Library/Caches/Homebrew/ 2>/dev/null; true
Do NOT touch:
~/Library/Application Support/Google/Chrome — contains passwords, history, bookmarks~/Documents, ~/Desktop, ~/Downloads (contents — only scan, never delete)/System or /Librarydf -h / | tail -1
Capture the new "Avail" value as after_avail. Calculate freed = after_avail − before_avail.
Run these to find large items the user may want to handle manually:
du -sh ~/Desktop ~/Downloads ~/Documents 2>/dev/null
# Top 10 largest items on Desktop
du -sh ~/Desktop/* 2>/dev/null | sort -rh | head -10
# Top 10 largest items in Downloads
du -sh ~/Downloads/* 2>/dev/null | sort -rh | head -10
If any folder or file exceeds 3 GB, flag it as worth reviewing. Do not delete anything — only inform.
Present a clean summary in the user's language. Include:
Keep the report concise. Do not overwhelm — surface the most actionable items only.
See references/safe-cache-locations.md for the full list of Mac cache locations and what's safe to delete.
Phase 4 only flags large items. If the user asks you to actually remove them, follow these rules — they prevent irreversible mistakes that have bitten this skill in real runs.
rm — and know the Trash mechanicsmv "<item>" ~/.Trash/) rather than rm -rf. This stays reversible (Finder → "Put Back") until the Trash is emptied.df will show no gain after a mv to Trash — don't report freed space until after emptying.~/.Trash is TCC-protected. rm -rf ~/.Trash/* fails with Operation not permitted from a sandboxed shell, and the glob silently matches nothing (looks like success but isn't). Empty it through Finder instead:
osascript -e 'tell application "Finder" to empty trash'
-128 (a confirmation dialog or a locked item blocked it), disable the warning and retry:
osascript -e 'tell application "Finder"' \
-e 'set warns before emptying of trash to false' \
-e 'empty trash' \
-e 'set warns before emptying of trash to true' \
-e 'end tell'
A folder full of old project checkouts can still hold local-only work that exists nowhere else. Before deleting any folder containing code, check every git repo inside it:
cd "<folder>"
for d in */; do
if [ -d "$d/.git" ]; then
(cd "$d"; echo "$d → uncommitted=$(git status -s | wc -l | tr -d ' ') unpushed=$(git log --branches --not --remotes --oneline | wc -l | tr -d ' ')")
fi
done
git -C "<folder>" status -s 2>/dev/null # check the folder itself if it is a repo
uncommitted=0 and unpushed=0 are safe — fully on the remote, re-cloneable.origin/<branch> before assuming work is at risk — don't force-push to "rescue" them.git diff HEAD > rescue/<repo>-changes.diff # tracked edits
git ls-files --others --exclude-standard | grep -viE '\.(swp|zip)$|node_modules/' \
| while read -r f; do mkdir -p "rescue/<repo>/$(dirname "$f")"; cp -p "$f" "rescue/<repo>/$f"; done
git format-patch origin/<branch>..HEAD --stdout > rescue/<repo>-commits.patch # local-only commits
Only after the rescue bundle is verified should the folder be moved to Trash and the space reclaimed.
What SKILL.md sets; muted values are Claude Code's defaults
2 skills in this plugin
npx claudepluginhub msapps-mobile/claude-plugins --plugin mac-disk-cleanerOther plugins' skills for the same job