squash-merge-and-clean-up
squash-merge-and-clean-up
human-only. Start this only when a human asks for it by name. If you arrived here from another skill, stop and get explicit confirmation before running any step.
Land the PR this session opened and clear what this session created: leave the worktree, squash-merge, delete both branches, remove the worktree.
Session-scoped throughout. Other agent sessions run concurrently in the same repo and their worktrees and branches sit in the same listings. Touch only what this session made — the worktree it entered, the branch it pushed, the PR it opened. Everything else is someone's work in progress.
Two gates, split on ownership. Gate one covers everything this session owns: the merge and the removal of its own worktree and branches. Gate two covers the one step that touches shared state — bringing the primary checkout current, which every other session reads.
1. Survey
Gather, and hold for the plan:
gh pr view <n> --json number,title,body,state,mergeable,mergeStateStatus,headRefName,baseRefName,closingIssuesReferencesgh pr checks <n>— a docs-only PR may report no checks, which is a pass, not a failuregit worktree list— note which entries this session created;lockedmarks another session'sgit branch -vv— the+prefix marks a branch checked out in some worktree