System.analyze disk space use

From gpsaggese/helpers · View interactive version

System.analyze disk space use is an AI agent skill from the GitHub repository gpsaggese/helpers. Analyze disk usage to find the largest space consumers and reclaim options

How to use this skill

Skill file

Goal

(unused container/VM images, caches, logs) and what needs manual review

Workflow

Check Overall Disk Usage

Capacity/Avail columns to judge urgency

Survey the Home Directory

```bash

> du -sh ~/* 2>/dev/null | sort -rh

```

~/Library), sorting by size, until you reach the actual large items:

```bash

> /usr/bin/du -sh ~/Library/* 2>/dev/null | sort -rh | head -30

```

Write The Report"

Check Container and VM Engines First

cache every pulled or built image and rarely self-prune

per-volume breakdown. Images with CONTAINERS = 0 are unused and reclaimable

container system df. Its data lives under

~/Library/Application Support/com.apple.container. Docker's VM disk lives

under ~/Library/Containers/com.docker.docker

system df / usage-report command

buildkit builder) as "active", which excludes it from RECLAIMABLE even when

it is very large

the reset command (docker buildx prune --all, or

container builder stop && container builder delete)

Check Common Cache/Log Locations

~/Library/Application Support/<App>

com.apple.os.update-* system snapshot

caches (apt, dnf, pacman)

Spot-Check Dev Artifacts

node_modules, old or duplicate repo clones, and suspiciously named directories

(backups, ancient_*, old_*)

can hold unique, irreplaceable data

Rank Findings and Write the Report

(rebuildable, re-pullable, re-cacheable) or needs manual review (may hold unique

data)

formatted per .claude/skills/markdown.rules.md

```markdown

```

Container And VM Engines First", largest first. Prefer the most specific directory

that explains the bytes (e.g., the Docker VM disk, not just ~/Library)

Never guess one. Pair each with the size it frees

Then give the full nested breakdown per .claude/skills/markdown.rules.md

"List of Items": one bold-labeled bullet per reclaimable item, with the command

and size nested under it

Create a Script to Perform the Cleanup

since the user must review it first

saves, and the command

```

# SAFETY: low (cache rebuilds automatically on next use)

# SPACE FREED: ~20GB

# COMMAND: delete uv package manager cache

# rm -rf ~/.cache/uv

```

Constraints

tmutil listlocalsnapshots, find (without -delete)

container image rm, rm -rf, container builder delete, etc.). List them in

the report only, as candidates for the user to run

shell-hook rewrite. Retry with the full binary path (e.g., /usr/bin/du)

longer meaningfully explains the space gap

Verification

sum of reported items roughly explains where the used space went)

.claude/skills/system.analyze_disk_space_use/SKILL.md

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.