disk-cleanup
/disk-cleanup
Audit disk usage and reclaim space on macOS and NixOS hosts without losing live or personal data. Use when a disk is full or nearly full, when asked to free space or find what is using it, or before removing build outputs, caches, scratch copies, or agent worktrees in bulk.
- Author
- hakula139 ↗
- Repository
- plugins ↗
- Licence
- MIT
- Last repository change
- 12.11.2026
Assessment and security
- Files in this package
- 2
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 12.11.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
What it does and when to use it
Audit disk usage and reclaim space on macOS and NixOS hosts without losing live or personal data. Use when a disk is full or nearly full, when asked to free space or find what is using it, or before removing build outputs, caches, scratch copies, or agent worktrees in bulk.
Original author description
Audit disk usage and reclaim space on macOS and NixOS hosts without losing live or personal data. Use when a disk is full or nearly full, when asked to free space or find what is using it, or before removing build outputs, caches, scratch copies, or agent worktrees in bulk.
How it works
- Measure
- Classify
- Clean
SKILL.md preview
--- name: disk-cleanup description: >- Audit disk usage and reclaim space on macOS and NixOS hosts without losing live or personal data. Use when a disk is full or nearly full, when asked to free space or find what is using it, or before removing build outputs, caches, scratch copies, or agent worktrees in bulk. --- # Disk Cleanup Measure and classify every large item. Remove only what is safe, then report the space freed using before-and-after numbers. ## Measure Start by running `df -h` on the affected volumes. On macOS, `df` excludes purgeable space, and APFS local snapshots retain deleted files until they are thinned, so also run `tmutil listlocalsnapshots /`. Then use `du -sh` to size the usual heavy spots, staying on one filesystem with `-x` and sorting the output: | Location | How to size it | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ | | `/private/tmp` (macOS) or `/tmp` | `du -xsh /private/tmp/* \| sort -h`. Agents often leave Cargo target dirs and review copies here | | Agent worktrees: Claude Code's `.claude/worktrees/*` in each repository, Codex's `~/.codex/worktrees/*`, OMP's `~/.omp/wt/*`, and Workmux's configured `worktree_dir` | `du -sh` on each worktree and its `target/`, `node_modules/`, or `result*` outputs | | `~/.cache/uv`, `~/.npm`, `~/.cargo/registry`, and the directories that `pnpm store path` and `brew --cache` print | `du -sh` on each path | | Nix store | `nix store gc --dry-run` lists what garbage collection would delete | | Docker | `docker system df` | If the numbers don't add up, investigate further, starting with `du -xh -d 1 ~ | sort -h`. ## Classify Before deleting anything, sort every large item into a group: - **Safe**: Regenerable output that nothing is using, such as stale build targets, package-manager caches, unused Docker images, dead store paths, and `/tmp` entries from finished work. - **Needs the user's decision**: Anything whose loss the user would notice or that requires privileges you don't have, including personal app data such as VMs, chat app media, and game libraries, APFS local snapshots, dirty or unmerged worktrees, and anything you can't attribute to a known tool. - **Keep**: Anything modified recently, anything a live process holds open or uses as its working directory, sockets, and runtime dirs such as `tmux-*` and `claude-*`. Check whether a candidate is in use before treating it as safe. `find <path> \( -mtime -1 -o -ctime -1 \) -print -quit` prints a path if anything inside changed within the past day, while `lsof +D <path>` lists processes holding files open or using a directory inside it. Another agent may be using a worktree or scratch copy, so leave the candidate alone if its owner is unclear. ## Clean - **Build output**: Run `cargo clean` in the project or worktree that owns a `target/`. Remove a target dir outside any project, such as one in `/tmp`, directly. - **Caches**: `uv cache clean`, `pnpm store prune`, `npm cache clean --force`, and `brew cleanup --prune=all`. - **Docker**: `docker image prune -a -f` removes images that no container uses. Leave volumes to the user because they hold data. - **Nix store**: `sudo nix-collect-garbage --delete-older-than 3d`, or `nh clean all --keep 5 --keep-since 3d` where `nh` is installed, deletes older system generations and collects their garbage while keeping recent rollbacks. It requires sudo, so give the command to the user. The user's own profile generations need the same `nix-collect-garbage` command run without sudo. - **Local snapshots**: `tmutil deletelocalsnapshots <date>` frees space used by a snapshot. It requires the user's decision and sudo, so give them the command too. - **Agent worktrees**: Use the `clean-gone` skill to remove finished agent worktrees, preserving branch bookkeeping and useful local contents. Show the user the sizes and exact commands for items in the "needs the user's decision" group, then wait for them to choose. Report the space freed using a fresh `df -h`, and note that a local snapshot may keep the space unavailable until thinned.
Files in this package (2)
- SKILL.md 5 KB
- agents/openai.yaml 1 KB
Versions
| Repository | Score | Licence |
|---|---|---|
| This page · hakula139/plugins | 100 | MIT |
| yonatangross/orchestkit | 100 | MIT |
| glebis/claude-skills | 100 | MIT |
| inline-chat/inline | 100 | AGPL-3.0 |
| moonlight-lupin/agent-skills | 100 | MIT |
| mtarcure/claude-vibe-squad | 100 | MIT |
| DaraBoth/skilljmskill | 98 | MIT |
| sasugadayo/disk-cleanup-skill | 98 | MIT |
| SamueleGuerrini/disk-cleanup-skill | 93 | MIT |
Database snapshot: 13.11.2026 · package version fb805cde68b9 (SHA-256 digest of the entire package)
Downloads in the last 30 days: 3 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 100yc-disk-cleanup
Reclaim disk space on a developer Mac or Linux machine without losing data — measure what is actually large, classify each item by what deleting it costs, ask per item, then clean only what was named through each tool's own command. Use when the disk is full or nearly full, the… - 100disk-reclaim
Diagnose disk usage and reclaim space on a Mac or an SSH-reachable Linux dev host. Use for disk-full errors, storage audits, or cleanup requests. Starts with a bounded read-only survey, protects active development and services, and verifies actual filesystem capacity gained. - 100cleanup-worktree-disk
Reclaim macOS disk space by removing git worktrees whose PRs are already merged (plus their branches and Bazel output bases) and by deleting orphaned Bazel output bases whose workspace directory no longer exists. Use whenever the user is low on disk, says "clean up disk space",… - 100macos-disk-usage
macOS disk-usage forensics and space recovery on APFS. Use when df reports a disk near-full, hunting what's eating space, reclaiming OrbStack/Docker, or pruning caches and local snapshots. - 100pro-disk-cleanup
Find and clear reclaimable disk space safely on any macOS, Windows or Linux machine and stack: read-only scan, three tiers (safe, decide, keep), closed-issue worktrees with backup, build output, caches, Docker. Use for 'disk is full', 'free up space'. - 100linux-disk-usage
Linux disk-usage forensics and space recovery. Use when a Linux disk is near-full, finding what eats space, or clearing caches, build dirs and model stores.