delete-worktree

Remove git worktrees for merged or closed branches.

Updated May 4, 2025
One-click install
npx skills add https://github.com/vnatarajan4061/phoenix --skill delete-worktree-vnatarajan4061
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: delete-worktree
Source: https://github.com/vnatarajan4061/phoenix/tree/main/.claude/skills/delete-worktree
Command: npx skills add https://github.com/vnatarajan4061/phoenix --skill delete-worktree-vnatarajan4061

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill simplifies the process of removing git worktrees, especially for branches that have been merged or closed.

Core Features & Use Cases

  • Auto-Cleanup Mode: Automatically detect and remove worktrees for merged or closed branches.
  • Manual Mode: Remove a specific worktree and its branch based on user input.
  • Error Handling: Gracefully handles uncommitted changes and already-deleted branches.

Quick Start

Use the delete-worktree skill to remove a specific worktree by providing the description, e.g., delete-worktree qa-flags-mismatched-leave-absences.

Frequently Asked Questions about delete-worktree

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

FAQPage Schema
How do I remove git worktrees for merged branches automatically?

You can automatically remove git worktrees for merged branches by using an auto-cleanup mode that detects closed branches and deletes their associated worktrees via git commands.

What is the best way to delete a specific git worktree and its branch?

The best way to delete a specific git worktree is to use manual mode, where you provide the worktree description as input to remove both the worktree and its corresponding branch.

What happens if I try to delete a git worktree with uncommitted changes?

When deleting a git worktree with uncommitted changes, the process includes error handling to gracefully manage the situation rather than failing or silently losing your work.

Does this approach work for cleaning up git worktrees when the branch is already deleted?

Yes, this approach works for cleaning up git worktrees even when the branch is already deleted, handling the edge case gracefully to ensure no orphaned worktree directories remain.

When do I need to clean up git worktrees?

You need to clean up git worktrees when branches have been merged or closed, preventing clutter and reclaiming disk space from working directories that are no longer actively needed.