merge-pr

Installation
SKILL.md

Merge PR

Core Design: Why the Current Session's Own Worktree Cannot Be Deleted

When a Claude Code session starts, it locks a primary working directory. After each Bash tool call completes, the harness resets CWD back to that path. If the current session's worktree is deleted mid-session (e.g. via git worktree remove), the next Bash call fails its cd before any command runs — the entire session becomes non-functional.

Solution: leave your own worktree for the next session to clean up. Every /merge-pr run scans all worktrees and removes stale merged ones, except the current session's own worktree. This caps the long-term residue at 1 leftover worktree, which gets cleaned on the next /merge-pr run from any other session.


Flow

Installs
1
GitHub Stars
159
First Seen
Jul 12, 2026