disk-cleanup
Skill3 starsChanged 8 months agoMITView on GitHub
Use when the user wants to free disk space, investigate disk usage, clean caches, remove unused artifacts, or when disk capacity is high. Also use when asked to "clean up", "free space", "disk full", or "what's using disk space". Always uses AskUserQuestion for every deletion decision.
- Deletes or force-pushes
- Installs packages
12 other projects use a version of this.
Adopted by
Most recently taken up by
- galonge/free-claude-skillstheir own version, first seen Sep 6, 2026
- zhaochuang001/awesome-agent-skillstheir own version, first seen Sep 4, 2026
- gaganjainse/shesh-skillstheir own version, first seen Aug 15, 2026
- ebal/AI-Skillstheir own version, first seen Jul 15, 2026
- xiaxin5666/claude-skills-marketplacetheir own version, first seen Jul 6, 2026
- TsinHzl/disk-cleanup-skilltheir own version, first seen Jul 4, 2026
Other versions12 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 12
- glebis/claude-skills★ 387same name
- jayll1303/AIEKit★ 18same name
- MakiDevelop/claude-skills★ 3same name
- foogunlana/skills★ 1same name
- galonge/free-claude-skills★ 1same name
- shell-nlp/skills★ 1same name
- skyvanguard/infra-ops★ 1same name
- TsinHzl/disk-cleanup-skill★ 1same name
- xiaxin5666/claude-skills-marketplace★ 1same name
- ebal/AI-Skills★ 0same name
2 more not listed
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 repository36 other files it gives its agents.
- adrSkill
- analyticsSkill
- api-contractSkill
- api-designSkill
- ci-pipelineSkill
- claude-mdSkill
- code-qualitySkill
- data-modelSkill
- db-migrateSkill
- debugSkill
- deploySkill
- dep-updateSkill
- docker-buildSkill
- eng-leadSkill
- event-drivenSkill
- fullstack-healthcheckSkill
- go-featureSkill
- go-integration-testSkill
- go-refactorSkill
- go-scaffoldSkill
- incident-responseSkill
- interactive-clarifySkill
- observabilitySkill
- onboardingSkill
- product-specSkill
- py-featureSkill
- py-integration-testSkill
- py-migrateSkill
- py-refactorSkill
- py-scaffoldSkill
- react-featureSkill
- react-refactorSkill
- react-scaffoldSkill
- review-codeSkill
- securitySkill
- system-designSkill
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 6 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
- Distinctive: line 16
Run all scans in parallel where possible for speed.
- Distinctive: line 118
After scanning, present a summary table:
- Very specific: line 157
Run df -h / and show before/after comparison.
- Very specific: line 181
Not checking
brew uses --installed: before uninstalling — may break dependencies
“Common” is measured: kept by at least 6 in 10 of the 6 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
Interactive Disk Cleanup
Overview
Systematically scan macOS disk usage across all known bloat categories, present findings, and let the user pick exactly what to delete using AskUserQuestion. Never delete without explicit user approval per item.
Core principle: Scan everything, present clearly, let the user decide. Use AskUserQuestion tool for EVERY deletion decision — never assume.
Scan Order
Run all scans in parallel where possible for speed.
Phase 1: Overview
# Overall disk state
df -h /
diskutil apfs list | grep -E "Capacity|Size" | head -6
# Top-level user directories
du -sh ~/Library/Caches ~/Library/Developer ~/Library/Application\ Support ~/Library/Containers ~/Library/Logs ~/Downloads ~/Documents ~/Desktop ~/Movies ~/Pictures 2>/dev/nullPhase 2: Known Bloat Categories
Scan these categories in parallel. Present results as a summary table with sizes.
1. Caches (~5-20 GB typical)
du -sh ~/Library/Caches/* 2>/dev/null | sort -rh | head -15Common large caches: go-build, browser caches, Playwright, app updater ShipIt caches, gopls, node-gyp
2. Docker (~5-20 GB typical)
docker system df 2>/dev/nullLook for: reclaimable images, unused volumes (often 90%+ reclaimable), build cache
3. Xcode/Developer (~5-15 GB typical)
du -sh ~/Library/Developer/Xcode/DerivedData ~/Library/Developer/Xcode/iOS\ DeviceSupport ~/Library/Developer/CoreSimulator 2>/dev/null
xcrun simctl runtime list 2>/dev/nullLook for: DerivedData (always safe to clear), old iOS DeviceSupport, unused simulator runtimes (often 15-20 GB each)
4. Homebrew (~5-25 GB typical)
# Package sizes
brew list --formula | while read f; do echo "$(du -sh $(brew --prefix)/Cellar/$f 2>/dev/null)"; done | sort -rh | head -20
# Top-level packages (not dependencies)
brew leaves
# What depends on large packages
brew uses --installed <package>Look for: Unused large packages (qt, llvm, opencv chains), old Python versions, packages for tools no longer used
5. Application Support (~10-60 GB typical)
ls -d ~/Library/"Application Support"/*/ 2>/dev/null | while read d; do du -sh "$d" 2>/dev/null; done | sort -rh | head -20Look for: IDE data (Cursor, VS Code), chat apps (Zalo, Slack, Lark), browser profiles (Arc), screen recorders (Cap)
6. Containers (~5-25 GB typical)
du -sh ~/Library/Containers/* 2>/dev/null | sort -rh | head -10Look for: Docker container data, old app containers
7. Dev Tool Directories (~5-15 GB typical)
du -sh ~/.cargo ~/.rustup ~/.npm ~/.nvm ~/.bun ~/.pyenv ~/go ~/.gradle ~/.m2 ~/miniconda3 ~/.conda ~/.cache ~/.local 2>/dev/nullLook for: Unused language toolchains (Rust, old Node versions), stale caches
8. Project Artifacts (often largest — 10-50 GB)
# node_modules across all projects
find ~/Documents -maxdepth 4 -name "node_modules" -type d -exec du -sh {} \; 2>/dev/null | sort -rh
# Python venvs
find ~/Documents -maxdepth 4 -type d \( -name ".venv" -o -name "venv" \) -exec du -sh {} \; 2>/dev/null | sort -rh
# Large .git directories
find ~/Documents -maxdepth 3 -name ".git" -type d -exec du -sh {} \; 2>/dev/null | sort -rh | head -15node_modules and venvs are always safe to delete — restorable with npm install / pip install.
9. System Data
# iOS Simulator runtimes (often 15-20 GB EACH)
xcrun simctl runtime list
# Nix store (if unused)
du -sh /nix 2>/dev/null
# Time Machine snapshots
tmutil listlocalsnapshots /
# Temp directories
du -sh /private/var/folders/*/*/* 2>/dev/null | sort -rh | head -10
# Claude Code temp (can grow to 30+ GB from runaway tasks)
du -sh /private/tmp/claude-* 2>/dev/null10. Stale App Data
Cross-reference ls /Applications/ against data in ~/Library/Application Support/, ~/Library/Caches/, ~/Library/Containers/ to find remnants from uninstalled apps.
ls /Applications/ | sort
# Then check for data from apps NOT in /Applications/
# Common: PyCharm, IntelliJ, WebStorm, GoLand remnants
find ~/Library -maxdepth 3 -iname "*pycharm*" -o -iname "*intellij*" -o -iname "*webstorm*" -o -iname "*goland*" 2>/dev/nullPresentation Format
After scanning, present a summary table:
| Category | Size | Recoverable | Notes |
|-----------------------|--------|-------------|--------------------------------|
| Docker volumes | 8.5 GB | ~8 GB | 93% reclaimable |
| Xcode DerivedData | 4.7 GB | ~4.7 GB | Always safe, rebuilds on demand|
| iOS Simulator 17.0.1 | 15 GB | ~15 GB | Old runtime |
| node_modules (12 dirs)| 9.4 GB | ~9.4 GB | Always restorable |
| ... | | | |Deletion Flow
CRITICAL: Always use AskUserQuestion for deletion decisions.
Safe bulk operations (still ask first)
For categories where everything is safe to delete (caches, DerivedData), ask once:
AskUserQuestion: "Clear all Xcode DerivedData? (4.7 GB — always rebuilds on demand)"
Options: Delete / KeepPer-item decisions
For project artifacts (node_modules, venvs) and app data, ask per item. Batch up to 4 questions per AskUserQuestion call:
AskUserQuestion (4 questions):
1. "Delete NewAI/project-a/node_modules? (1.2 GB)"
2. "Delete NewAI/project-b/node_modules? (800 MB)"
3. "Delete indie-hacker/project-c/.venv? (500 MB)"
4. "Delete indie-hacker/project-d/.venv? (300 MB)"
Each with: Delete / Keep optionsAfter each batch
- Execute deletions for approved items immediately
- Move to next batch
After all deletions
Run df -h / and show before/after comparison.
Cleanup Commands Reference
| Category | Command | Needs sudo? |
| Docker full prune | docker system prune -a --volumes -f | No |
| Go build cache | go clean -cache | No |
| Xcode DerivedData | rm -rf ~/Library/Developer/Xcode/DerivedData/* | No |
| iOS DeviceSupport | rm -rf ~/Library/Developer/Xcode/iOS\ DeviceSupport/* | No |
| Simulator runtimes | xcrun simctl runtime delete <name> | No |
| Unavailable simulators | xcrun simctl delete unavailable | No |
| Homebrew cleanup | brew cleanup --prune=all && brew autoremove | No |
| Homebrew uninstall | brew uninstall <pkg> (check brew uses --installed <pkg> first) | No |
| Playwright cache | rm -rf ~/Library/Caches/ms-playwright* | No |
| Rust full remove | rustup self uninstall -y | No |
| Nix volume delete | diskutil apfs deleteVolume <disk> | May need sudo |
| Claude Code temp | rm -rf /private/tmp/claude-* or specific large .output files | May need sudo |
| Cursor sandbox cache | rm -rf /private/var/folders/.../T/cursor-sandbox-cache | May need sudo |
Common Mistakes
- Deleting Claude Desktop vm_bundles (~11 GB) — it's the active runtime VM, will just re-download
- Deleting Cursor state.vscdb — active database, will corrupt Cursor
- Not checking
brew uses --installedbefore uninstalling — may break dependencies - Force-deleting /nix — it's on the read-only system volume, use
diskutil apfs deleteVolumefor the Nix Store volume instead - Skipping /private/tmp/claude-*/ — runaway Claude Code background tasks can create 30+ GB output files
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.

