/git-tools:git-rangefrom git-tools
Fetch origin, confirm a branch on origin still points at the head you are about to read, and print that head's merge base with a base branch plus its own commits since a previous head — never a commit the base gained. Read-only apart from the fetch.
Ships in git-tools. 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.
None: SKILL.md is the whole skill.
Answer the three questions a reader of a branch asks before it trusts what it reads: has the branch moved since I took its head, where does it leave its base, and which of its commits are new since the head I read last time. One fetch, one check, one range.
The range is the branch's own commits. A rebase that advances the
base makes every commit the base gained reachable from the new head and
unreachable from the previous one, so a plain
<prev-head>...<head> reads those upstream commits as the branch's;
this skill bounds the range by the base, and drops every commit whose
patch an earlier head already carried. A clean rebase therefore yields
no commit at all, and a conflict-resolving one yields exactly the
commits whose patch changed.
/git-tools:git-range --base <base-ref> --head-ref <head-ref> --head <sha> [--prev-head <sha>]
--base <base-ref> (required): the base branch's name on origin,
such as a PR's baseRefName.--head-ref <head-ref> (required): the branch's name on origin,
such as a PR's headRefName.--head <sha> (required): the full SHA you expect origin/<head-ref>
to point at, such as a PR's headRefOid.--prev-head <sha> (optional): the full SHA of the head read last
time. Omitted, the range starts at the merge base, so it is the whole
branch.Run the bundled script, spelled as a bare name, from inside any
checkout whose origin is the branch's repository:
git-range --base <base-ref> --head-ref <head-ref> --head <sha> [--prev-head <sha>]
It runs git fetch origin once and changes nothing else.
Exit 0 — origin/<head-ref> is <sha>, and stdout is the range,
one tab-separated line each:
merge-base\t<sha>
commit\t<sha>
The merge-base line comes first, and is the merge base of --head
and origin/<base-ref>. Then one commit line per commit of
git rev-list --right-only --cherry-pick <prev>...<head> ^origin/<base-ref>,
in that command's order, newest first, where <prev> is
--prev-head or else the merge base. No commit line means the
range is empty.
Exit 1 — a command failed, or something the range needs is
missing: the fetch failed, origin/<base-ref> or
origin/<head-ref> does not exist, the head and the base share no
merge base, or --prev-head is not a commit in this repository —
for instance a previous head that a force-push left unreachable and
the fetch did not bring back. Stderr names which; stdout is empty.
Exit 2 — a usage error, including a --head or --prev-head
that is not a full SHA; nothing was run.
Exit 3 — origin/<head-ref> is not <sha>: the branch moved
since you took its head. Stderr names both SHAs; stdout is empty.
Re-read the head before you read the branch again.
What SKILL.md sets; muted values are Claude Code's defaults
5 skills in this plugin
/git-branch-createCreate the correctly-named issue branch (issue-<N>-<slug>, or issue-<N1>-<N2>-...-<compound-slug> for a batch of issues) off the configured source branch, naming it with the git-issue-branch script./git-branch-syncRun the fixed git steps around work on an existing branch — check it out fast-forward only and record the remote tip it saw, rebase it onto origin/<base>, finish or abort a rebase stopped on conflicts, push it against that recorded tip (refusing a branch behind it, with a lease exactly when it is not an ancestor of HEAD) and verify the push landed, and release the local branch and its record at the end of a run. Resolving a conflict stays with the caller./git-issues-from-branchRecover the ordered issue set and slug an issue branch's name encodes (issue-<N1>-<N2>-...-<slug>), and optionally reconcile a caller's claimed issue list against it. The inverse of git-branch-create./test-generateGenerate comprehensive unit tests covering golden path, edge cases, and error handling.npx claudepluginhub thevoskamps/claude-plugins-marketplace --plugin git-toolsOther plugins' skills for the same job