speckit-worktree-clean

Remove unused git worktrees from .worktrees/ while preserving the main worktree.

Updated Apr 12, 2026
One-click install
npx skills add https://github.com/datamonsterr/mycoai_projects --skill speckit-worktree-clean
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: speckit-worktree-clean
Source: https://github.com/datamonsterr/mycoai_projects/tree/main/.agents/skills/speckit-worktree-clean
Command: npx skills add https://github.com/datamonsterr/mycoai_projects --skill speckit-worktree-clean

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Remove stale or merged worktrees and reclaim disk space, keeping your repository tidy and reducing confusion from orphaned worktrees.

Core Features & Use Cases

  • Safely identify and remove unused worktrees from .worktrees/
  • Support specific branch cleanup, merged-only cleanup, or all worktrees with warnings
  • Always preserve the main working directory and require explicit confirmation for destructive actions

Quick Start

Run this skill to safely remove unnecessary worktrees and clean up the .worktrees directory.

Frequently Asked Questions about speckit-worktree-clean

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

FAQPage Schema
How do I safely clean up stale git worktrees to reclaim disk space?

To clean up stale git worktrees and reclaim disk space, you can remove unused worktrees from the .worktrees/ directory while preserving the main working directory. The process enforces user confirmation and checks for uncommitted changes before removal.

What is the best way to remove orphaned git worktrees from a spec-kit project?

The best way to remove orphaned git worktrees from a spec-kit project is to target all merged and orphaned worktrees within the .worktrees/ directory. This approach automatically preserves the main worktree and requires explicit confirmation before deleting.

Does git worktree cleanup check for uncommitted changes before removing branches?

Yes, git worktree cleanup checks for uncommitted changes before removing branches. The process enforces user confirmation for destructive actions and safely preserves the main working directory to prevent accidental data loss.

Can I remove all git worktrees with warnings in my repository?

Yes, you can remove all git worktrees with warnings in your repository. This cleanup target safely removes problematic worktrees from the .worktrees/ directory while always preserving the main working directory and requiring explicit user confirmation.

What prerequisites are needed to clean up a .worktrees directory?

To clean up a .worktrees directory, you need git available on your system and the .worktrees/ directory to exist within your spec-kit project. The cleanup tool requires these prerequisites before identifying and removing unused worktrees.