From claude-commands
Analyzes local Mac disk usage, validates snapshot completeness, and identifies cleanup candidates. Defaults to dry-run preview and requires explicit approval before any deletion. Useful when disk usage is high or user wants to understand disk growth.
How this skill is triggered — by the user, by Claude, or both
Slash command
/claude-commands:disk-auditThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Analyze local disk usage, validate snapshot completeness, identify cleanup candidates, and optionally clean safe targets. **Always defaults to dry-run preview.** Never deletes anything without explicit user approval.
Analyze local disk usage, validate snapshot completeness, identify cleanup candidates, and optionally clean safe targets. Always defaults to dry-run preview. Never deletes anything without explicit user approval.
/disk-audit (points here)~/projects_other/user_scope/scripts/disk_snapshot.sh — emits JSON with snapshot_coverage_pct + timeout_keys~/projects_other/user_scope/scripts/disk_audit.sh--clean --dry-run (preview only)~/.codex/sessions, ~/.codex/sessions_archive/, ~/.codex/state*.sqlite, ~/.codex/log, ~/.claude/projectsWORKTREE APPROVED per CLAUDE.mdBefore quoting any size from disk_snapshot.json, validate it:
python3 -c "
import json
s = json.load(open('backup/Mac/disk_snapshot.json'))
print(f'coverage: {s.get(\"snapshot_coverage_pct\", \"missing\")}%')
print(f'warning: {s.get(\"snapshot_warning\", \"none\")}')
print(f'timeouts: {s.get(\"timeout_keys\", [])}')
"
Rules:
snapshot_coverage_pct is missing → snapshot is from an old script version; do not quote it. Regenerate with current disk_snapshot.sh.snapshot_coverage_pct < 70 or snapshot_warning == "low_coverage" → snapshot is incomplete. Use raw du -sh ~/.[!.]* ~/* instead.timeout_keys is non-empty → those entries are null in the JSON (NOT zero). Re-measure them directly: du -sh ~/.gemini etc.null ≠ empty dir. It means du timed out. Re-measure.Run ./scripts/disk_snapshot.sh --discover to scan ~/.[!.]* and ~/* for dirs >5 GB not currently in MONITORED_DIRS. If new entries appear, add them to the script.
Run ./scripts/disk_audit.sh --clean --dry-run to show cleanup candidates without deleting.
After user approves dry-run output:
./scripts/disk_audit.sh --clean
Includes Docker system prune candidates:
./scripts/disk_audit.sh --clean-all
VM disk images on macOS are sparse files with two sizes:
stat -f%z): logical max — can be 926 GB even when nearly emptydu -sk): actual blocks on diskAlways use du -sk for these. Never stat. The disk_snapshot.sh script (post 2026-05-24) already uses du -sk exclusively. To verify a sparse file's real size manually:
du -h ~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw # allocated
docker system df # itemized
| Pattern | Where | Typical size | Notes |
|---|---|---|---|
| IDE worktrees with full project copies | ~/.gemini/antigravity/worktrees/, ~/.ao-sessions/<sid>/.gemini/antigravity/worktrees/ | 50–150 GB | Two-level nesting pattern: AO sessions that used Antigravity as their agent store a full .gemini/antigravity/ subtree inside the session dir. That subtree contains a worktrees/worktree_<project>/ dir with one sub-worktree per PR task — each sub-worktree is a complete project clone + venv (~1 GB). Example: ao-5847/.gemini/antigravity/worktrees/worktree_worldarchitect/ held 79 sub-worktrees = 43.7 GB. Don't delete while Antigravity IDE is running (ps aux | grep -i antigravity). Check mtime <14d → needs WORKTREE APPROVED. |
| SQLite repair backups | ~/.codex/*.codex-repair-*.bak | 1–10 GB | Created during state DB repair. Safe to delete if >5 days old AND original DB is healthy. |
| Single runaway logs | ~/Library/Logs/cmux-focus.log, ~/Library/Logs/com.openai.codex/* | 100–800 MB | Truncate with : > path to keep inode open for active writer. |
| Old Python venvs in abandoned projects | ~/projects/*/venv, ~/projects_other/*/.venv | 50–700 MB each | Find with find ~/projects -name '.venv' -mtime +90. Always check git log -1 in parent dir first — only prune from projects with no commits in 90+ days. |
| Updater app caches | ~/Library/Caches/*-updater | 200–700 MB | Safe — apps re-download. |
__pycache__ accumulation | Across projects | 1–2 GB | Always safe to delete (find ~/projects -name __pycache__ -mtime +30 -exec rm -rf {} +). |
df -h /)disk_audit.sh --clean to proceed"du, df, lsof for in-use check)rm -rf directly — go through disk_audit.shnull (post-update). Cross-check.du -sk or docker system df.ps aux | grep -i antigravity and lsof +D ~/.gemini first.git log -1 --format=%ai ≥90 days old.~/.codex/sessions* — these are PROTECTED per repo CLAUDE.md.~/projects_other/user_scope/scripts/disk_{snapshot,audit,usage_alert}.shcom.$USER.disk-usage-alert.plist (threshold default 787 GB)backup-home.sh every 30 min, commits JSON to git~/projects_other/user_scope/tests/test_disk_snapshot.py (10 tests covering sparse files, timeout sentinel, coverage_pct, discover mode)disk audit, disk cleanup, clean disk, disk space, reclaim disk, disk usage, snapshot coverage, what's eating my disk
npx claudepluginhub jleechanorg/claude-commands --plugin claude-commandsIdentifies and cleans disk hogs like Rust target/, node_modules, Python venvs, git garbage, Docker images, Homebrew caches, and hidden temps. Use when disk space is low or full.
Automates macOS disk cleanup and memory monitoring with Mole-based safety guards and LaunchAgent alerting. Responds to low disk space, kernel panics, and vm-compressor shortages on Apple Silicon.
Cross-drive storage audit and cleanup. Surveys all drives, finds orphaned git worktrees, large AI tool caches, and build artifacts. Produces a prioritized action plan with migration commands.