Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

System.Analyze Disk Space Use

БесплатноБез исполняемых скриптовНе проверен

Analyze disk usage to find the largest space consumers and reclaim options

gpsaggeseот gpsaggese★ 158 звёзд на GitHub

Об этом скилле

Goal

  • Find what consumes the most disk space. Identify what is safely reclaimable (unused container/VM images, caches, logs) and what needs manual review
  • Never delete, move, or modify anything. Analysis only

Workflow

Check Overall Disk Usage

  • Run df -h to see total, used, and available space per volume
  • On macOS, user data lives on /System/Volumes/Data, not /. Use its Capacity/Avail columns to judge urgency

Survey the Home Directory

  • List top-level home directory usage, largest first:

    > du -sh ~/* 2>/dev/null | sort -rh
    
  • Recurse one level at a time into the dominant directory (on macOS, often ~/Library), sorting by size, until you reach the actual large items:

    > /usr/bin/du -sh ~/Library/* 2>/dev/null | sort -rh | head -30
    
  • Track every directory measured. They feed the top-10 list in "Rank Findings And Write The Report"

Check Container and VM Engines First

  • Container and VM engines are usually the biggest consumer on a dev machine. They cache every pulled or built image and rarely self-prune
  • For each installed engine, check its usage report before raw directory sizes:
    • Docker: if docker exists, run docker system df -v for a per-image and per-volume breakdown. Images with CONTAINERS = 0 are unused and reclaimable
    • Apple container CLI (native macOS containers): if container exists, run container system df. Its data lives under ~/Library/Application Support/com.apple.container. Docker's VM disk lives under ~/Library/Containers/com.docker.docker
    • Other engines (podman, colima, lima, nerdctl): use their equivalent system df / usage-report command
  • The tool can report a builder container (Docker buildx state volume, Apple buildkit builder) as "active", which excludes it from RECLAIMABLE even when it is very large
    • Size it with /usr/bin/du -sh <PATH>. Report it as a manual candidate, with the reset command (docker buildx prune --all, or container builder stop && container builder delete)

Check Common Cache/Log Locations

  • MacOS:
    • ~/Library/Caches
    • ~/Library/Logs
    • Per-app Cache / Code Cache folders under ~/Library/Application Support/<App>
    • ~/.Trash
    • tmutil listlocalsnapshots /: flag any entry that is not a normal com.apple.os.update-* system snapshot
  • Linux equivalents: ~/.cache, /var/cache, /var/log, and package-manager caches (apt, dnf, pacman)

Spot-Check Dev Artifacts

  • Look for large, likely-stale developer artifacts: venv/.venv directories, node_modules, old or duplicate repo clones, and suspiciously named directories (backups, ancient_*, old_*)
  • Report these as "needs manual review", never as auto-recommended deletions. They can hold unique, irreplaceable data

Rank Findings and Write the Report

  • For each candidate, record: path, size, and whether it is safely reclaimable (rebuildable, re-pullable, re-cacheable) or needs manual review (may hold unique data)
  • Fill in .claude/skills/system.analyze_disk_space_use/report.template.md, formatted per .claude/skills/markdown.rules.md
  • Save the report to system.analyze_disk_space_use.md in the current dir
  • Right after the title, add how the report was generated:
    - Generated by `.claude/skills/system.analyze_disk_space_use/SKILL.md`
    
  • List the top 10 directories measured in "Survey The Home Directory" and "Check 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)
  • Take every reclaim command from the tool's own output (e.g., docker system df). Never guess one. Pair each with the size it frees
  • Lead the report with a summary table of every command and its estimated savings. 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
  • Rank the breakdown by impact (space freed) first, then by risk

Create a Script to Perform the Cleanup

  • Create a Bash script system.analyze_disk_space_use.sh in the current dir
    • Do not make it executable, since the user must review it first
  • Add a comment for each potential saving: how safe it is, how much space it 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

  • Only run read-only commands: df, du, *system df, *ls, tmutil listlocalsnapshots, find (without -delete)
  • Never run a destructive command (docker system prune, docker image rm, container image rm, rm -rf, container builder delete, etc.). List them in the report only, as candidates for the user to run
  • If a read-only command fails with an unexpected `usage:
Полный SKILL.md на GitHub

Установить System.Analyze Disk Space Use в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

report.template.md

FAQ

Что делает скилл System.Analyze Disk Space Use?

Analyze disk usage to find the largest space consumers and reclaim options

Как установить скилл System.Analyze Disk Space Use?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл System.Analyze Disk Space Use запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить System.Analyze Disk Space Use с