worktree-cleanup

Remove completed Git worktrees after feature merges to reclaim disk space.

Updated Feb 4, 2026
One-click install
npx skills add https://github.com/cbemister/claude-code --skill worktree-cleanup-cbemister
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: worktree-cleanup
Source: https://github.com/cbemister/claude-code/tree/main/.claude/skills/worktree-cleanup
Command: npx skills add https://github.com/cbemister/claude-code --skill worktree-cleanup-cbemister

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill cleans up completed Git worktrees after a feature is merged, reclaiming disk space and reducing clutter in your repository.

Core Features & Use Cases

  • Single-worktree cleanup after a merged feature branch.
  • Batch cleanup for multiple worktrees with optional safety prompts, including force mode and optional plan archival.
  • Safe removal ensures you don't delete the current worktree or unmerged changes.

Quick Start

Run the command: /worktree-cleanup <feature-name> [--force]

Frequently Asked Questions about worktree-cleanup

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

FAQPage Schema
How do I clean up merged Git worktrees to reclaim disk space?

You can clean up merged Git worktrees by running a guided command that removes completed feature branches. This reclaims disk space and reduces repository clutter while ensuring unmerged changes are safely preserved.

Can I batch cleanup multiple Git worktrees at once?

Yes, you can batch cleanup multiple Git worktrees at once using a force mode. The process includes optional safety prompts and supports plan archival to guide you through removing several completed worktrees efficiently.

Does Git worktree cleanup protect my current working directory and unmerged branches?

Git worktree cleanup includes built-in safety checks to protect your current working directory and unmerged branches. It ensures you only remove completed feature worktrees after a merge, preventing accidental data loss.

Do I need any extra dependencies to run worktree cleanup?

You do not need any extra dependencies to run worktree cleanup. It relies entirely on standard Git and shell capabilities, using guided prompts to help you remove completed feature branches without additional software.

What is the best way to remove a single feature branch worktree after a merge?

The best way to remove a single feature branch worktree after a merge is using a targeted cleanup command. This safely deletes the completed worktree, reclaims local disk space, and optionally archives the plan.