disk-cleanup

Reclaims local disk space by measuring known cache and toolchain paths, then proposing deletions by impact level.

2|Updated Sep 25, 2011
One-click install
npx skills add https://github.com/pokutuna/dotfiles --skill disk-cleanup-pokutuna
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: disk-cleanup
Source: https://github.com/pokutuna/dotfiles/tree/main/claude/skills/disk-cleanup
Command: npx skills add https://github.com/pokutuna/dotfiles --skill disk-cleanup-pokutuna

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? When a Mac or Linux machine runs out of disk space ("No space left on device"), blindly scanning the whole home directory is slow and risky. This Skill targets known space hogs first—package manager caches, language toolchains, Docker images, stale node_modules—and proposes deletions in order of safety, always requiring user approval before removing anything. ## Core Features & Use Cases - Knowledge-first measurement: Measures a curated list of cache paths (uv, npm, Homebrew, HuggingFace, Ollama, mise, Go, Rust, Scala, pnpm, Xcode DerivedData) in a single du command instead of walking the entire home directory. - Impact-ordered proposals with approval gates: Separates regenerable caches (batch approval) from expensive re-downloads like HF/Ollama models and Docker images (itemized approval), and never touches user data or session history. - Stale repository cleanup script: The bundled clean-recreatable.sh finds node_modules, .venv, build, dist, target and similar directories only in repositories whose last commit is older than a given number of days, writing a reviewable list file before any deletion. - Use Case: Your disk is full before a release build. Run the Skill to instantly see that uv cache holds 8GB, an old Ollama model holds 12GB, and 40 stale worktrees hold 20GB of node_modules—then approve each tier and watch free space recover. ## Quick Start Ask the assistant to free up disk space on this machine, for example: "My disk is almost full, find what's taking space and help me safely reclaim 20GB."

Frequently Asked Questions about disk-cleanup

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I free up disk space on macOS quickly?

Measure known cache locations first instead of scanning the whole home directory: uv, npm, Homebrew, HuggingFace, Ollama, Xcode DerivedData, and language toolchain caches. A single du -sh command over these paths usually surfaces several gigabytes of safely regenerable data.

How do I safely delete old node_modules and .venv directories?

Use the bundled clean-recreatable.sh script with --older-than to target only repositories whose last commit is older than a set number of days. It writes a reviewable list file with sizes and never deletes anything itself; you approve the list, then run the rm command embedded in its header.

Why doesn't deleting Docker images free up as much space as expected?

docker images sizes include shared layers, so summing them double-counts; only docker system df RECLAIMABLE is a valid estimate. On VM backends like OrbStack or Docker Desktop, freed space inside the VM does not shrink the host sparse disk without VM compaction.

Can this skill delete files automatically without asking?

No. Every deletion requires explicit user approval, with actual paths enumerated before any rm runs. Regenerable caches can be batch-approved, but models, Docker images, active environments, and user data each require individual confirmation.

What are the limitations of cache-based disk cleanup?

df free space and du totals diverge on macOS due to APFS snapshots and purgeable space, so reclaimed bytes may not appear immediately. Time Machine local snapshots can be removed with tmutil, but OS-managed snapshots must be left alone.