worktree-cleanup

Automate git worktree cleanup with ticket verification and confirmation prompts.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires crewchief, jq, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill provides a comprehensive solution for cleaning up git worktrees in devcontainer environments, ensuring safe removal with ticket status checking and confirmation prompts.

Core Features & Use Cases

  • Ticket Status Checking: Automatically verifies the completion status of associated SDD tickets before cleanup.
  • Confirmation Prompts: Provides interactive prompts to confirm cleanup when incomplete work is detected.
  • Dry-Run Mode: Allows users to preview actions without making any changes.
  • VS Code Workspace Update: Removes worktree from the VS Code workspace file upon successful cleanup.

Quick Start

To remove a completed worktree named 'feature-work', use the command: cleanup-worktree.sh feature-work --repo myproject

Frequently Asked Questions about worktree-cleanup

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

FAQPage Schema
How do I safely clean up git worktrees in a devcontainer?

To safely automate git worktree cleanup in a devcontainer, use a script that verifies SDD ticket completion, provides interactive confirmation prompts, and removes the worktree from the VS Code workspace file upon successful deletion.

Can I preview git worktree cleanup before removing files?

Yes, you can use the dry-run mode to preview git worktree cleanup actions and verify ticket status without making any actual changes to your devcontainer workspace or repository.

Do I need jq to remove a worktree from the VS Code workspace?

Yes, jq is required to update the VS Code workspace file during git worktree cleanup. The crewchief worktree utility is also required as a dependency to execute the removal process successfully.

How does ticket status checking work during worktree cleanup?

Ticket status checking automatically verifies the completion status of associated SDD tickets before cleanup. If incomplete work is detected, interactive confirmation prompts ensure you approve the worktree removal.

What is the best way to remove a completed worktree named 'feature-work'?

The best way to remove a completed worktree is running `cleanup-worktree.sh feature-work --repo myproject`, which verifies the SDD ticket completion and updates the VS Code workspace file automatically.