Remove safe git worktrees that have no uncommitted changes and no commits missing from a pull request. Use when the user asks to clean up, prune, or remove worktrees (워크트리 정리, worktree cleanup).
설치
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
Remove safe git worktrees that have no uncommitted changes and no commits missing from a pull request. Use when the user asks to clean up, prune, or remove worktrees (워크트리 정리, worktree cleanup).
Cleanup worktrees
Remove linked worktrees that are safe to delete. Worktree only — never delete branches.
Rules
Remove only when all are true; otherwise skip and say why:
Not the current worktree or the primary checkout
Clean: git -C <path> status --porcelain empty
HEAD is on a PR (open, merged, or closed): some PR headRefOid has HEAD as ancestor (git merge-base --is-ancestor)
Never use git worktree remove --force unless the user asks.
Workflow
git worktree list --porcelain
Evaluate each linked worktree except current and primary
From the primary checkout: git worktree remove <path> for safe ones, then git worktree prune