disk-cleanup

Inventory Rust worktrees and clean build artifacts, branches, and caches.

1|Updated May 9, 2026
One-click install
npx skills add https://github.com/tonykoop/claude-skills --skill disk-cleanup-tonykoop
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: disk-cleanup
Source: https://github.com/tonykoop/claude-skills/tree/main/plugins/coding/skills/disk-cleanup
Command: npx skills add https://github.com/tonykoop/claude-skills --skill disk-cleanup-tonykoop

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires cargo, git, docker, bc, and includes scripts (resource) components.

What problem does it solve?

This skill helps developers reclaim disk space in a multi-worktree Rust-backed workspace by safely cleaning build artifacts, caches, and unused branches, while preserving active work and important data.

Core Features & Use Cases

  • Worktree cargo clean per worktree. The biggest space hog in a Rust-heavy workspace is the target/debug directories.
  • Merged-branch cleanup. Cleans up local branches merged to origin/main, with safety checks to avoid active worktrees and unmerged work.
  • Node-side caches. npm cache clean --force and pnpm store prune when applicable.
  • Optional Docker prune. Docker system prune --volumes is opt-in and requires explicit confirmation.
  • WSL VHD shrink prompt. Prints exact PowerShell commands to shrink the backing VHDX outside WSL.
  • Reports freed bytes per step and total.

Quick Start

Run disk-cleanup to preview what would be cleaned, then re-run with --apply to perform the cleanup.

Frequently Asked Questions about disk-cleanup

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

FAQPage Schema
How do I clean up Rust build artifacts across multiple git worktrees?

To clean up Rust build artifacts across multiple git worktrees, run a disk-cleanup workflow that inventories all worktrees and executes cargo clean per worktree to safely reclaim disk space.

What is the safest way to prune merged git branches in a worktree setup?

The safest way to prune merged git branches in a worktree setup is using a cleanup workflow with strict safety checks. It only removes branches merged to origin/main while protecting unmerged work and active worktrees.

Does disk cleanup require Docker to be installed and running?

Disk cleanup does not require Docker to be running because Docker system prune is entirely opt-in. The workflow relies on cargo, git, docker, and bc, but skips Docker pruning safely without explicit confirmation.

How do I shrink the WSL VHDX file after cleaning up disk space?

To shrink the WSL VHDX file after disk cleanup, the workflow prints exact PowerShell commands to run outside WSL. You execute these commands manually to compact the backing virtual hard disk and reclaim physical space.

What happens if I run the cleanup workflow without any flags?

If you run the cleanup workflow without any flags, it defaults to a dry-run mode that previews cleanup actions. No destructive steps execute until you re-run the command with the --apply flag.

When should I not use an automated disk cleanup script for my repositories?

You should not use automated disk cleanup when you have uncommitted changes or unmerged branches, as strict safety checks guard active worktrees. Always preview via dry-run first to ensure no important data is targeted.