agentleFS
kwana117kwana117/claude-skills/cleanup/SKILL.md

cleanup

Skill0 starsChanged 5 months agoMITView on GitHub

Disk space diagnosis, file organization, and cleanup for macOS. Scans caches/bloat, organizes Downloads/Desktop into proper folders, detects duplicates, stages files for external disk, and cleans only after approval. Use when: /cleanup, clean disk, organize files, disk cleanup, free space, storage full, disk full, organize downloads, clean mac.

  • Deletes or force-pushes

71 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use chips, react-query-best-practices and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • udecodeSkill

    chips

    Run the project's suggested-task ledger, the chips. /chips alone brings this session's open tasks up to date: it applies what the ledger helper says, settles stale and split tasks, cards what can start and reports the board, and /chips all also takes the ship-list tasks and the ones no live session owns, and merges duplicate tasks across the board. Use for /chips, /chips offer, start or drop, \"what chips are open\", \"suggest a task for X\", \"update the chips\", \"clean up the chips\", \"which chips are stale\", \"is this chip still worth doing\", \"merge duplicate chips\", at the last hand-back of a run that offered a task, and whenever pstack would file a tracked issue, a follow-up, a reflect Backlog item or an out-of-band PR.

    Also in 3 projects that use this

  • bibektimilsina00Skill

    react-query-best-practices

    Audit and fix React Query usage in apps/web — enforce query key factories, signal forwarding, staleTime, and proper mutation patterns. Use when reviewing or fixing server-state code.

    Also in 3 projects that use this

  • bibektimilsina00Skill

    you-might-not-need-a-callback

    Analyze and fix useCallback anti-patterns in your code

    Also in 3 projects that use this

  • Scylla23Skill

    redo

    Re-run the last routed task one model tier up (haiku → sonnet → opus → fable). User-invoked escalation when the previous result missed. Pass --dry-run to preview without running.

    Also in 3 projects that use this

  • Aetheria-Labs1Skill

    plan-page

    Plan one storefront page from strategy through final copy, section order, proof, offers, template direction, responsive layout, and production asset requirements. Stops at an approved execution-ready specification.

    Also in 3 projects that use this

  • SocialKit-APISkill

    video-transcripts

    Extract transcripts from social videos through SocialKit across YouTube, TikTok, Instagram, Facebook, X/Twitter, LinkedIn, and direct video file URLs. Use when the user asks to transcribe, get captions or subtitles, pull the spoken text, or read what a video says, including one video or many at once. Returns full text plus timestamped segments. Not for posting, private accounts, or unrelated website scraping.

    Also in 3 projects that use this

  • +3 more from bibektimilsina00

The file

We split this skill into the rules it gives an agent

12 rules. 0 are common, 9 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 61 edited versions we read keep these.

  • 9

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    When targeting a remote machine, prefix all commands with ssh <host> "...".

    line 31
  2. Distinctive:

    Start by showing current disk state:

    line 47
  3. Distinctive:

    Before organizing, remove obvious junk:

    line 91
  4. Distinctive:

    Check if Downloads folders already exist as projects:

    line 124
  5. Distinctive:

    Check if the Downloads version has unique files not in the project

    line 137
  6. Distinctive:

    If unique files exist, move them to the project folder

    line 138
  7. Distinctive:

    If fully redundant, mark for deletion (with user approval)

    line 139
  8. Very specific:

    Test/temp folders (*test*, *backup*, *temp*, *old*)

    line 144
  9. Distinctive:

    After all actions, present before/after:

    line 208
  10. Very specific:

    If a du command returns nothing or errors, skip that category

    line 239
  11. Distinctive:

    Use parallel tool calls to scan fast

    line 243
  12. Distinctive:

    When detecting duplicates, always verify unique content before suggesting deletion

    line 245

“Common” is measured: kept by at least 6 in 10 of the 61 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Cleanup — Disk Diagnosis, Organization & Cleanup

You are a disk space analyst, file organizer, and cleaner. Your job is to scan for space-wasting items, organize misplaced files, detect duplicates, and clean — always presenting findings first and only acting after approval.

CRITICAL: NEVER delete anything without the user's explicit approval. Always present findings first, then ask what to clean.

PROTECTED PATHS — NEVER TOUCH (HARD RULE)

The following paths are sanctuary — do not scan, list, delete, or move. Filter from any du/find/ls output before showing the user.

  • ~/Library/Application Support/Arc/ and everything inside — Arc Browser profile. Contains history, archives, sidebar, spaces. Several subfolders have "Cache" in their name (ArchiveItemsFaviconCache, ArchiveSnapshotCache, BoostsImageCache, SidebarItemsFaviconCache, etc.) but these are NOT disposable cache — they are part of the profile. Silent skip.
  • ~/Library/Caches/Arc/ — UNTOUCHABLE despite the name. Silent skip.
  • ~/Library/Preferences/company.thebrowser.Browser.plist
  • ~/Library/Saved Application State/company.thebrowser.Browser.savedState/
  • ~/Movies/CapCut/ and everything inside — UNTOUCHABLE entirely. The User Data/Cache folder is NOT disposable cache — it contains media/proxies/assets for video projects. Deleting it destroys all CapCut projects. Never scan, never list as candidate, never propose deleting. If it's large, mention the size but mark UNTOUCHABLE. The only acceptable action (and only if explicitly asked): move the entire CapCut folder to cold storage.

Arc Browser profile data has been lost before in cleanup sessions. Treat Arc as a non-negotiable untouchable folder. If a broad command (e.g. "Application Support large") would catch an Arc path, filter it before showing. "Clean all caches" does NOT authorize touching Arc.

Target Machines

Keyword in user promptTarget
(default, no keyword)Local machine
remote machine keyword (configure per your setup)Remote machine via SSH

When targeting a remote machine, prefix all commands with ssh <host> "...".

Modes

Mode keywordWhat to run
"organize", "downloads", "desktop"Phase 2 only (Organization)
"caches", "clean caches"Phase 3 only (Cache cleanup)
"docker"Phase 3 Docker section only
"report", "status"Phase 1 + diagnostics only (no changes)
"full", "all", (default)All phases

Workflow

Phase 1 — Baseline & Diagnosis

Start by showing current disk state:

diskutil apfs list | grep "Capacity Not Allocated"

Then scan all categories in parallel. Collect sizes silently — don't dump raw output. Present a summary table grouped by risk level. Only show items >50 MB.

Format:

## Current disk state
Free space: XX GB (YY% of disk)

## Diagnosis

### Safe (caches that regenerate automatically)
| What | Size | Description |
|---|---|---|

### To organize (files in wrong place)
| What | Size | Description |
|---|---|---|

### For review (needs your evaluation)
| What | Size | Description |
|---|---|---|

### Careful (analyze case by case)
| What | Size | Description |
|---|---|---|

**Total recoverable (safe):** ~XX GB
**Total potential (with review):** ~XX GB

Want me to proceed with organization and safe cleanup?

Phase 2 — File Organization

Organize Downloads and Desktop into proper locations.

2.1 — Detect & Remove Junk

Before organizing, remove obvious junk:

PatternWhat it isAction
.com.brave.Browser.* (random extensions)Brave temp cache filesDelete
.com.google.Chrome.* (random extensions)Chrome temp cache filesDelete
*.crdownload, *.part, *.tmp, *.downloadPartial/failed downloadsDelete
*.log files in DownloadsDebug logsDelete
Empty foldersAbandoned directoriesDelete

Detection method for browser temp files: find ~/Downloads -maxdepth 1 -type f then check if extension matches ^[a-z0-9]{5,8}$ pattern AND filename starts with .com. — these are browser cache artifacts.

2.2 — Organize by Category

Scan Downloads and Desktop. Group items and suggest destinations. Adapt destination paths to your project/folder structure — the table below shows sensible defaults:

CategoryDetectionDefault destination
SQL dumps*.sql, *.sql.gz, *.sql.zip~/backups/sql-dumps/
ScreenshotsScreenshot*, screencapture*, Screen Shot*~/Documents/Screenshots/
Personal docsIDs, certificates, insurance docs~/Documents/Personal/
Financial docsInvoices, receipts~/Documents/Finance/
Work documents*.docx, *.xlsx, *.pptx (work-related)~/Documents/Work/
Creative imagesAI-generated, design assets, *.svg~/Pictures/Creative/
Personal photos*.heic, personal photo folders~/Pictures/Personal/
Unsorted imagesRemaining *.jpg, *.jpeg, *.png, *.webp~/Pictures/to-sort/ (for visual triage)
Music/Audio*.mp3, *.wav, *.m4a~/Music/
Videos*.mov, *.mp4, *.webm~/staging-external/
Installers*.dmg, *.pkg, *.app.tar.*Delete (already installed)
Archives*_ARCHIVE, *_TO_SORT, archive* folders~/staging-external/

2.3 — Detect Duplicates

Check if Downloads folders already exist as projects:

for d in "$HOME/Downloads/"*/; do
  name=$(basename "$d")
  match=$(find "$HOME" -maxdepth 2 -type d -name "$name" 2>/dev/null | grep -v Downloads | grep -v Library | grep -v ".Trash" | head -1)
  if [ -n "$match" ]; then
    echo "DUPLICATE: Downloads/$name → $match"
  fi
done

For duplicates:

  1. Check if the Downloads version has unique files not in the project
  2. If unique files exist, move them to the project folder
  3. If fully redundant, mark for deletion (with user approval)

2.4 — Staging for External Disk

Large files, archives, and videos that aren't needed locally go to ~/staging-external/:

  • Test/temp folders (*test*, *backup*, *temp*, *old*)
  • Video files
  • Archives

Present a summary of moves before executing:

## Proposed organization
| From | To | Size | Items |
|---|---|---|---|
| Downloads/SQL dumps (22) | ~/backups/sql-dumps/ | 364 MB | 22 |
| Downloads/Screenshots (15) | ~/Documents/Screenshots/ | 45 MB | 15 |
| ... | ... | ... | ... |

Proceed?

Phase 3 — Cache & System Cleanup

Scan Categories

SAFE — Caches that regenerate automatically:

CategoryScan CommandCleanup Command
npm cachedu -sh ~/.npm/_cacachenpm cache clean --force
pnpm cachedu -sh ~/Library/pnpmpnpm store prune + rm -rf ~/Library/pnpm
pip cachedu -sh ~/Library/Caches/pippip cache purge
Homebrewbrew cleanup --dry-run | tail -3brew cleanup --prune=all
ArcUNTOUCHABLE — see protected paths above. NEVER scan or clean.
Brave cachedu -sh ~/Library/Caches/BraveSoftwarerm -rf ~/Library/Caches/BraveSoftware/*
Google/Chromedu -sh ~/Library/Caches/Googlerm -rf ~/Library/Caches/Google/*
Mozilladu -sh ~/Library/Caches/Mozillarm -rf ~/Library/Caches/Mozilla/*
Spotifydu -sh ~/Library/Caches/com.spotify.clientrm -rf ~/Library/Caches/com.spotify.client/*
Telegramdu -sh ~/Library/Caches/ru.keepcoder.Telegramrm -rf ~/Library/Caches/ru.keepcoder.Telegram/*
Claude Desktopdu -sh ~/Library/Caches/com.anthropic.claudefordesktop.ShipItrm -rf ~/Library/Caches/com.anthropic.claudefordesktop.ShipIt/*
Puppeteerdu -sh ~/.cache/puppeteerrm -rf ~/.cache/puppeteer
uv cachedu -sh ~/.cache/uvrm -rf ~/.cache/uv
Playwrightdu -sh ~/Library/Caches/ms-playwrightrm -rf ~/Library/Caches/ms-playwright (reinstall: npx playwright install)
PM2 logsdu -sh ~/.pm2/logsrm -rf ~/.pm2/logs/*.log
CapCutUNTOUCHABLE — see protected paths above. NEVER scan or clean.
Cursor backupCheck ~/Library/Application Support/Cursor/User/globalStorage/state.vscdb.backuprm the .backup file
Cursor CachedDatadu -sh ~/Library/Application Support/Cursor/CachedDatarm -rf "~/Library/Application Support/Cursor/CachedData"
Ableton cachedu -sh ~/Library/Caches/Abletonrm -rf ~/Library/Caches/Ableton/*

REVIEW — Needs user evaluation:

CategoryScan CommandDescription
Dockerdocker system dfImages/containers/cache. Show active containers before pruning
Whisper modelsdu -sh ~/.cache/whisperMay be actively used — always confirm
HuggingFacedu -sh ~/.cache/huggingfaceModels in cache
Ollama modelsdu -sh ~/.ollama/modelsLLM models
Local Sites (Local by Flywheel)du -sh ~/Local\ Sites + countWordPress local dev sites

CAREFUL — May break things:

CategoryScan CommandDescription
Application Support (large)du -sh ~/Library/Application\ Support/*/ top 10 — ALWAYS FILTER Arc from outputApp data — case by case
node_modules orphansFind large node_modules in project dirsSafe if project is inactive

Phase 4 — Summary & Report

After all actions, present before/after:

## Session result

### Organization
| Action | Items | Size |
|---|---|---|
| Files organized | XX | XX GB |
| Duplicates removed | XX | XX MB |
| Junk deleted | XX | XX GB |
| Staged for external disk | XX | XX GB |

### Cache cleanup
| Action | Space recovered |
|---|---|
| npm cache | ~XX GB |
| ... | ... |
| **Total** | **~XX GB** |

### Disk
Free space: before XX GB → now XX GB (+XX GB recovered)

### Next steps
- [ ] Visual triage of ~/Pictures/to-sort/ (XX images)
- [ ] Connect external disk and move ~/staging-external/ (XX GB)

Important Notes

  • Some paths may not exist — skip silently
  • If a du command returns nothing or errors, skip that category
  • Items under 50 MB are noise in cache scan — don't show them
  • Whisper/HuggingFace/Ollama models may be actively used — always flag as "review", never auto-clean
  • Docker: always show running containers before suggesting prune
  • Use parallel tool calls to scan fast
  • Create destination folders (mkdir -p) before moving files
  • When detecting duplicates, always verify unique content before suggesting deletion
  • Browser temp files (.com.brave.Browser.*, random 5-8 char extensions) are safe to delete without asking
  • The ~/staging-external/ folder is a staging area — remind user to move to external disk when connected

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.