speckit-worktree-clean

Identify and remove stale or merged Git worktrees after user confirmation.

2|Updated Jan 29, 2026
One-click install
npx skills add https://github.com/pradeepmouli/lspeasy --skill speckit-worktree-clean-pradeepmouli
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: speckit-worktree-clean
Source: https://github.com/pradeepmouli/lspeasy/tree/main/.github/skills/speckit-worktree-clean
Command: npx skills add https://github.com/pradeepmouli/lspeasy --skill speckit-worktree-clean-pradeepmouli

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Remove stale or merged worktrees to reclaim disk space and simplify repo maintenance.

Core Features & Use Cases

  • Automatically identify merged, orphaned, stale, and active worktrees and suggest safe removals.
  • Provides a safe default that removes only merged and orphaned worktrees to avoid disrupting active development.
  • Presents a cleanup plan for user confirmation before any deletion.

Quick Start

Scan your repository for stale worktrees and perform a safe cleanup of merged or orphaned entries after presenting a plan.

Frequently Asked Questions about speckit-worktree-clean

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

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

Git worktrees consume disk space because each worktree creates a separate working directory with its own files. This skill identifies stale or merged worktrees and removes them after user confirmation to safely reclaim storage while preserving active development branches.

How do I remove a merged worktree without deleting uncommitted changes?

To remove a merged worktree without losing uncommitted changes, this skill performs per-worktree checks for uncommitted modifications before deletion. It presents a plan and only removes worktrees that are safely merged or orphaned, ensuring active work is preserved.

Does git worktree cleanup work with spec-kit style projects?

Git worktree cleanup works with spec-kit style projects by targeting the .worktrees directory. The skill validates prerequisites, identifies merged or orphaned worktrees within that structure, and executes a safe removal plan followed by a final git prune.

What is the best way to manage git worktree branch maintenance?

The best way to manage git worktree branch maintenance is to use a skill that automatically identifies active, stale, and merged worktrees. It provides a safe default that removes only merged and orphaned entries, generating a cleanup plan for confirmation before any deletion occurs.

Can I remove all git worktrees at once during repository maintenance?

You can remove all git worktrees during repository maintenance by using the all-clean scenario, but the skill enforces safety checks first. It validates prerequisites, checks for uncommitted changes per worktree, and requires user confirmation before executing the final prune.

Why does git worktree prune leave stale directories behind?

Git worktree prune can leave stale directories behind when worktrees are not properly removed or uncommitted changes exist. This skill handles stale, merged, and orphaned scenarios by performing per-worktree checks and generating a safe deletion plan before the final prune.