/git-hygiene:remote-branch-syncfrom Git Hygiene
Use whenever the user asks to sync with the remote, pull in the latest, get up to date with main/origin, refresh local branches, or catch a branch up before continuing work — including terse asks like "sync with the remote", "pull latest from main", "update my branch", or "get current". Fetches with prune, fast-forwards what is safe, integrates the default branch into feature work only when asked, and reports divergence instead of guessing at a resolution.
Ships in Git Hygiene. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Bring local git state up to date with the remote, safely. The core promise: after this skill runs, the user knows exactly how their local branches relate to the remote — and nothing was rebased, merged, or discarded without them asking for it.
git fetch --all --prune
git status -sb
git branch -vv
Identify the default branch (git symbolic-ref refs/remotes/origin/HEAD --short, falling back to git remote show origin) and note:
[gone]If the working tree is dirty, stop and report before any branch movement. Never stash silently — the user may not remember the stash exists, and a sync that hides work is worse than one that waits.
git pull --ff-only.When the ask includes catching up with the default branch while on feature work:
git fetch origin <default>:<default>. This refspec fast-forwards the local default and refuses in two cases: the branch is checked out in another worktree, or the update isn't a fast-forward because the local default has diverged (carries commits not on the remote). Either way, report and stop — don't force it (+<default>:<default> would silently discard the divergent local commits). For the worktree case, update it from that worktree instead (git -C <worktree> pull --ff-only); for divergence, surface it and let the user decide.Worktree guardrail: when the session runs in a worktree, syncing means fetching and fast-forwarding local refs — never fast-forward-and-push the default branch from the main checkout on the feature's behalf; feature work reaches the default branch through its PR.
Close with a short summary: what was fetched, how many remote-tracking refs were pruned, what the current branch did (e.g. main a1b2c3d → e4f5a6b, fast-forward), any divergence awaiting a decision, and how many local branches are now [gone]. If there are [gone] branches or stale worktrees, point the user at worktree-cleanup rather than cleaning up inline — deletion deserves its own approval flow.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
2 skills in this plugin
git-hygiene@cypherpoet-toolchest is listed by cypherpoet/cypherpoet-toolchest — review the source before installing
npx claudepluginhub cypherpoet/cypherpoet-toolchest --plugin git-hygiene