From create-worktrees
Cleans up finished git worktrees by removing merged branches and pruning stale references, with safety checks for uncommitted changes.
How this command is triggered — by the user, by Claude, or both
Slash command
/create-worktrees:worktree-cleanThe summary Claude sees in its command listing — used to decide when to auto-load this command
Clean up finished git worktrees by removing directories and pruning references. ## Steps 1. List all active worktrees with `git worktree list`. 2. For each worktree, check its status: 3. Identify worktrees safe to remove: 4. For each worktree to clean: 5. Prune stale worktree references: `git worktree prune`. 6. Report what was cleaned and what was kept. ## Format ## Rules - Never remove a worktree with uncommitted changes without user confirmation. - Always check if the branch is merged before deleting it. - Use `git branch -d` (not -D) to prevent deleting unmerged branches.
Clean up finished git worktrees by removing directories and pruning references.
git worktree list.git worktree prune.Worktree Cleanup Report:
Removed:
- <path> (branch: <name>, reason: merged)
Kept:
git branch -d (not -D) to prevent deleting unmerged branches.5plugins reuse this command
First indexed Mar 30, 2026
npx claudepluginhub smarks26/awesome-claude-code-toolkit --plugin create-worktrees/worktree-cleanCleans up finished git worktrees by removing merged branches and pruning stale references, with safety checks for uncommitted changes.
/cleanup-worktreesFinds and removes merged or orphaned git worktrees. Reports what was cleaned up and what was preserved.
/clean-worktreesSafely removes specified git worktrees using `git worktree remove` without --force, relying on git's safety checks for clean state and pushed commits.
/worktree-pruneLists and selectively removes abandoned worktrees in the current git project, with per-worktree confirmation and optional DDEV project cleanup.
/worktree-prunePrunes stale or orphaned Git worktrees, cleaning up unreferenced working directories.
/cleanupRemoves already merged Git worktrees and their branches. Supports --dry-run to preview candidates and confirmation before deletion.