macos-cleanup
Skill6 starsChanged 44 days agoMITView on GitHub
Deep-clean macOS - user/system junk (caches, logs, trash, iOS backups), leftovers from deleted apps, dev-tool junk (brew, docker, Xcode, npm/pnpm/uv/cargo caches, stale node_modules), disk-space breakdown + login-items audit. Use when the user says "clean my mac", "free up disk space", "disk is full", "what's eating my storage", "remove app leftovers", or any macOS storage/cleanup complaint. Health checks, updates, tune-up ("optimize/maintain my mac") -> macos-maintenance instead. Always scans read-only first, reports sizes, deletes only after explicit per-category confirmation.
- Reads credentials
- Deletes or force-pushes
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 2 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 18
Clean: only what was confirmed, commands below.
- Very specific: line 37
Verify, don't assume - grep installed.txt for every candidate before the verdict.
- Very specific: line 38
Never flag: com.apple.*, group.*, anything matching an installed app/cask/formula, vendor-shared dirs while any of that vendor's apps …
- Very specific: line 57
No perf snake-oil: no purge, no "free RAM", no repair-permissions theater.
- Very specific: line 62
Never touch: Documents/Desktop/Photos/iCloud Drive, ~/Library/Keychains, ~/.ssh, Mail data, browser profiles (their Caches ok), dotfiles, …
- Very specific: line 63
No sudo by default. System paths (/Library/Caches, /Library/Logs, LaunchDaemons) -> report.
- Distinctive: line 65
Every scanned category shows up in the report - empty/clean ones as "already clean" (e.g.
- Distinctive: line 67
Never report a finding this file predicts - the verdict comes from the scan, not from here.
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
macOS Cleanup
Deep-clean: junk + app leftovers + dev junk + space/startup audit. Destructive territory -> scan (read-only) -> sized report -> confirm -> delete -> verify freed. Never delete during scan.
Flow
- Scan:
bash scripts/scan.sh. Read-only, deletes nothing. Sized report -> stdout, raw lists ->/tmp/macos-cleanup-scan.*/(path printed).duover~/Library= takes a minute+, warn user up front - Cross-ref leftovers:
installed.txt(app bundle ids + cask/formula names) vs candidates (app-support.txt,containers.txt,preferences.txt,caches.txt,saved-state.txt, LaunchAgents). Matching rules below. Flag only what you can name the dead app for - Report: table per category - item · size · verdict (
safe= regenerable /risky= judgment call /skip+ why). Lead with total reclaimable + current disk free - Confirm:
AskUserQuestion, multiSelect across categories. Anything >1 GB or non-regenerable (iOS backups, go modcache, simulator runtimes, Xcode DeviceSupport) -> its own option, never bundled into a category - Clean: only what was confirmed, commands below. Leftovers + launch agents -> Finder Trash (recoverable). Pure caches ->
rmfine - Verify:
df -h /before vs after -> "freed X GB". List skipped + why.dfunchanged -> likely APFS purgeable / TM local snapshots; reporttmutil listlocalsnapshots /, thinning is automatic,tmutil deletelocalsnapshots <date>only on explicit ask
Categories
User/System Junk (Mostly Safe)
~/Library/Caches/*- per-entry, not wholesale. Skip entries of currently running apps (pgrep -if <name>) or tell user to quit them~/Library/Logs, CrashReporter, QuickLook thumbnails,~/Library/HTTPStorages- regenerable- Trash:
osascript -e 'tell app "Finder" to empty trash'(handles locked files) - Mail Downloads cache - safe; Mail data itself off-limits
- iOS device backups (
~/Library/Application Support/MobileSync/Backup) - user data, not regenerable. Individual confirm, state device + date per backup (ls -lt)
App Leftovers (Risky - Be Conservative)
Locations: Application Support, Caches, Preferences, Containers, Saved Application State, LaunchAgents, Logs, HTTPStorages.
Matching rules:
- Flag only when owner identifiable AND definitively gone: bundle id / vendor name absent from
installed.txt, no running process, not a CLI tool - Verify, don't assume - grep
installed.txtfor every candidate before the verdict. Name familiarity ≠ installed (Code= VS Code, not Codex; an app being famous doesn't mean it's present) - Never flag:
com.apple.*,group.*, anything matching an installed app/cask/formula, vendor-shared dirs while any of that vendor's apps remain (e.g.Google,JetBrains,Microsoft) - Unsure who owns it -> skip + say so. Missed leftover >> deleted-wrong-thing
- Removal -> Trash:
osascript -e 'tell app "Finder" to delete POSIX file "<abs path>"'
Dev Junk
- brew:
brew cleanup --prune=all && brew autoremove - docker (daemon must run):
docker system prune -f. Never--volumesunless user explicitly says volumes - Xcode:
rm -rf ~/Library/Developer/Xcode/DerivedData;xcrun simctl delete unavailable; old iOS DeviceSupport = risky (re-fetch needs the device) - Caches:
pnpm store prune·npm cache clean --force·pip cache purge·uv cache clean(safe, next install re-downloads; location fromuv cache dir- often~/.cache/uv, not~/Library/Caches) · cargo registryrm -rf ~/.cargo/registry/{cache,src}(lockfiles re-fetch) ·go clean -modcache= risky, slow re-download - XDG
~/.cache/*(rod, huggingface, etc.): tool caches, mostly regenerable - but identify the owner per entry, same skip-if-unsure rule as leftovers - pyenv: superseded patch versions (3.13.9 next to 3.13.10) ->
pyenv uninstall <old>. Checkpyenv versionfirst - never remove the active one - Sparkle
PersistentDownloads(old app-update packages under~/Library/Caches/<app>/org.sparkle-project.Sparkle/) - safe, apps re-download pending updates - Stale build dirs (
projects.txt): only projects untouched 30+ days. Regenerable via install/build (.nextvia next build). >500 MB -> per-project confirm. Never touch a repo's tracked files -node_modules/.venv/target/.nextonly
Optimization / Space Report
- Biggest dirs from scan -> short "what's eating the disk" breakdown
- Login items + LaunchAgents/Daemons: flag dead ones (binary or app in
ProgramArgumentsno longer exists). Removal =launchctl bootout gui/$(id -u)/<label>+ plist -> Trash, per-item confirm. Live but unwanted -> report only, let user decide - No perf snake-oil: no
purge, no "free RAM", no repair-permissions theater. Real wins = disk space + fewer startup items
Rules
- Scan phase = read-only. Delete only what the user confirmed this session, nothing more
- Never touch: Documents/Desktop/Photos/iCloud Drive,
~/Library/Keychains,~/.ssh, Mail data, browser profiles (theirCachesok), dotfiles, any repo's tracked files,/System(SIP anyway) - No sudo by default. System paths (
/Library/Caches,/Library/Logs, LaunchDaemons) -> report; act only on explicit sudo OK - Anything ambiguous ->
skipverdict + one-line reason in report. User can override - Every scanned category shows up in the report - empty/clean ones as "already clean" (e.g. "Trash: empty"), never silently omitted. Omission reads as "not checked"
- Empty scan (nothing significant) -> say so + stop. Don't invent work
- Never report a finding this file predicts - the verdict comes from the scan, not from here. Baked-in findings are how an audit skill rots
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- GovindMalviya/macos-cleanup★ 2same 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 repository21 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- blog-writeSkill
- cloudflare-hygieneSkill
- git-branch-cleanupSkill
- git-branch-createSkill
- git-branch-syncSkill
- git-commitSkill
- git-issue-createSkill
- git-issue-startSkill
- git-issue-triageSkill
- git-pr-createSkill
- herdr-dispatchSkill
- humanizeSkill
- macos-maintenanceSkill
- obsidian-markdownSkill
- spec-applySkill
- spec-archiveSkill
- spec-exploreSkill
- spec-proposeSkill
- spec-verifySkill
- vercel-hygieneSkill
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.

