disk-cleanup
Reclaim local disk space safely on a development machine — leftover git worktrees, Docker leftovers from integration tests (Testcontainers containers, orphan…
Skill by pabloleonalcaide
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/pabloleonalcaide-disk-cleanup
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: devops
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
- Runs as
- Shell scripts
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/disk-cleanup
What's inside
- Skill name
disk-cleanup- Description
- Reclaim local disk space safely on a development machine — leftover git worktrees, Docker leftovers from integration tests (Testcontainers containers, orphan anonymous volumes, dangling images, build cache) and regenerable caches (Turborepo, Vite, Yarn Berry global, npm). Use when the disk is full or nearly full, on ENOSPC / "no space left on device" errors, when Docker Desktop hangs or won't open, when a SessionStart warning reports low free space, or when the user says "libera espacio", "limpia el disco", "disk cleanup", "free up space".
- License
- MIT
- Instructions
- 64 lines in SKILL.md · view on GitHub
Before installing
- Ships executable scripts
Files (5)
- SKILL.md
- cache-cleanup.sh · scripts/
- disk-report.sh · scripts/
- docker-cleanup.sh · scripts/
- worktree-cleanup.sh · scripts/
SKILL.md (first lines)
# Disk cleanup Free space by deleting only what can be regenerated or is already safe elsewhere: a report and a plan first, an explicit OK from the user, then execution. Never touch a container's data, a named volume, uncommitted work or an unpushed commit. ## When NOT to use - Only stale worktrees to tidy, no space pressure → run `scripts/worktree-cleanup.sh` on its own. - Removing the worktree a PR was just opened from → `/create-pr` does that itself. - Docker data the user wants gone on purpose (reset a database, drop a named volume) — that is a deliberate, targeted command, not a cleanup sweep. ## Process All scripts live in `scripts/` next to this file; run them from inside the repo. 1. **Unblock if the disk is at 0.** With no free space even command output fails (`ENOSPC`). Measure with a read-only `df -h "$HOME"` and start with the biggest safe win (usually worktrees, ~30 GB each with their `node_modules`). Docker cannot start on a full disk: free space first. 2. **Report.** Run `scripts/disk-report.sh`. It prints free space and the `--plan` of the three cleaners; nothing is deleted. Sizes of worktrees: `du -sh <path>` (slow — run in background). 3. **Present the plan** to the user in their language, per area: what goes, how much it frees, what is kept and **why** (copy the script's reasons, don't paraphrase them away). REMOVABLE worktrees (open PR, clean, pushed) are offered one by one, never bundled into "all". 4. **Confirm.** Explicit OK per area. A subset → run per item (`worktree-cleanup.sh --remove <path>`), not `--execute`. 5. **Execute** the confirmed areas: - worktrees: `scripts/worktree-cleanup.sh --execute` (SAFE ones) / `--remove <path>` - Docker: `scripts/docker-cleanup.sh --execute` (needs the daemon up) - caches: `scripts/cache-cleanup.sh --execute` (stop dev servers first; it skips caches in use) Long removals (worktrees) go to the background; report when they finish. 6. **Report** freed space (`df -h` before/after) and what was kept. Docker Desktop hung (UI won't open) → restart it without losing containers: free space, `osascript -e 'quit app "Docker"'`, wait; if the backend ignores it, SIGTERM `com.docker.backend`; SIGKILL only once no `com.docker.virtualization`/`krun` process is left (the VM is down, data is closed). Then `open -a Docker` and check `docker ps -a`. Never "Reset to factory defaults" / "Clean / Purge data". ## Common Rationalizations | Rationalization | Reality | |---|---| | "The script says commits not in master, so it's unmerged" | Squash merges leave the original commits out of master; check the PR state and whether the tip is pushed. | | "`docker system prune -a --volumes` frees the most" | It also deletes named volumes and stopped stack containers: local databases gone. | | "The worktree is clean, its open PR doesn't matter" | No code is lost, but the user may still be working there — offer it, don't assume. | | "Deleting the cache while the dev server runs is fine" | A running Vite/Turbo loses its cache mid-flight; stop it or let the script skip it. | ## Red Flags - `docker system prune`, `docker volume prune -a` or `--volumes` in a command. - `git worktree remove --force` or `git branch -D` without the user naming that exact item. - Deleting before the user saw the plan, or executing "all" when they picked a subset. - Reporting "freed X GB" without a `df -h` after. ## Verification - [ ] `disk-report.sh` (or each `--plan`) output shown before deleting anything - [ ] user's OK recorded per area / per REMOVABLE worktree - [ ] `df -h` after, with the freed amount - [ ] `docker ps -a` still lists the stack containers (if Docker was touched) - [ ] kept items listed with their reason
From pabloleonalcaide/development-skills, MIT.
More from pabloleonalcaide/development-skills
- 0.592score
develop
pabloleonalcaide
Orchestrates any non-trivial development or analysis task end-to-end — discovery, alignment, blueprint, registration, implementation and delivery.
SkillAFreshness: A★ 1Claude Code +9 - 0.587score
deprecation
pabloleonalcaide
Retire code, endpoints, fields, flags and dependencies safely, and migrate data without downtime using expand/contract.
SkillAFreshness: A★ 1Claude Code +9 - 0.587score
api-design
pabloleonalcaide
Design stable public interfaces — HTTP endpoints, event payloads, module boundaries, SDK-style ports — and make retried operations safe with idempotency keys.
SkillAFreshness: A★ 1Claude Code +9 - 0.587score
observability
pabloleonalcaide
Instrument code so production behavior is visible and diagnosable — structured logs with correlation ids, metrics, traces, symptom-based alerts and minimal…
SkillAFreshness: A★ 1Claude Code +9 - 0.587score
security-hardening
pabloleonalcaide
Threat-model a change and harden it before it ships — trust boundaries, authn/authz, input validation, secrets, SSRF, destructive operations, rate limits and…
SkillAFreshness: A★ 1Claude Code +9 - 0.587score
setup
pabloleonalcaide
Sets up an `## Agent skills` block in AGENTS.md/CLAUDE.md and `docs/agents/` so the engineering skills know this repo's issue tracker (GitHub by default, or…
SkillAFreshness: A★ 1Claude Code +9 - 0.584score
create-pr
pabloleonalcaide
Commit the current branch, push it, and open a pull request.
SkillAFreshness: A★ 1Claude Code +9 - 0.567score
diagnose
pabloleonalcaide
Disciplined diagnosis loop for hard bugs and performance regressions.
SkillAFreshness: A★ 1Claude Code +9 - 0.562score
receiving-code-review
pabloleonalcaide
Use when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires…
SkillAFreshness: A★ 1Claude Code +9 - 0.562score
grilling
pabloleonalcaide
Grill the user relentlessly about a plan or design until shared understanding — interview one decision at a time, no code until confirmed.
SkillAFreshness: A★ 1Claude Code +9 - 0.562score
tdd
pabloleonalcaide
Test-driven development with red-green-refactor loop.
SkillAFreshness: A★ 1Claude Code +9 - 0.562score
write-a-skill
pabloleonalcaide
Create new agent skills with proper structure, progressive disclosure, and bundled resources.
SkillAFreshness: A★ 1Claude Code +9
Signals
- Stars
- 1
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Oct 14, 2026 (15 days ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from pabloleonalcaide
- 0.592score
develop
pabloleonalcaide
Orchestrates any non-trivial development or analysis task end-to-end — discovery, alignment, blueprint, registration, implementation and delivery.
SkillAFreshness: A★ 1Claude Code +9 - 0.587score
observability
pabloleonalcaide
Instrument code so production behavior is visible and diagnosable — structured logs with correlation ids, metrics, traces, symptom-based alerts and minimal…
SkillAFreshness: A★ 1Claude Code +9 - 0.587score
security-hardening
pabloleonalcaide
Threat-model a change and harden it before it ships — trust boundaries, authn/authz, input validation, secrets, SSRF, destructive operations, rate limits and…
SkillAFreshness: A★ 1Claude Code +9 - 0.587score
api-design
pabloleonalcaide
Design stable public interfaces — HTTP endpoints, event payloads, module boundaries, SDK-style ports — and make retried operations safe with idempotency keys.
SkillAFreshness: A★ 1Claude Code +9 - 0.587score
deprecation
pabloleonalcaide
Retire code, endpoints, fields, flags and dependencies safely, and migrate data without downtime using expand/contract.
SkillAFreshness: A★ 1Claude Code +9 - 0.587score
setup
pabloleonalcaide
Sets up an `## Agent skills` block in AGENTS.md/CLAUDE.md and `docs/agents/` so the engineering skills know this repo's issue tracker (GitHub by default, or…
SkillAFreshness: A★ 1Claude Code +9
Cite this page
disk-cleanup skill. Agent Mart. https://agentmart.dev/skills/pabloleonalcaide-disk-cleanup (last updated 2026-10-24)