Mac Disk Reclaim
Two phases: discover (read-only) then interactive delete (confirm each, direct delete).
macOS only. The scanner never surfaces user data — Documents, Photos, Mail, Keychains,
Containers app data, iCloud, the system volume are off-limits. It deletes nothing itself.
Phase 1 — Discover
python3 scripts/scan_reclaimable.py --json # --min-mb N raises the floor (default 200)
It does not rely on a fixed path list. It finds bloat by category, including the
distributed kind a "largest folders" scan misses (each item moderate, sum huge):
build — node_modules / target / build / dist / .next / .venv / pycache across every project
cache — tool + Electron app caches (Cache / Code Cache / GPUCache under Application Support)
browser-cache — Chrome/Brave/Vivaldi/Firefox caches
agent — Claude/Codex conversation history & log DBs (permanent — review)
ai-models — ollama / Hugging Face weights (re-downloadable, large)
git-gc — bloated .git objects → git gc (repacks, loses nothing)
worktree — git worktrees whose branch is already merged → git worktree remove
dsstore — thousands of .DS_Store files
trash — ~/.Trash and per-volume .Trashes
Each finding carries size, risk (low/med), and a one-line consequence (desc):
what regenerates vs what is lost for good. Also returns a snapshot_note for Time
Machine local snapshots. Tell the user the total and the top items first.
Phase 2 — Interactive delete (largest first)
Each finding carries key and remembered (delete / skip / null). Choices
persist in ~/.config/mac-disk-reclaim/decisions.json (never swept by this skill),
so a later run only asks about new items.
First, split findings by remembered (and reconfirm):
remembered: "delete" and reconfirm: false — previously approved, safely
regenerates. Reclaim each (step 4) without re-asking; state count + total up front
so the user can abort.
remembered: "delete" and reconfirm: true — approved before but lossy
(med-risk, or a --volumes prune). Always re-ask anyway; memory never
auto-runs an irreversible command.
remembered: "skip" — previously declined. Do not touch, do not ask. Mention the
count only.
remembered: null — new. Ask interactively (below).
For each new item, in size order:
- Show:
size · category · path, the desc consequence, and the risk. For
risk: med (agent history, AI models) state plainly it does not come back.
- Ask: delete / skip / stop. Wait. Never batch.
- Persist the choice so the next run skips it:
python3 scripts/decisions.py set "<key>" delete --path "<path>" --category "<category>"
python3 scripts/decisions.py set "<key>" skip --path "<path>" --category "<category>"
- On
delete, reclaim it:
Deletion is direct and permanent — not Trash. Confirm the user knows this once, up front.
- Report freed space, continue.
Finish by offering the snapshot_note command (sudo tmutil thinlocalsnapshots …).
Memory controls: --no-memory on the scan reviews everything fresh; decisions.py list shows saved choices; decisions.py forget <key> / --all clears them.
Swap
Swap cannot be flushed on a running Mac. /private/var/vm swapfiles are
kernel-managed (encrypted on Apple Silicon); deleting them risks a panic. sudo purge
frees inactive RAM, not swap. Only a reboot clears swap. Report this; never offer to touch it.
Notes
- The scan uses only
du/find (always present). For faster discovery the user can
brew install dust; for a turnkey cleaner, mac-cleanup-py — but neither does this
skill's per-item-confirmed direct delete.
- Never delete anything the scanner did not surface; never hand a typed path to
safe_delete.py.
- If
safe_delete.py blocks a path, do not work around it.
1---2name: mac-disk-reclaim3description: Discover and reclaim wasted SSD space on macOS, then delete it interactively with the consequences spelled out. Finds bloat by what it is, wherever it lives — build/dep dirs (node_modules, target, .venv, DerivedData) scattered across every project, package/tool caches, Electron app caches buried under Application Support, AI agent history (Claude/Codex logs), bloated .git objects, merged git worktrees, .DS_Store swarms, per-volume trash, Time Machine local snapshots. Walks findings largest-first and, only after the user confirms each one, deletes it directly (NOT to Trash) — telling the user up front what regenerates vs what is gone forever. Remembers each delete/skip choice so reruns only ask about newly-found items. Use when the user is low on disk/SSD space, wants to free space, clean a Mac, purge caches, or remove build/dependency bloat.4---56# Mac Disk Reclaim78Two phases: **discover** (read-only) then **interactive delete** (confirm each, direct delete).910macOS only. The scanner never surfaces user data — Documents, Photos, Mail, Keychains,11Containers app data, iCloud, the system volume are off-limits. It deletes nothing itself.1213## Phase 1 — Discover1415```bash16python3 scripts/scan_reclaimable.py --json # --min-mb N raises the floor (default 200)17```1819It does not rely on a fixed path list. It finds bloat by category, including the20**distributed** kind a "largest folders" scan misses (each item moderate, sum huge):2122- `build` — node_modules / target / build / dist / .next / .venv / __pycache__ across every project23- `cache` — tool + Electron app caches (Cache / Code Cache / GPUCache under Application Support)24- `browser-cache` — Chrome/Brave/Vivaldi/Firefox caches25- `agent` — Claude/Codex conversation history & log DBs (**permanent — review**)26- `ai-models` — ollama / Hugging Face weights (re-downloadable, large)27- `git-gc` — bloated `.git` objects → `git gc` (repacks, loses nothing)28- `worktree` — git worktrees whose branch is already **merged** → `git worktree remove`29- `dsstore` — thousands of `.DS_Store` files30- `trash` — `~/.Trash` and per-volume `.Trashes`3132Each finding carries `size`, `risk` (low/med), and a one-line **consequence** (`desc`):33what regenerates vs what is lost for good. Also returns a `snapshot_note` for Time34Machine local snapshots. Tell the user the total and the top items first.3536## Phase 2 — Interactive delete (largest first)3738Each finding carries `key` and `remembered` (`delete` / `skip` / `null`). Choices39persist in `~/.config/mac-disk-reclaim/decisions.json` (never swept by this skill),40so **a later run only asks about new items.**4142First, split findings by `remembered` (and `reconfirm`):4344- `remembered: "delete"` **and `reconfirm: false`** — previously approved, safely45 regenerates. Reclaim each (step 4) without re-asking; state count + total up front46 so the user can abort.47- `remembered: "delete"` **and `reconfirm: true`** — approved before but lossy48 (med-risk, or a `--volumes` prune). **Always re-ask** anyway; memory never49 auto-runs an irreversible command.50- `remembered: "skip"` — previously declined. Do not touch, do not ask. Mention the51 count only.52- `remembered: null` — **new.** Ask interactively (below).5354For **each new** item, in size order:55561. Show: `size · category · path`, the `desc` consequence, and the `risk`. For57 `risk: med` (agent history, AI models) state plainly it does not come back.582. Ask: delete / skip / stop. Wait. Never batch.593. Persist the choice so the next run skips it:60 ```bash61 python3 scripts/decisions.py set "<key>" delete --path "<path>" --category "<category>"62 python3 scripts/decisions.py set "<key>" skip --path "<path>" --category "<category>"63 ```644. On `delete`, reclaim it:65 - `method: cmd` → run the item's `cmd` (the tool's own cleanup, e.g.66 `git gc`, `git worktree remove`, `brew cleanup --prune=all`,67 `docker system prune -af --volumes`, `find ~ -name .DS_Store -delete`).68 - `method: rm` → delete through the guard (refuses danger paths):69 ```bash70 python3 scripts/safe_delete.py "<path>" --yes71 ```72 Deletion is **direct and permanent — not Trash.** Confirm the user knows this once, up front.735. Report freed space, continue.7475Finish by offering the `snapshot_note` command (`sudo tmutil thinlocalsnapshots …`).7677Memory controls: `--no-memory` on the scan reviews everything fresh; `decisions.py78list` shows saved choices; `decisions.py forget <key>` / `--all` clears them.7980## Swap8182Swap **cannot** be flushed on a running Mac. `/private/var/vm` swapfiles are83kernel-managed (encrypted on Apple Silicon); deleting them risks a panic. `sudo purge`84frees inactive RAM, not swap. Only a reboot clears swap. Report this; never offer to touch it.8586## Notes8788- The scan uses only `du`/`find` (always present). For faster discovery the user can89 `brew install dust`; for a turnkey cleaner, `mac-cleanup-py` — but neither does this90 skill's per-item-confirmed direct delete.91- Never delete anything the scanner did not surface; never hand a typed path to `safe_delete.py`.92- If `safe_delete.py` blocks a path, do not work around it.