clean
Skill2 starsChanged 3 months agoMITView on GitHub
Free up disk space by removing dev environment junk — Claude temp, OS temp, browser caches, node_modules, npm/pnpm/yarn caches, .next builds, Python caches, pip, and VS Code cache. Works on Windows, macOS, and Linux. Use "super" argument for interactive deep-clean mode that discovers hidden space hogs and asks before deleting anything.
- Deletes or force-pushes
7 other projects use a version of this.
Adopted by
Most recently taken up by
- flavien-ia/hypervibe-harnesstheir own version, first seen Oct 4, 2026
- ConnorGriffin/skillstheir own version, first seen Aug 29, 2026
- mystilleef/spae-frameworktheir own version, first seen Aug 4, 2026
- OutThisLife/brooklyn-skillstheir own version, first seen Jul 23, 2026
- RektTillNoon/alpha-skillstheir own version, first seen May 7, 2026
- bergside/awesome-design-skillstheir own version, first seen Apr 24, 2026
Other versions7 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 7
- bergside/awesome-design-skills★ 3.1ksame name
- OutThisLife/brooklyn-skills★ 197same name
- flavien-ia/hypervibe-harness★ 44same name
- ConnorGriffin/skills★ 22same name
- OpenAnalystInc/10x-analyst★ 4same name
- RektTillNoon/alpha-skills★ 4same name
- mystilleef/spae-framework★ 1same 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.
The file
Show its rules and text
We split this skill into the rules it gives an agent
19 rules. 0 are common, 15 are distinctive, and 4 are very specific to this project.
0
Common
Most of the 7 edited versions we read keep these.
15
Distinctive
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 22
If no argument is given, ask the user before doing anything:
- Distinctive: line 36
Wait for their answer, then proceed to the matching mode below.
- Distinctive: line 48
Run these two commands and record the values for use in every step below:
- Very specific: line 82
Use the du result as the reported size — do not try to read output after deletion, the file may be gone.
- Distinctive: line 143
If a browser cache path returns 0 or does not exist, note it as "not installed / not found" — do not silently skip.
- Distinctive: line 151
Run a single combined find for all three targets.
- Very specific: line 162
Delete all found paths: rm -rf
- Distinctive: line 165
Do not re-run this find a second time.
- Very specific: line 215
Add all individual du results together for the reported total.
- Distinctive: line 221
Only print the summary after ALL steps above have completed and all results are in hand.
- Very specific: line 247
Use the du measurements collected before each deletion as the source of truth — not disk delta, which is unreliable when operations overlap.
- Distinctive: line 259
Run all discovery silently first.
- Distinctive: line 357
After scanning, present a numbered list sorted by size (largest first).
- Distinctive: line 406
Wait for the user's response before proceeding.
- Distinctive: line 412
If the user approves items marked "Review first" for deletion, ask a follow-up before acting:
- Distinctive: line 418
Never skip this step for "Review first" items.
- Distinctive: line 424
Before deleting anything, show exactly what will be removed:
- Distinctive: line 443
Wait for "yes" before deleting anything.
- Distinctive: line 449
Delete only approved items.
“Common” is measured: kept by at least 6 in 10 of the 7 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
/clean — Dev Environment Cleanup
Frees disk space across your dev environment. Works on Windows, macOS, and Linux.
Arguments: $ARGUMENTS
- (none) — ask the user whether they want Quick or Super mode
quick— full standard cleanup, no questions askedsuper— interactive deep-clean: discovers everything, user approves before anything is deleted
No Argument — Ask First
If no argument is given, ask the user before doing anything:
How would you like to clean?
quick — fast cleanup of known junk (caches, temp, node_modules, builds)
no questions, runs immediately
super — deep scan of everything on your system, ranked by size
you decide what goes and what stays before anything is deleted
Type "quick" or "super":Wait for their answer, then proceed to the matching mode below.
Quick Mode (/clean quick)
Rule: always measure size BEFORE deleting. Never delete first and report after — sizes will be wrong or unavailable.
Step 0 — Detect environment
Run these two commands and record the values for use in every step below:
uname -s 2>/dev/null || echo "Windows"
echo $HOMEResolve OS-specific variables:
- Windows:
HOME=$USERPROFILE,TMPDIR=$LOCALAPPDATA/Temp,APPDATA,LOCALAPPDATA - macOS:
HOME=$HOME,TMPDIR=$TMPDIR - Linux:
HOME=$HOME,TMPDIR=/tmp
Project roots to scan (use whichever exist):
$HOME/Documents, $HOME/Projects, $HOME/code, $HOME/dev, current directory
Record baseline disk free now — use this exact command, once, and store the result:
df -h / 2>/dev/null || df -h "$HOME"Step 1 — Claude temp dir
Measure size first using du, then delete contents:
# measure
du -sh "$TMPDIR/claude" 2>/dev/null || echo "0"
# delete contents only, not the directory itself
rm -rf "$TMPDIR/claude/"* 2>/dev/nullUse the du result as the reported size — do not try to read output after deletion, the file may be gone.
Step 2 — OS temp (files > 10 MB)
Measure before deleting:
# Windows — find .tmp files > 10 MB, measure total, then delete
find "$LOCALAPPDATA/Temp" -maxdepth 1 \( -name "*.tmp" -size +10M \) 2>/dev/null | xargs du -sh 2>/dev/null
find "$LOCALAPPDATA/Temp" -maxdepth 1 \( -name "*.tmp" -size +10M \) -exec rm -rf {} + 2>/dev/null
# macOS / Linux — files > 10 MB older than 7 days
find "$TMPDIR" -maxdepth 1 -size +10M -atime +7 -type f 2>/dev/null | xargs du -ch 2>/dev/null | tail -1
find "$TMPDIR" -maxdepth 1 -size +10M -atime +7 -type f -delete 2>/dev/nullReport MB freed using the du total captured before deletion.
Step 3 — Browser caches
For each browser, measure the cache dir with du -sh first, then delete contents.
Chrome
| OS | Cache path |
| Windows | $LOCALAPPDATA/Google/Chrome/User Data/Default/Cache |
| macOS | $HOME/Library/Caches/Google/Chrome/Default/Cache |
| Linux | $HOME/.config/google-chrome/Default/Cache |
Also clean Code Cache and GPUCache subdirs where they exist.
Edge
| OS | Cache path |
| Windows | $LOCALAPPDATA/Microsoft/Edge/User Data/Default/Cache |
| macOS | $HOME/Library/Caches/Microsoft Edge/Default/Cache |
| Linux | $HOME/.config/microsoft-edge/Default/Cache |
Firefox
Firefox on Windows stores profiles in Roaming, not Local — check both:
| OS | Cache path |
| Windows | $APPDATA/Mozilla/Firefox/Profiles/*/cache2 AND $LOCALAPPDATA/Mozilla/Firefox/Profiles/*/cache2 |
| macOS | $HOME/Library/Caches/Firefox/Profiles/*/cache2 |
| Linux | $HOME/.mozilla/firefox/*/cache2 |
Pattern for each browser:
# measure
du -sh <cache-path> 2>/dev/null
# delete contents only (not the cache dir itself)
rm -rf <cache-path>/* 2>/dev/nullIf a browser cache path returns 0 or does not exist, note it as "not installed / not found" — do not silently skip.
Report MB freed per browser.
Step 4 — node_modules, .next builds, Python pycache
Run a single combined find for all three targets. Do not run three separate find commands — they will each take too long and background separately.
# Single pass: find all three target types across all project roots
find $HOME/Documents $HOME/Projects $HOME/code $HOME/dev \
\( -name "node_modules" -o -name ".next" -o -name "__pycache__" \) \
-type d -prune 2>/dev/nullOnce the list is returned:
- Measure total size for each type:
du -shon each found path, group by type - Delete all found paths:
rm -rf - Report count and MB freed per type
Do not re-run this find a second time. Use the results from this single pass for both measurement and deletion.
Step 5 — npm / pnpm / yarn cache
Measure each cache before clearing:
# npm
du -sh "$(npm config get cache 2>/dev/null)" 2>/dev/null
npm cache clean --force 2>/dev/null
# pnpm
du -sh "$(pnpm store path 2>/dev/null)" 2>/dev/null
pnpm store prune 2>/dev/null
# yarn
du -sh "$(yarn cache dir 2>/dev/null)" 2>/dev/null
yarn cache clean 2>/dev/nullReport MB freed per package manager. If a tool is not installed, skip silently.
Step 6 — VS Code cache
Measure each path individually before deleting. Do not use a subshell loop to accumulate sizes — variable changes inside subshells are lost to the parent shell. Use individual du calls instead:
| OS | Paths |
| Windows | $APPDATA/Code/Cache, $APPDATA/Code/CachedData, $APPDATA/Code/logs, $LOCALAPPDATA/Temp/vscode-* |
| macOS | $HOME/Library/Application Support/Code/Cache, CachedData, logs |
| Linux | $HOME/.config/Code/Cache, CachedData, logs |
# measure each path individually before deleting
du -sh "$APPDATA/Code/Cache" 2>/dev/null
du -sh "$APPDATA/Code/CachedData" 2>/dev/null
du -sh "$APPDATA/Code/logs" 2>/dev/null
du -sh "$LOCALAPPDATA/Temp/vscode-"* 2>/dev/null # glob, not subshell
# then delete
rm -rf "$APPDATA/Code/Cache/"* 2>/dev/null
rm -rf "$APPDATA/Code/CachedData/"* 2>/dev/null
rm -rf "$APPDATA/Code/logs/"* 2>/dev/null
rm -rf "$LOCALAPPDATA/Temp/vscode-"* 2>/dev/nullAdd all individual du results together for the reported total.
Step 7 — Final summary
Only print the summary after ALL steps above have completed and all results are in hand. Do not print a partial summary and update it later.
Take a final disk reading using the same command as Step 0:
df -h / 2>/dev/null || df -h "$HOME"Print one summary block:
/clean results
──────────────────────────────────────────
Claude temp: X MB
OS temp: X MB
Browser caches: X MB (Chrome X | Edge X | Firefox X)
node_modules: X MB (N folders)
npm/pnpm/yarn: X MB (npm X | pnpm X | yarn X)
.next builds: X MB (N folders)
Python cache: X MB (N folders)
VS Code cache: X MB
──────────────────────────────────────────
Total freed: X MB
Disk free before: X GB
Disk free now: X GBUse the du measurements collected before each deletion as the source of truth — not disk delta, which is unreliable when operations overlap.
Super Mode (/clean super)
Never delete anything without explicit user approval. The goal is to help the user free space without losing anything important.
Phase 1 — Scan Everything
Run all discovery silently first. Do not delete anything yet. Measure sizes. Collect results into a ranked list.
Scan the following, in addition to everything in quick mode:
Package manager caches
# Homebrew (macOS)
du -sh "$HOME/Library/Caches/Homebrew" 2>/dev/null
# Gradle
du -sh "$HOME/.gradle/caches" 2>/dev/null
# Maven
du -sh "$HOME/.m2/repository" 2>/dev/null
# Cargo (Rust)
du -sh "$HOME/.cargo/registry" "$HOME/.cargo/git" 2>/dev/null
# Go modules
du -sh "$HOME/go/pkg/mod" 2>/dev/null
# RubyGems
du -sh "$HOME/.gem" 2>/dev/null
# pip / pip3
pip cache info 2>/dev/nullDocker
docker system df 2>/dev/nullCaptures: stopped containers, dangling images, unused volumes, build cache.
IDE caches
# Xcode (macOS)
du -sh "$HOME/Library/Developer/Xcode/DerivedData" 2>/dev/null
du -sh "$HOME/Library/Developer/CoreSimulator/Devices" 2>/dev/null
# JetBrains (all IDEs)
du -sh "$HOME/Library/Caches/JetBrains" 2>/dev/null # macOS
du -sh "$LOCALAPPDATA/JetBrains" 2>/dev/null # Windows
du -sh "$HOME/.cache/JetBrains" 2>/dev/null # Linux
# Android SDK
du -sh "$HOME/.android/avd" 2>/dev/null
du -sh "$HOME/Library/Android/sdk/.temp" 2>/dev/nullLog files
find "$HOME" -name "*.log" -size +5M -not -path "*/node_modules/*" 2>/dev/null | head -30
find /var/log -name "*.log" -size +5M 2>/dev/null | head -20 # Linux/macOSLarge files (anywhere under home, > 100 MB)
find "$HOME" -size +100M -not -path "*/node_modules/*" -not -path "*/.git/*" -type f 2>/dev/null | head -20Downloads folder — large or old files
find "$HOME/Downloads" -size +50M -type f 2>/dev/null
find "$HOME/Downloads" -atime +90 -type f 2>/dev/null | head -20Trash / Recycle Bin
du -sh "$HOME/.Trash" 2>/dev/null # macOS
du -sh "$HOME/.local/share/Trash" 2>/dev/null # Linux
du -sh "/c/\$Recycle.Bin" 2>/dev/null # WindowsGit large objects
find "$HOME" -name "*.pack" -size +50M -path "*/.git/*" 2>/dev/null | head -10App media / recordings
du -sh "$HOME/Documents/Zoom" 2>/dev/null
du -sh "$HOME/Zoom" 2>/dev/null
du -sh "$HOME/Library/Application Support/Slack/Cache" 2>/dev/null # macOS
du -sh "$APPDATA/Slack/Cache" 2>/dev/null # Windows
du -sh "$APPDATA/Microsoft/Teams/Cache" 2>/dev/null # Windows
du -sh "$HOME/Library/Application Support/Microsoft/Teams/Cache" 2>/dev/null # macOSOld installers
find "$HOME/Downloads" \( -name "*.dmg" -o -name "*.pkg" -o -name "*.exe" -o -name "*.msi" \) 2>/dev/null | head -20Phase 2 — Present Findings
After scanning, present a numbered list sorted by size (largest first). Each item shows:
- Number, category, path/description, size, safety rating
Safety ratings:
- Safe — regenerated automatically, safe to delete
- Review first — user data, show filenames before deleting
- Keep if active — safe only if no active projects use it
Example format:
What's taking your space — ranked by size
═══════════════════════════════════════════════════════
# Category Detail Size Safety
───────────────────────────────────────────────────────
1 node_modules ~/Projects/app-one 4.2 GB Safe
2 Docker images 3 unused images 2.1 GB Safe
3 Xcode DerivedData ~/Library/Developer/Xcode/... 1.8 GB Safe
4 Gradle cache ~/.gradle/caches 1.1 GB Safe
5 node_modules ~/code/old-project 980 MB Safe
6 Downloads (old) 43 files not opened in 90d 870 MB Review first
7 Zoom recordings ~/Documents/Zoom 640 MB Review first
8 .next builds ~/Projects/app-one/.next 420 MB Safe
9 Cargo registry ~/.cargo/registry 380 MB Safe
10 Docker volumes 2 unused volumes 310 MB Safe
11 Large log files /var/log/*.log (6 files) 290 MB Safe
12 Browser caches Chrome + Edge + Firefox 240 MB Safe
13 Slack cache ~/AppData/Roaming/Slack/Cache 210 MB Safe
14 Go modules ~/go/pkg/mod 180 MB Keep if active
15 JetBrains cache ~/.cache/JetBrains 160 MB Safe
16 Claude temp /tmp/claude/ 120 MB Safe
17 OS temp /tmp/ files > 10 MB 95 MB Safe
18 Python __pycache__ 18 folders found 72 MB Safe
19 VS Code cache Cache + CachedData + logs 58 MB Safe
20 Maven repository ~/.m2/repository 45 MB Keep if active
───────────────────────────────────────────────────────
TOTAL FOUND: ~14.2 GB potentially recoverableThen ask:
Which items do you want to KEEP? (I won't touch these)
Enter numbers separated by commas — e.g. "6, 7, 14"
Or type "none" to approve everything above for deletion
Or type "all" to cancel and keep everything
Your answer:Wait for the user's response before proceeding.
Phase 3 — Clarify if needed
If the user approves items marked "Review first" for deletion, ask a follow-up before acting:
- Downloads: "These are files in your Downloads folder not opened in 90+ days. Want me to list the filenames so you can pick which ones to delete?"
- Zoom recordings: "These are your recorded meetings. Are you sure you want to delete them?"
- Large unknown files: show filenames and ask "Which of these do you want to delete?"
Never skip this step for "Review first" items.
Phase 4 — Final Confirmation
Before deleting anything, show exactly what will be removed:
Ready to delete — please confirm
═══════════════════════════════════════════════════════
Will delete:
✓ node_modules — ~/Projects/app-one (4.2 GB)
✓ Docker images — 3 unused images (2.1 GB)
...
Will keep (your choice):
✗ Downloads — old files (870 MB)
✗ Zoom recordings (640 MB)
Space to be freed: ~13.1 GB
Type "yes" to proceed, or "no" to cancel.Wait for "yes" before deleting anything.
Phase 5 — Execute
Delete only approved items. Report progress per item as it goes.
Phase 6 — Super Output
/clean super results
══════════════════════════════════════════════
[each deleted item and MB freed]
──────────────────────────────────────────────
Total freed: X GB
Disk free now: X GB
Kept by choice: X GB (your decision)
══════════════════════════════════════════════
Run /clean super again anytime to re-scan.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.

