[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M77XKV0SRY5DDFMRSQZJPTYD":3,"skill-same:01M77XKV0SRY5DDFMRSQZJPTYD":93},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":30,"install":31,"resources":44},"01M77XKV0SRY5DDFMRSQZJPTYD","vs-disk-cleanup",null,"Free disk space left behind by coding agents: stale git worktrees (t3code, Codex, Claude Code), old vs session artifacts under ~\u002F.vs, and home-folder dev leftovers. Removes only provably safe items and asks about the rest. Use when the user says \u002Fvs-disk-cleanup, cleanup\u002Fprune\u002Fremove worktrees, orphaned worktrees, clean ~\u002F.vs, old vs reports or videos, out of disk space, disk full, no space left, free up space, or disk cleanup.","vltansky\u002Fvs","vltansky","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F5851280?v=4","01M77XJAE230PB81N52XJHT5A1","Vlad Tansky","01M77XJAET1CMBAZ2TWTT4ZQT8",0,"MIT","https:\u002F\u002Fgithub.com\u002Fvltansky\u002Fvs\u002Fblob\u002Fmaster\u002Fskills\u002Fvs-disk-cleanup\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: vs-disk-cleanup\ndescription: \"Free disk space left behind by coding agents: stale git worktrees (t3code, Codex, Claude Code), old vs session artifacts under ~\u002F.vs, and home-folder dev leftovers. Removes only provably safe items and asks about the rest. Use when the user says \u002Fvs-disk-cleanup, cleanup\u002Fprune\u002Fremove worktrees, orphaned worktrees, clean ~\u002F.vs, old vs reports or videos, out of disk space, disk full, no space left, free up space, or disk cleanup.\"\n---\n\n# Disk Cleanup\n\nAgent worktrees and session artifacts pile up fast (tens of GB). Delete only what is recoverable; everything else is the user's call.\n\nWhen running bundled scripts, first resolve this skill directory and use it as\n`$VS_DISK_CLEANUP_DIR`. In this repository the source path is\n`skills\u002Fvs-disk-cleanup`; in an installed agent runtime, use the installed\nskill directory exposed by that runtime.\n\nReport in the shape defined by\n[`..\u002Fvs-internal-shared\u002Freferences\u002Foutput-style.md`](..\u002Fvs-internal-shared\u002Freferences\u002Foutput-style.md).\n\n## Entry points\n\n| User names | Start at |\n|---|---|\n| worktrees | step 1 |\n| `~\u002F.vs`, vs reports, videos, artifacts | step 3 |\n| home folder, dev leftovers, disk space in general | step 6 (its report already covers worktrees and `~\u002F.vs` as review items) |\n| plain \"cleanup\" | step 1, then 3; offer 4 and 6 only if space is still tight |\n\n## 1. Inventory worktrees (read-only)\n\n```bash\nbash \"$VS_DISK_CLEANUP_DIR\u002Fscripts\u002Finventory.sh\" > \"\u003Cscratchpad>\u002Fwt.tsv\"; df -h \u002FSystem\u002FVolumes\u002FData\n```\n\n- Options: `DAYS=7` (idle threshold) and `WT_ROOTS=\"dir1 dir2\"` (override the scanned roots). The script prints TSV columns: `status path branch last_activity reason`.\n- Use `\u002FSystem\u002FVolumes\u002FData`, not `\u002F`, for disk numbers on macOS. On APFS, `\u002F` is the sealed system volume and its free-space figure is misleading.\n- It is slow because of `lsof` and many repos. Run it with a long timeout (300s+) or in the background, and **don't add `du`** to the same command, since `du` over 70G times out.\n\n| Status | Rule | Action |\n|---|---|---|\n| `SAFE` | no tracked changes, 0 commits missing from remotes, idle >= DAYS, no process cwd inside, untracked files are only junk (`node_modules`, `build\u002F`, `.playwright-mcp\u002F`, logs...), no gitignored secrets (`.env*`, keys) | remove |\n| `BUSY` | some process has its cwd inside | never touch |\n| `RECENT` | last commit, or the newest changed or untracked non-junk file, within DAYS. The worktree root's own mtime doesn't count: any tool writing at the root bumps it | never touch |\n| `DECIDE` | uncommitted changes, unpushed commits, real untracked files (ADRs, prototypes, docs, an uncommitted `.vs\u002Fverify-map\u002F`), or gitignored secrets | ask the user |\n\n## 2. Remove the SAFE worktrees\n\nIf there are 0 SAFE rows, skip this step.\n\nThe user asking to \"cleanup\" counts as consent for `SAFE` rows only. Before removing anything, state the list you are about to remove.\n\n```bash\nawk -F'\\t' '$1==\"SAFE\"{print $2}' \"\u003Cscratchpad>\u002Fwt.tsv\" | bash \"$VS_DISK_CLEANUP_DIR\u002Fscripts\u002Fremove.sh\"\n```\n\n`remove.sh` re-runs the full classification from `checks.sh` on each path and skips anything that is no longer SAFE, then runs `git worktree remove --force`. It then deletes the local branch, which stays recoverable from the remote, runs `git worktree prune` on each main repo, and prints the MB freed. Use it rather than hand-written `rm`, because removing the directory alone leaves the branch and the git metadata behind.\n\n## 3. vs session artifacts (`~\u002F.vs`)\n\nvs skills write reports, videos, prototypes and evidence to `~\u002F.vs\u002F\u003Cproject>\u002F\u003Ckind>\u002F`. Most are one-session renderings; a few kinds are durable records later runs read back.\n\n```bash\nbash \"$VS_DISK_CLEANUP_DIR\u002Fscripts\u002Fvs-artifacts.sh\" > \"\u003Cscratchpad>\u002Fvs.tsv\"; du -sh ~\u002F.vs\n```\n\n- Options: `DAYS=30` (idle threshold, by newest file mtime) and `VS_HOME` (default `~\u002F.vs`). TSV columns: `status kb last_used path reason`.\n- Render kinds are listed per entry, so one recent report doesn't shield stale ones beside it. All other kinds are listed as one row per kind dir.\n\n| Status | Rule | Action |\n|---|---|---|\n| `STALE` | entry in a render kind (`videos`, `vs-show-me`, `build-it`, `ship-it`, `qa-reports`, `prototypes`, `explanations`, `eli5`, `reviews`, `verification`, `pushback`, `steals`, `thread-analysis`, `briefs`, `vs-octocode`, `pr-\u003CN>`), idle >= DAYS | move to Trash |\n| `RECENT` | render-kind entry used within DAYS | never touch |\n| `KEEP` | durable kind (`specs`, `rfcs`, `issues`, `context`, `improve`) or a regression `baseline.json`\u002F`baseline.png` | never offered |\n| `REVIEW` | `sessions\u002F` handoffs, `perf\u002F` baselines, unknown kinds, loose files | ask the user |\n\nThe user asking to clean `~\u002F.vs` (or a plain \"cleanup\") counts as consent for `STALE` rows only. State the count and total MB by kind, largest first, then run:\n\n```bash\nawk -F'\\t' '$1==\"STALE\"{print $4}' \"\u003Cscratchpad>\u002Fvs.tsv\" | bash \"$VS_DISK_CLEANUP_DIR\u002Fscripts\u002Fvs-artifacts.sh\" --remove\n```\n\n- `--remove` re-classifies each path, refuses anything outside `~\u002F.vs\u002F\u003Cproject>\u002F` or not `STALE` right now, and refuses a whole render-kind dir (it would sweep baselines). It moves entries to Trash (`trash`, else `~\u002F.Trash`), then deletes the kind and project dirs left empty.\n- Say that space frees only after Trash is emptied, and never empty Trash yourself.\n- Never delete `KEEP` rows. A spec or RFC is a decision record; losing it is not recoverable by re-running a skill.\n\n## 4. Slim DECIDE worktrees (when disk is still tight)\n\n`node_modules`, `.cache` and native build dirs make up most of a worktree's size. Deleting them keeps every commit, change and untracked file, so it needs no per-worktree approval. But they just rebuild, so **propose it rather than doing it by default**. Offer only worktrees idle for 14 days or more (`DAYS=14` inventory), state the dry-run size, and run it on a yes:\n\n```bash\nawk -F'\\t' '$1==\"DECIDE\"{print $2}' \"\u003Cscratchpad>\u002Fwt.tsv\" | bash \"$VS_DISK_CLEANUP_DIR\u002Fscripts\u002Fslim.sh\"\n```\n\n- Add `--dry-run` to list the sizes without deleting anything.\n- The script deletes only paths that `git check-ignore` confirms are ignored, and it skips worktrees that are BUSY. Never run it on RECENT or BUSY rows, because they may be in use.\n- Deleting millions of files takes more than 10 minutes. Always run it in the background, then wait for the final `deleted N dirs; freed:` line.\n- Expect to free about half of what `--dry-run`\u002F`du` reports. pnpm hard-links files from its store, so `du` counts space that deleting doesn't free.\n- `SKIP not-ignored ...\u002Fnode_modules` lines are expected. Some repos commit `node_modules` as test fixtures.\n- Tell the user they need `pnpm install` (or the repo's package manager) before working in a slimmed worktree again.\n\n## 5. Report\n\n- Report the MB freed and the free space before and after, plus MB moved to Trash from `~\u002F.vs`.\n- Show a table of `DECIDE` worktrees grouped by reason (uncommitted N \u002F unpushed N \u002F untracked files \u002F secrets), sorted by size, largest first. Measure them with `du -sk` on the DECIDE paths only.\n- Call out `unpushed=N (upstream gone, likely merged)` rows separately. These branches were usually squash-merged, so they are the easiest ones to approve. The unpushed count uses local remote refs (no `git fetch`), so it can be stale.\n- List `REVIEW` rows from `~\u002F.vs` with size and last used.\n- Offer options for `DECIDE` rows; don't act on them yet:\n  - Save first, then remove: `... | bash \"$VS_DISK_CLEANUP_DIR\u002Fscripts\u002Fremove.sh\" --backup \u003Cdir>`. For each DECIDE row it writes `\u003Cdir>\u002F\u003Cparent>-\u003Cname>.patch` (`git diff HEAD --binary`) and `.files.tgz` (untracked files plus ignored secrets, no `node_modules`). It then removes the worktree and keeps the local branch, so unpushed commits stay in the main repo. Without `--backup`, DECIDE rows are skipped.\n  - Push the unpushed branch, then remove.\n  - Remove anyway: needs explicit user approval per group.\n- If space is still tight, go to step 6 instead of ad-hoc `du`.\n\n## 6. Dev-leftovers report (beyond worktrees)\n\nRead-only scan of the home folder: sizes only (`du`, `stat` mtimes), never file contents. It skips iCloud, Photos, external drives and TCC-protected folders (Desktop\u002FDocuments\u002FDownloads, Mail, Messages, Safari, app Containers, Trash), so it raises no permission prompts.\n\n```bash\nnode \"$VS_DISK_CLEANUP_DIR\u002Fscripts\u002Fdisk-report\u002Fscan.mts\"   # ~6 min; run in the background\n```\n\n- It reads `~\u002Fdisk-report\u002Fsizes.csv` first, then appends this scan's rows. It flags items that grew by at least 100 MB and 5% since the previous scan. Lead the report with those, excluded ones included: they explain where space goes even though they are never offered.\n- Reuse: if `~\u002Fdisk-report\u002Flatest.json` has a `scannedAt` less than 1 hour old and nothing was deleted since, reuse it instead of rescanning.\n- It writes `~\u002Fdisk-report\u002Findex.html`: a treemap plus tables with path, size, last used and what happens if deleted. Ticking items there generates `cleanup.sh`. It also writes `~\u002Fdisk-report\u002Flatest.json`, which `cleanup.mts` reads.\n- Grouping rules:\n  - **Excluded, never offered:** whole package-manager caches (npm, Yarn, pnpm, uv, pip, Gradle, CocoaPods, Cargo, Go, Bun, Homebrew, node-gyp, Electron). They refill on the next install. Also any *safe* item touched in the last 14 days (`ACTIVE_DAYS`), meaning it is in use and would just rebuild. Both stay in the CSV for growth tracking.\n  - **Prune items, offered even while active:** the stale parts of those caches. `pnpm store prune` and `uv cache prune` (drop only unreferenced entries, often a fraction of the size shown), npx envs unused 30+ days, Yarn Berry zips unused 60+ days, Gradle versions (cache plus wrapper) no build ran for 30+ days, the newest kept. Also Codex update leftovers older than a day: `.codex\u002F.tmp\u002Fmarketplaces\u002F.staging\u002F*`, `marketplace-backup-*` and `.cache\u002Fcodex-runtimes\u002Fcodex-runtime-install-*`. Codex never deletes these, and they reach tens of GB.\n  - **Let me review first:** sessions, models and Docker always go here, along with worktrees, `~\u002F.vs` artifacts, simulators\u002FAVDs, runtimes and unknown tools' caches. This group needs explicit per-item approval.\n    - Colima: on each running profile, the clean command prunes stopped containers and unused images (`docker image prune -a`), then runs `fstrim` in the VM. The VM disk is a sparse file, so a prune without `fstrim` frees nothing on the Mac. Volumes are kept, and stopped profiles only get a `colima delete \u003Cprofile>` suggestion. Before asking, list each profile's images with `docker --context colima[-\u003Cprofile>] images`. Images that were built locally can't be pulled again.\n  - **Safe to remove:** stale, regenerable items (old project `node_modules`\u002Fbuild dirs, Xcode DerivedData, iOS DeviceSupport).\n- To remove, first show the item list with sizes, taken from `latest.json`. Once the user approves, generate the script with `--yes` (the y\u002FN prompt would abort in a background run) and run it. Each item uses its tool's own clean command; the `~\u002F.vs` item runs step 3's `vs-artifacts.sh` pipeline, never a whole-dir delete:\n  ```bash\n  node \"$VS_DISK_CLEANUP_DIR\u002Fscripts\u002Fdisk-report\u002Fcleanup.mts\" --group safe --yes > \"\u003Cscratchpad>\u002Fcleanup.sh\"   # or --ids a,b\n  bash \"\u003Cscratchpad>\u002Fcleanup.sh\"   # long: run in the background\n  ```\n  - `rm_regen` (safe items) deletes permanently, but inside a git repo it deletes only paths `git check-ignore` confirms, so committed `node_modules` are skipped.\n  - `rm_safe` (review items) moves to Trash. Say that space frees only after Trash is emptied.\n  - The script prints the MB freed. As with slim, expect less than `du` reports because of pnpm hard links.\n- Not dev, so not in the report: `~\u002FLibrary\u002FApplication Support\u002Fcom.apple.wallpaper` (Aerial wallpapers, tens of GB). Mention it if space is critical.\n\n## Gotchas\n\n- `git worktree remove` must run from the main repo. The script resolves it via `git rev-parse --git-common-dir`.\n- `--force` also deletes gitignored files. That is why the inventory checks `git status --ignored` for `.env*` and key files. It marks a worktree DECIDE only when such a file is missing from the main checkout or differs from it; byte-identical setup copies don't count.\n- An untracked `.vs\u002F` inside a worktree is not junk: `.vs\u002Fverify-map\u002F` is committed source-of-truth, so an uncommitted one is real work.\n- `BUSY` often means an idle shell or agent left running. Point that out, but never kill processes.\n- Detached-HEAD worktrees with 0 unpushed commits count as SAFE because their commit is already on a remote.\n- Paths under `~\u002F.codex\u002Fworktrees\u002F\u003Cid>\u002F` are left empty after removal. `remove.sh` deletes the empty parent dir.\n\n## Workflow\n\nDirect: emit **Next** only. Composed: return to caller.\n\n**Prev:** disk full | after a run of agent sessions\n**Next:** done\n**Relevant:** none\n","# Disk Cleanup\n\nAgent worktrees and session artifacts pile up fast (tens of GB). Delete only what is recoverable; everything else is the user's call.\n\nWhen running bundled scripts, first resolve this skill directory and use it as\n`$VS_DISK_CLEANUP_DIR`. In this repository the source path is\n`skills\u002Fvs-disk-cleanup`; in an installed agent runtime, use the installed\nskill directory exposed by that runtime.\n\nReport in the shape defined by\n[`..\u002Fvs-internal-shared\u002Freferences\u002Foutput-style.md`](..\u002Fvs-internal-shared\u002Freferences\u002Foutput-style.md).\n\n## Entry points\n\n| User names | Start at |\n|---|---|\n| worktrees | step 1 |\n| `~\u002F.vs`, vs reports, videos, artifacts | step 3 |\n| home folder, dev leftovers, disk space in general | step 6 (its report already covers worktrees and `~\u002F.vs` as review items) |\n| plain \"cleanup\" | step 1, then 3; offer 4 and 6 only if space is still tight |\n\n## 1. Inventory worktrees (read-only)\n\n```bash\nbash \"$VS_DISK_CLEANUP_DIR\u002Fscripts\u002Finventory.sh\" > \"\u003Cscratchpad>\u002Fwt.tsv\"; df -h \u002FSystem\u002FVolumes\u002FData\n```\n\n- Options: `DAYS=7` (idle threshold) and `WT_ROOTS=\"dir1 dir2\"` (override the scanned roots). The script prints TSV columns: `status path branch last_activity reason`.\n- Use `\u002FSystem\u002FVolumes\u002FData`, not `\u002F`, for disk numbers on macOS. On APFS, `\u002F` is the sealed system volume and its free-space figure is misleading.\n- It is slow because of `lsof` and many repos. Run it with a long timeout (300s+) or in the background, and **don't add `du`** to the same command, since `du` over 70G times out.\n\n| Status | Rule | Action |\n|---|---|---|\n| `SAFE` | no tracked changes, 0 commits missing from remotes, idle >= DAYS, no process cwd inside, untracked files are only junk (`node_modules`, `build\u002F`, `.playwright-mcp\u002F`, logs...), no gitignored secrets (`.env*`, keys) | remove |\n| `BUSY` | some process has its cwd inside | never touch |\n| `RECENT` | last commit, or the newest changed or untracked non-junk file, within DAYS. The worktree root's own mtime doesn't count: any tool writing at the root bumps it | never touch |\n| `DECIDE` | uncommitted changes, unpushed commits, real untracked files (ADRs, prototypes, docs, an uncommitted `.vs\u002Fverify-map\u002F`), or gitignored secrets | ask the user |\n\n## 2. Remove the SAFE worktrees\n\nIf there are 0 SAFE rows, skip this step.\n\nThe user asking to \"cleanup\" counts as consent for `SAFE` rows only. Before removing anything, state the list you are about to remove.\n\n```bash\nawk -F'\\t' '$1==\"SAFE\"{print $2}' \"\u003Cscratchpad>\u002Fwt.tsv\" | bash \"$VS_DISK_CLEANUP_DIR\u002Fscripts\u002Fremove.sh\"\n```\n\n`remove.sh` re-runs the full classification from `checks.sh` on each path and skips anything that is no longer SAFE, then runs `git worktree remove --force`. It then deletes the local branch, which stays recoverable from the remote, runs `git worktree prune` on each main repo, and prints the MB freed. Use it rather than hand-written `rm`, because removing the directory alone leaves the branch and the git metadata behind.\n\n## 3. vs session artifacts (`~\u002F.vs`)\n\nvs skills write reports, videos, prototypes and evidence to `~\u002F.vs\u002F\u003Cproject>\u002F\u003Ckind>\u002F`. Most are one-session renderings; a few kinds are durable records later runs read back.\n\n```bash\nbash \"$VS_DISK_CLEANUP_DIR\u002Fscripts\u002Fvs-artifacts.sh\" > \"\u003Cscratchpad>\u002Fvs.tsv\"; du -sh ~\u002F.vs\n```\n\n- Options: `DAYS=30` (idle threshold, by newest file mtime) and `VS_HOME` (default `~\u002F.vs`). TSV columns: `status kb last_used path reason`.\n- Render kinds are listed per entry, so one recent report doesn't shield stale ones beside it. All other kinds are listed as one row per kind dir.\n\n| Status | Rule | Action |\n|---|---|---|\n| `STALE` | entry in a render kind (`videos`, `vs-show-me`, `build-it`, `ship-it`, `qa-reports`, `prototypes`, `explanations`, `eli5`, `reviews`, `verification`, `pushback`, `steals`, `thread-analysis`, `briefs`, `vs-octocode`, `pr-\u003CN>`), idle >= DAYS | move to Trash |\n| `RECENT` | render-kind entry used within DAYS | never touch |\n| `KEEP` | durable kind (`specs`, `rfcs`, `issues`, `context`, `improve`) or a regression `baseline.json`\u002F`baseline.png` | never offered |\n| `REVIEW` | `sessions\u002F` handoffs, `perf\u002F` baselines, unknown kinds, loose files | ask the user |\n\nThe user asking to clean `~\u002F.vs` (or a plain \"cleanup\") counts as consent for `STALE` rows only. State the count and total MB by kind, largest first, then run:\n\n```bash\nawk -F'\\t' '$1==\"STALE\"{print $4}' \"\u003Cscratchpad>\u002Fvs.tsv\" | bash \"$VS_DISK_CLEANUP_DIR\u002Fscripts\u002Fvs-artifacts.sh\" --remove\n```\n\n- `--remove` re-classifies each path, refuses anything outside `~\u002F.vs\u002F\u003Cproject>\u002F` or not `STALE` right now, and refuses a whole render-kind dir (it would sweep baselines). It moves entries to Trash (`trash`, else `~\u002F.Trash`), then deletes the kind and project dirs left empty.\n- Say that space frees only after Trash is emptied, and never empty Trash yourself.\n- Never delete `KEEP` rows. A spec or RFC is a decision record; losing it is not recoverable by re-running a skill.\n\n## 4. Slim DECIDE worktrees (when disk is still tight)\n\n`node_modules`, `.cache` and native build dirs make up most of a worktree's size. Deleting them keeps every commit, change and untracked file, so it needs no per-worktree approval. But they just rebuild, so **propose it rather than doing it by default**. Offer only worktrees idle for 14 days or more (`DAYS=14` inventory), state the dry-run size, and run it on a yes:\n\n```bash\nawk -F'\\t' '$1==\"DECIDE\"{print $2}' \"\u003Cscratchpad>\u002Fwt.tsv\" | bash \"$VS_DISK_CLEANUP_DIR\u002Fscripts\u002Fslim.sh\"\n```\n\n- Add `--dry-run` to list the sizes without deleting anything.\n- The script deletes only paths that `git check-ignore` confirms are ignored, and it skips worktrees that are BUSY. Never run it on RECENT or BUSY rows, because they may be in use.\n- Deleting millions of files takes more than 10 minutes. Always run it in the background, then wait for the final `deleted N dirs; freed:` line.\n- Expect to free about half of what `--dry-run`\u002F`du` reports. pnpm hard-links files from its store, so `du` counts space that deleting doesn't free.\n- `SKIP not-ignored ...\u002Fnode_modules` lines are expected. Some repos commit `node_modules` as test fixtures.\n- Tell the user they need `pnpm install` (or the repo's package manager) before working in a slimmed worktree again.\n\n## 5. Report\n\n- Report the MB freed and the free space before and after, plus MB moved to Trash from `~\u002F.vs`.\n- Show a table of `DECIDE` worktrees grouped by reason (uncommitted N \u002F unpushed N \u002F untracked files \u002F secrets), sorted by size, largest first. Measure them with `du -sk` on the DECIDE paths only.\n- Call out `unpushed=N (upstream gone, likely merged)` rows separately. These branches were usually squash-merged, so they are the easiest ones to approve. The unpushed count uses local remote refs (no `git fetch`), so it can be stale.\n- List `REVIEW` rows from `~\u002F.vs` with size and last used.\n- Offer options for `DECIDE` rows; don't act on them yet:\n  - Save first, then remove: `... | bash \"$VS_DISK_CLEANUP_DIR\u002Fscripts\u002Fremove.sh\" --backup \u003Cdir>`. For each DECIDE row it writes `\u003Cdir>\u002F\u003Cparent>-\u003Cname>.patch` (`git diff HEAD --binary`) and `.files.tgz` (untracked files plus ignored secrets, no `node_modules`). It then removes the worktree and keeps the local branch, so unpushed commits stay in the main repo. Without `--backup`, DECIDE rows are skipped.\n  - Push the unpushed branch, then remove.\n  - Remove anyway: needs explicit user approval per group.\n- If space is still tight, go to step 6 instead of ad-hoc `du`.\n\n## 6. Dev-leftovers report (beyond worktrees)\n\nRead-only scan of the home folder: sizes only (`du`, `stat` mtimes), never file contents. It skips iCloud, Photos, external drives and TCC-protected folders (Desktop\u002FDocuments\u002FDownloads, Mail, Messages, Safari, app Containers, Trash), so it raises no permission prompts.\n\n```bash\nnode \"$VS_DISK_CLEANUP_DIR\u002Fscripts\u002Fdisk-report\u002Fscan.mts\"   # ~6 min; run in the background\n```\n\n- It reads `~\u002Fdisk-report\u002Fsizes.csv` first, then appends this scan's rows. It flags items that grew by at least 100 MB and 5% since the previous scan. Lead the report with those, excluded ones included: they explain where space goes even though they are never offered.\n- Reuse: if `~\u002Fdisk-report\u002Flatest.json` has a `scannedAt` less than 1 hour old and nothing was deleted since, reuse it instead of rescanning.\n- It writes `~\u002Fdisk-report\u002Findex.html`: a treemap plus tables with path, size, last used and what happens if deleted. Ticking items there generates `cleanup.sh`. It also writes `~\u002Fdisk-report\u002Flatest.json`, which `cleanup.mts` reads.\n- Grouping rules:\n  - **Excluded, never offered:** whole package-manager caches (npm, Yarn, pnpm, uv, pip, Gradle, CocoaPods, Cargo, Go, Bun, Homebrew, node-gyp, Electron). They refill on the next install. Also any *safe* item touched in the last 14 days (`ACTIVE_DAYS`), meaning it is in use and would just rebuild. Both stay in the CSV for growth tracking.\n  - **Prune items, offered even while active:** the stale parts of those caches. `pnpm store prune` and `uv cache prune` (drop only unreferenced entries, often a fraction of the size shown), npx envs unused 30+ days, Yarn Berry zips unused 60+ days, Gradle versions (cache plus wrapper) no build ran for 30+ days, the newest kept. Also Codex update leftovers older than a day: `.codex\u002F.tmp\u002Fmarketplaces\u002F.staging\u002F*`, `marketplace-backup-*` and `.cache\u002Fcodex-runtimes\u002Fcodex-runtime-install-*`. Codex never deletes these, and they reach tens of GB.\n  - **Let me review first:** sessions, models and Docker always go here, along with worktrees, `~\u002F.vs` artifacts, simulators\u002FAVDs, runtimes and unknown tools' caches. This group needs explicit per-item approval.\n    - Colima: on each running profile, the clean command prunes stopped containers and unused images (`docker image prune -a`), then runs `fstrim` in the VM. The VM disk is a sparse file, so a prune without `fstrim` frees nothing on the Mac. Volumes are kept, and stopped profiles only get a `colima delete \u003Cprofile>` suggestion. Before asking, list each profile's images with `docker --context colima[-\u003Cprofile>] images`. Images that were built locally can't be pulled again.\n  - **Safe to remove:** stale, regenerable items (old project `node_modules`\u002Fbuild dirs, Xcode DerivedData, iOS DeviceSupport).\n- To remove, first show the item list with sizes, taken from `latest.json`. Once the user approves, generate the script with `--yes` (the y\u002FN prompt would abort in a background run) and run it. Each item uses its tool's own clean command; the `~\u002F.vs` item runs step 3's `vs-artifacts.sh` pipeline, never a whole-dir delete:\n  ```bash\n  node \"$VS_DISK_CLEANUP_DIR\u002Fscripts\u002Fdisk-report\u002Fcleanup.mts\" --group safe --yes > \"\u003Cscratchpad>\u002Fcleanup.sh\"   # or --ids a,b\n  bash \"\u003Cscratchpad>\u002Fcleanup.sh\"   # long: run in the background\n  ```\n  - `rm_regen` (safe items) deletes permanently, but inside a git repo it deletes only paths `git check-ignore` confirms, so committed `node_modules` are skipped.\n  - `rm_safe` (review items) moves to Trash. Say that space frees only after Trash is emptied.\n  - The script prints the MB freed. As with slim, expect less than `du` reports because of pnpm hard links.\n- Not dev, so not in the report: `~\u002FLibrary\u002FApplication Support\u002Fcom.apple.wallpaper` (Aerial wallpapers, tens of GB). Mention it if space is critical.\n\n## Gotchas\n\n- `git worktree remove` must run from the main repo. The script resolves it via `git rev-parse --git-common-dir`.\n- `--force` also deletes gitignored files. That is why the inventory checks `git status --ignored` for `.env*` and key files. It marks a worktree DECIDE only when such a file is missing from the main checkout or differs from it; byte-identical setup copies don't count.\n- An untracked `.vs\u002F` inside a worktree is not junk: `.vs\u002Fverify-map\u002F` is committed source-of-truth, so an uncommitted one is real work.\n- `BUSY` often means an idle shell or agent left running. Point that out, but never kill processes.\n- Detached-HEAD worktrees with 0 unpushed commits count as SAFE because their commit is already on a remote.\n- Paths under `~\u002F.codex\u002Fworktrees\u002F\u003Cid>\u002F` are left empty after removal. `remove.sh` deletes the empty parent dir.\n\n## Workflow\n\nDirect: emit **Next** only. Composed: return to caller.\n\n**Prev:** disk full | after a run of agent sessions\n**Next:** done\n**Relevant:** none\n",{"name":5,"description":7},"master","72448991571c9e5f0e76cccf189b8522d442e6eb","skills\u002Fvs-disk-cleanup",1,"https:\u002F\u002Fgithub.com\u002Fvltansky\u002Fvs","https:\u002F\u002Fgithub.com\u002Fvltansky","2026-11-06 18:47:54",{"source":8,"skillName":5,"commands":32,"prompt":42,"zipAvailable":43},[33,36,39],{"tool":34,"command":35},"npx","npx skills add vltansky\u002Fvs --skill vs-disk-cleanup",{"tool":37,"command":38},"bunx","bunx skills add vltansky\u002Fvs --skill vs-disk-cleanup",{"tool":40,"command":41},"pnpm","pnpm dlx skills add vltansky\u002Fvs --skill vs-disk-cleanup","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fvltansky\u002Fvs\u002Fblob\u002Fmaster\u002Fskills\u002Fvs-disk-cleanup\u002FSKILL.md",true,[45,51,57,61,65,69,73,77,81,85,89],{"path":46,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":49,"sourceHtmlUrl":50},"agents\u002Fopenai.yaml","REFERENCE","参考文档",88,"https:\u002F\u002Fgithub.com\u002Fvltansky\u002Fvs\u002Fblob\u002Fmaster\u002Fskills\u002Fvs-disk-cleanup\u002Fagents\u002Fopenai.yaml",{"path":52,"resourceType":53,"resourceTypeDesc":54,"sizeBytes":55,"sourceHtmlUrl":56},"scripts\u002Fchecks.sh","SCRIPT","脚本",3560,"https:\u002F\u002Fgithub.com\u002Fvltansky\u002Fvs\u002Fblob\u002Fmaster\u002Fskills\u002Fvs-disk-cleanup\u002Fscripts\u002Fchecks.sh",{"path":58,"resourceType":53,"resourceTypeDesc":54,"sizeBytes":59,"sourceHtmlUrl":60},"scripts\u002Fdisk-report\u002Fcleanup-script.mjs",2110,"https:\u002F\u002Fgithub.com\u002Fvltansky\u002Fvs\u002Fblob\u002Fmaster\u002Fskills\u002Fvs-disk-cleanup\u002Fscripts\u002Fdisk-report\u002Fcleanup-script.mjs",{"path":62,"resourceType":53,"resourceTypeDesc":54,"sizeBytes":63,"sourceHtmlUrl":64},"scripts\u002Fdisk-report\u002Fcleanup.mts",1794,"https:\u002F\u002Fgithub.com\u002Fvltansky\u002Fvs\u002Fblob\u002Fmaster\u002Fskills\u002Fvs-disk-cleanup\u002Fscripts\u002Fdisk-report\u002Fcleanup.mts",{"path":66,"resourceType":53,"resourceTypeDesc":54,"sizeBytes":67,"sourceHtmlUrl":68},"scripts\u002Fdisk-report\u002Fscan.mts",24705,"https:\u002F\u002Fgithub.com\u002Fvltansky\u002Fvs\u002Fblob\u002Fmaster\u002Fskills\u002Fvs-disk-cleanup\u002Fscripts\u002Fdisk-report\u002Fscan.mts",{"path":70,"resourceType":53,"resourceTypeDesc":54,"sizeBytes":71,"sourceHtmlUrl":72},"scripts\u002Fdisk-report\u002Ftemplate.html",16619,"https:\u002F\u002Fgithub.com\u002Fvltansky\u002Fvs\u002Fblob\u002Fmaster\u002Fskills\u002Fvs-disk-cleanup\u002Fscripts\u002Fdisk-report\u002Ftemplate.html",{"path":74,"resourceType":53,"resourceTypeDesc":54,"sizeBytes":75,"sourceHtmlUrl":76},"scripts\u002Finventory.sh",929,"https:\u002F\u002Fgithub.com\u002Fvltansky\u002Fvs\u002Fblob\u002Fmaster\u002Fskills\u002Fvs-disk-cleanup\u002Fscripts\u002Finventory.sh",{"path":78,"resourceType":53,"resourceTypeDesc":54,"sizeBytes":79,"sourceHtmlUrl":80},"scripts\u002Fremove.sh",2742,"https:\u002F\u002Fgithub.com\u002Fvltansky\u002Fvs\u002Fblob\u002Fmaster\u002Fskills\u002Fvs-disk-cleanup\u002Fscripts\u002Fremove.sh",{"path":82,"resourceType":53,"resourceTypeDesc":54,"sizeBytes":83,"sourceHtmlUrl":84},"scripts\u002Fslim.sh",1363,"https:\u002F\u002Fgithub.com\u002Fvltansky\u002Fvs\u002Fblob\u002Fmaster\u002Fskills\u002Fvs-disk-cleanup\u002Fscripts\u002Fslim.sh",{"path":86,"resourceType":53,"resourceTypeDesc":54,"sizeBytes":87,"sourceHtmlUrl":88},"scripts\u002Fvs-artifacts.sh",5067,"https:\u002F\u002Fgithub.com\u002Fvltansky\u002Fvs\u002Fblob\u002Fmaster\u002Fskills\u002Fvs-disk-cleanup\u002Fscripts\u002Fvs-artifacts.sh",{"path":90,"resourceType":53,"resourceTypeDesc":54,"sizeBytes":91,"sourceHtmlUrl":92},"test\u002Fdisk-cleanup.static.eval.ts",10310,"https:\u002F\u002Fgithub.com\u002Fvltansky\u002Fvs\u002Fblob\u002Fmaster\u002Fskills\u002Fvs-disk-cleanup\u002Ftest\u002Fdisk-cleanup.static.eval.ts",[94,101,107,112,119,124],{"skillNo":95,"name":96,"nameZh":6,"description":97,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":98,"categories":99,"keywords":100,"publishedAt":19},"01M77XSKWFMPKFXM0311QKEJHH","vs-write","Use when asked to write, rewrite, edit, tighten, simplify, or polish prose for clarity, or to put text in STE, ASD-STE100, or controlled language. Produces plain, direct, accessible copy without losing substance or precision.","https:\u002F\u002Fgithub.com\u002Fvltansky\u002Fvs\u002Fblob\u002Fmaster\u002Fskills\u002Fvs-write\u002FSKILL.md",[],[],{"skillNo":102,"name":103,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":104,"categories":105,"keywords":106,"publishedAt":19},"01M77XSJNX2V560HSKQKQD67KP","vs-fake-verify","https:\u002F\u002Fgithub.com\u002Fvltansky\u002Fvs\u002Fblob\u002Fmaster\u002Fskills\u002Fvs-verify\u002Ftest\u002Ffixtures\u002Fpath-end-state\u002Fstub-rejector\u002FSKILL.md",[],[],{"skillNo":108,"name":103,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":109,"categories":110,"keywords":111,"publishedAt":19},"01M77XSHHBEMMYZ6B4PD384NZH","https:\u002F\u002Fgithub.com\u002Fvltansky\u002Fvs\u002Fblob\u002Fmaster\u002Fskills\u002Fvs-verify\u002Ftest\u002Ffixtures\u002Fpath-end-state\u002Fstructure-paste\u002FSKILL.md",[],[],{"skillNo":113,"name":114,"nameZh":6,"description":115,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":116,"categories":117,"keywords":118,"publishedAt":19},"01M77XSE2Y7MW0KP3DTFNEE2E8","vs-verify","Use when asked to verify, prove it works, check completion, or before claiming done. Produces evidence-backed PASS\u002FWARN\u002FFAIL status.","https:\u002F\u002Fgithub.com\u002Fvltansky\u002Fvs\u002Fblob\u002Fmaster\u002Fskills\u002Fvs-verify\u002Ftest\u002Ffixtures\u002Fpath-end-state\u002Fpublished-pair\u002FSKILL.md",[],[],{"skillNo":120,"name":103,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":121,"categories":122,"keywords":123,"publishedAt":19},"01M77XSAXFQXNE6VCRC7275Z0X","https:\u002F\u002Fgithub.com\u002Fvltansky\u002Fvs\u002Fblob\u002Fmaster\u002Fskills\u002Fvs-verify\u002Ftest\u002Ffixtures\u002Fpath-end-state\u002Fphrase-complete-beside\u002FSKILL.md",[],[],{"skillNo":125,"name":114,"nameZh":6,"description":115,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":126,"categories":127,"keywords":128,"publishedAt":19},"01M77XS6R0E9X1E5KKSS00WYSS","https:\u002F\u002Fgithub.com\u002Fvltansky\u002Fvs\u002Fblob\u002Fmaster\u002Fskills\u002Fvs-verify\u002FSKILL.md",[],[]]