Giverny

Worktree Cleaner

Inventory the git worktrees of the current repository, classify each one with evidence (merged, PR state, uncommitted or unpushed work, locked, stale, in use by a running session)…

by davila7★ 34,480Agent workflows

What Worktree Cleaner does

Inventory the git worktrees of the current repository, classify each one with evidence (merged, PR state, uncommitted or unpushed work, locked, stale, in use by a running session) and remove them one at a time or by group, always asking the user first and verifying every removal. Use when worktrees have piled up (for example one per Claude Code task or thread), when `git worktree list` is long, or when the user asks to clean up, prune or tidy worktrees.

How to install Worktree Cleaner in Claude Code

Giverny gives you a ready prompt with the exact install command from davila7/claude-code-templates. Sign in with GitHub, copy the prompt and paste it into Claude Code; Claude installs the skill and confirms it loaded. To install by hand, clone davila7/claude-code-templates and copy the cli-tool/components/skills/git/worktree-cleaner folder into ~/.claude/skills/.

How to use it

Once installed, Claude loads Worktree Cleaner on its own whenever your request matches what the skill does. You can also ask for it by name, for example: “Use the worktree-cleaner skill on my current project.”

More Claude skills for agent workflows