| name | git-pr-sync-check |
| description | Checks whether the current PR branch is still live and in sync (merged/behind/changes-requested). Use when continuing work on a PR branch before adding commits. |
| args | [--project-dir <path>] |
| argument-hint | [--project-dir <path>] |
| allowed-tools | Bash(bash *), Bash(git fetch *), Bash(git rev-list *), Bash(git status *), Bash(git branch *), Bash(gh pr view *), Read, TodoWrite |
| created | "2026-06-17T00:00:00.000Z" |
| modified | "2026-06-17T00:00:00.000Z" |
| reviewed | "2026-06-17T00:00:00.000Z" |
/git:pr-sync-check
Read-only guard that answers one question before you build further on a PR
branch: is this branch still live and in sync with the remote? It fetches
origin, computes ahead/behind, and reads the branch's PR state, then returns a
single VERDICT. Read-only — it fetches but never changes branch or working-tree
state.
When to Use This Skill
| Use this skill when... | Use the alternative when... |
|---|
| An additional in-session request continues work on a branch that already has a PR | Starting brand-new work — just create a branch |
| About to add commits to a branch whose PR may have merged while you worked | Use /git:pr-feedback to act on review threads once you know there are some |
| A push was rejected, or you suspect a teammate / another agent / a CI auto-fix pushed under you | Use /git:coworker-check for local-checkout coworker collisions (uncommitted files) |
| You want CI / review state for the current branch's PR at a glance | Use /git:triage to categorize many PRs at once |
This is the remote sibling of /git:coworker-check (which detects local
uncommitted-file collisions). See .claude/rules/pr-branch-sync.md for the
rationale and .claude/rules/agent-coworker-detection.md for the local case.
Context
- Current branch: !
git branch --show-current
- Tracking / ahead-behind: !
git status --porcelain=v2 --branch
Parameters
Parse $ARGUMENTS:
| Flag | Effect |
|---|
--project-dir <path> | Run against a specific checkout/worktree (default: current dir) |
Execution
Run this check, then act on the verdict.
Step 1: Run the detection script
bash ${CLAUDE_SKILL_DIR}/scripts/check-pr-sync.sh --project-dir "$(pwd)"