disk-cleanup
Skill1 starsChanged 10 months agoMITView on GitHub
Use when disk space is low, the user wants to free space, or needs to find what's consuming storage. Safely identifies and removes unnecessary files.
- Deletes or force-pushes
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
- vndee/engineering-skills★ 3same name
- foogunlana/skills★ 1same name
- galonge/free-claude-skills★ 1same name
- shell-nlp/skills★ 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 repository9 other files it gives its agents.
- container-opsSkill
- incident-triageSkill
- log-analyzerSkill
- network-troubleshooterSkill
- performance-optimizerSkill
- security-auditorSkill
- service-monitorSkill
- ssl-checkerSkill
- system-diagnosticsSkill
The file
We split this skill into the rules it gives an agent
10 rules. 0 are common, 10 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 6 edited versions we read keep these.
10
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 32
Check each category and calculate reclaimable space:
- Distinctive: line 121
Wait for user confirmation
- Distinctive: line 139
After cleanup, re-run disk check and show comparison:
- Distinctive: line 152
NEVER delete user documents, photos, videos, or project files
- Distinctive: line 153
NEVER empty trash without asking (user might want something back)
- Distinctive: line 154
ALWAYS show what will be deleted before acting
- Distinctive: line 155
ALWAYS ask permission before each cleanup category
- Distinctive: line 156
Start with zero-risk items (temp, caches) before anything else
- Distinctive: line 157
If disk is >95% full, flag as CRITICAL and prioritize
- Distinctive: line 158
Don't delete logs that might be needed for ongoing troubleshooting
“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
Disk Cleanup
Overview
Identify disk space consumers and safely reclaim storage. Prioritizes safe, reversible cleanup actions and always shows what will be deleted before acting.
Process
Step 1: Assess Current Disk State
Overall disk usage:
| Platform | Command |
| Windows | Get-CimInstance Win32_LogicalDisk | Select DeviceID, @{N='Size(GB)';E={[math]::Round($_.Size/1GB,1)}}, @{N='Free(GB)';E={[math]::Round($_.FreeSpace/1GB,1)}}, @{N='Used%';E={[math]::Round(($_.Size-$_.FreeSpace)/$_.Size*100,1)}} |
| Linux | df -h | grep -v tmpfs |
| macOS | df -h | grep -v devfs |
Identify largest directories:
| Platform | Command |
| Windows | Get-ChildItem C:\ -Directory -ErrorAction SilentlyContinue | ForEach-Object { $size = (Get-ChildItem $_.FullName -Recurse -File -ErrorAction SilentlyContinue | Measure-Object -Property Length -Sum).Sum; [PSCustomObject]@{Path=$_.FullName; 'Size(GB)'=[math]::Round($size/1GB,2)} } | Sort 'Size(GB)' -Descending | Select -First 10 |
| Linux | du -sh /* 2>/dev/null | sort -rh | head -15 |
| macOS | du -sh /* 2>/dev/null | sort -rh | head -15 |
Step 2: Identify Cleanup Candidates
Check each category and calculate reclaimable space:
Temporary files:
| Platform | Location | Command |
| Windows | User temp | (Get-ChildItem $env:TEMP -Recurse -File -ErrorAction SilentlyContinue | Measure-Object Length -Sum).Sum / 1MB |
| Windows | System temp | (Get-ChildItem C:\Windows\Temp -Recurse -File -ErrorAction SilentlyContinue | Measure-Object Length -Sum).Sum / 1MB |
| Linux | /tmp | du -sh /tmp |
| Linux | /var/tmp | du -sh /var/tmp |
| macOS | User caches | du -sh ~/Library/Caches |
Package manager caches:
| Platform | Command to check | Command to clean |
| Windows (Chocolatey) | du -sh C:\ProgramData\chocolatey\cache 2>/dev/null | choco cache remove |
| npm | npm cache ls 2>/dev/null || du -sh ~/.npm/_cacache | npm cache clean --force |
| pip | pip cache info 2>/dev/null | pip cache purge |
| apt | du -sh /var/cache/apt/archives | apt clean |
| yum/dnf | du -sh /var/cache/yum 2>/dev/null || du -sh /var/cache/dnf | yum clean all |
| Homebrew | du -sh $(brew --cache) | brew cleanup |
| Composer | composer clearcache --dry-run 2>/dev/null | composer clearcache |
Container/Docker waste:
# Docker disk usage
docker system df 2>/dev/null
# Dangling images
docker images -f "dangling=true" -q 2>/dev/null | wc -l
# Stopped containers
docker ps -a -f "status=exited" -q 2>/dev/null | wc -l
# Unused volumes
docker volume ls -f "dangling=true" -q 2>/dev/null | wc -lLog files:
| Platform | Command |
| Windows | Get-ChildItem C:\ -Recurse -Include *.log -File -ErrorAction SilentlyContinue | Where-Object {$_.Length -gt 100MB} | Select FullName, @{N='Size(MB)';E={[math]::Round($_.Length/1MB)}} |
| Linux | find /var/log -type f -size +100M -exec ls -lh {} \; 2>/dev/null |
| Linux | journalctl --disk-usage |
Old downloads:
| Platform | Command |
| Windows | Get-ChildItem $env:USERPROFILE\Downloads -File | Where-Object {$_.LastWriteTime -lt (Get-Date).AddDays(-30)} | Measure-Object Length -Sum | Select @{N='Size(MB)';E={[math]::Round($_.Sum/1MB)}} |
| Linux/Mac | find ~/Downloads -type f -mtime +30 -exec du -ch {} + 2>/dev/null | tail -1 |
Trash/Recycle Bin:
| Platform | Command |
| Windows | (New-Object -ComObject Shell.Application).NameSpace(0x0a).Items() | Measure-Object -Property Size -Sum | Select @{N='Size(MB)';E={[math]::Round($_.Sum/1MB)}} |
| Linux | du -sh ~/.local/share/Trash 2>/dev/null |
| macOS | du -sh ~/.Trash 2>/dev/null |
Step 3: Present Cleanup Plan
## Disk Cleanup Plan
### Current State
- Drive [X]: [used]GB / [total]GB ([percent]% used)
- Status: [OK / WARNING / CRITICAL]
### Reclaimable Space
| Category | Size | Risk | Action |
|----------|------|------|--------|
| Temp files | [X] MB | None | Delete all |
| Package caches | [X] MB | None | Clear cache |
| Docker unused | [X] MB | Low | Prune dangling |
| Old logs | [X] MB | Low | Rotate/truncate |
| Old downloads (>30d) | [X] MB | Medium | Review first |
| Trash/Recycle | [X] MB | Medium | Empty |
| [Other] | [X] MB | [risk] | [action] |
| **Total reclaimable** | **[X] GB** | | |
### Recommended Order
1. [Safest first - temp, caches]
2. [Low risk - docker, logs]
3. [Medium risk - ask user]Step 4: Execute Cleanup (with permission)
For each approved action:
- Show exactly what will be deleted
- Show the command
- Wait for user confirmation
- Execute
- Report space recovered
Safe cleanup commands:
| Action | Windows | Linux/macOS |
| User temp | Remove-Item $env:TEMP\* -Recurse -Force -ErrorAction SilentlyContinue | rm -rf /tmp/* 2>/dev/null |
| System temp | Remove-Item C:\Windows\Temp\* -Recurse -Force -ErrorAction SilentlyContinue | N/A |
| npm cache | npm cache clean --force | npm cache clean --force |
| pip cache | pip cache purge | pip cache purge |
| apt cache | N/A | sudo apt clean |
| Docker prune | docker system prune -f | docker system prune -f |
| Journal logs | N/A | sudo journalctl --vacuum-size=100M |
Step 5: Verify Results
After cleanup, re-run disk check and show comparison:
### Cleanup Results
| Metric | Before | After | Recovered |
|--------|--------|-------|-----------|
| Used space | [X] GB | [Y] GB | [Z] GB |
| Free space | [X] GB | [Y] GB | +[Z] GB |
| Usage % | [X]% | [Y]% | -[Z]% |Rules
- NEVER delete user documents, photos, videos, or project files
- NEVER empty trash without asking (user might want something back)
- ALWAYS show what will be deleted before acting
- ALWAYS ask permission before each cleanup category
- Start with zero-risk items (temp, caches) before anything else
- If disk is >95% full, flag as CRITICAL and prioritize
- Don't delete logs that might be needed for ongoing troubleshooting
- Warn before deleting Docker volumes (may contain data)
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.

