wt-prune

Prune stale Git worktree references and report removed entries.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/michael-menard/monorepo --skill wt-prune
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: wt-prune
Source: https://github.com/michael-menard/monorepo/tree/main/.claude/skills/wt-prune
Command: npx skills add https://github.com/michael-menard/monorepo --skill wt-prune

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill eliminates orphaned git worktree references and metadata, preventing confusion when worktrees appear in status lists but do not exist on disk.

Core Features & Use Cases

  • Stale reference cleanup: Detects and prunes non-existent worktree metadata.
  • Safe operation: Only removes git's internal references without touching worktree directories.
  • Post-clean verification: Shows what was removed and what's left to maintain repository integrity.

Quick Start

Use the wt-prune slash command to prune stale worktree references and review what was removed.

Frequently Asked Questions about wt-prune

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

FAQPage Schema
How do I clean up stale git worktree references left after manual deletion?

To clean up stale git worktree references, you need to prune the orphaned metadata using git worktree prune. This removes internal references to non-existent worktrees and reports what was cleared, restoring repository consistency without deleting any actual directories.

Why does git worktree list show entries for directories that no longer exist?

Git worktree list shows non-existent entries because manual deletion of worktree directories leaves orphaned metadata behind. Pruning these stale git worktree references removes the inconsistent internal listings, ensuring the status output accurately reflects what is actually on disk.

What is the safest way to prune orphaned git worktree metadata?

The safest way to prune orphaned git worktree metadata is using git worktree prune, which removes only internal references without touching actual worktree directories. It provides post-clean verification by reporting exactly what was removed and what remains.

How do I verify repository integrity after pruning stale worktrees?

To verify repository integrity after pruning stale worktrees, review the post-clean report showing what was removed and what is left. This ensures the remaining git worktree listings are consistent with your disk and no valid references were accidentally lost.

Does git worktree prune delete my actual working directories?

No, git worktree prune does not delete your actual working directories. It safely removes only git's internal stale references and metadata, ensuring non-existent entries are cleared from listings while your valid worktree directories remain completely untouched.

When should I run a worktree prune to fix repository inconsistencies?

You should run a worktree prune when you notice repository inconsistencies, such as after manual deletions or when worktree listings display non-existent entries. Pruning cleans up the stale metadata and ensures your git worktree status remains accurate.