git-branch-sync

git-branch-sync is a skill for Claude Code, Codex from pivoshenko/pivoshenko.ai. It costs 89 tokens per session (666 once invoked), scanned A, original, MIT.

A guide for updating a Git branch by fetching the latest base branch and replaying the branch's commits on top of it; this replay is called a rebase.

In plain words
What is it for?
Use it to sync with main or another named base branch, handle local changes safely, identify conflicts, and report whether the branch needs a force push.
Why use it?
It keeps a branch current without creating a merge commit and clearly stops when conflicts need a developer's decision.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/pivoshenko/pivoshenko.ai/git-branch-sync
Any agent
npx skills add pivoshenko/pivoshenko.ai --skill git-branch-sync
Clone the repo
git clone --depth 1 https://github.com/pivoshenko/pivoshenko.ai

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for git-branch-sync

README.md
[![agentmods](https://agentmods.dev/badge/skills/pivoshenko/pivoshenko.ai/git-branch-sync.svg)](https://agentmods.dev/skills/pivoshenko/pivoshenko.ai/git-branch-sync)
Your own site
<a href="https://agentmods.dev/skills/pivoshenko/pivoshenko.ai/git-branch-sync"><img src="https://agentmods.dev/badge/skills/pivoshenko/pivoshenko.ai/git-branch-sync.svg" alt="Measured on agentmods" height="20"></a>
Per session 89 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 666 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00089 $0.00666
Opus 5 $0.00044 $0.00333
Sonnet 5 $0.00018 $0.00133
Haiku 4.5 $0.00009 $0.00067

Measured yesterday against content hash cc781e8917ab, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

git-branch-sync scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/git-branch-sync/SKILL.md · 41 lines

How it starts

The opening of the file, as written. The whole thing — 41 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Sync Branch

Catch current branch up to base. Rebase only. Surface conflicts.

Flow

  1. Parallel:
    • git status --porcelain
    • git branch --show-current
    • git rev-parse --abbrev-ref --symbolic-full-name @{u} (upstream if any)
  2. Base: user names one -> verbatim. Else detect: git symbolic-ref --short refs/remotes/origin/HEAD -> strip the origin/; ref missing -> git remote set-head origin -a, re-read; no remote -> main, fall back master. Why -> rebasing onto main in a develop-based repo replays the branch onto the wrong parent and manufactures conflicts that aren't real.
  3. Dirty -> stash: git stash push -u -m "sync-branch auto-stash". Pop later. Unsafe (unresolved merge) -> stop + tell user.
  4. On base -> git pull --ff-only origin <base>. Fails (local base diverged) -> stop + tell user. No auto-rebase of base itself.
  5. Else:
    • git fetch origin <base>
    • git rebase origin/<base>.
  6. Conflicts:
    • git status -> list conflicted paths.
    • Stop + surface. No auto-resolve.
    • Tell user: resolve, git add <paths>, git rebase --continue. Mention git rebase --abort escape.
    • Leave stash in place. Tell user to pop after resolve.
  7. Rebase done (clean or aborted) -> pop stash if created.
  8. Print one-liner: branch, base, commits replayed, force-push needed?
    • 0 commits replayed (already up to date) -> say so explicitly; don't mention force-push (nothing rewritten).

Rules

  • Always rebase, never merge. Why -> user workflow preference; linear history. Don't offer merge as alternative even on shared branches; surface the risk (force-push needed) and let user decide.
  • Never force-push here. Pushed branch rebased -> tell user git push --force-with-lease. Let user run.
  • Never git rebase --skip / drop commits to "make it work". Surface conflict.
  • Never --no-verify. Why -> hooks gate broken state; skipping just defers the failure.
  • No upstream -> sync vs origin/<base>. Note branch not pushed.
  • Pop stash you made on rebase clean OR abort. Pop blocked by conflicts -> leave stashed + tell user.

Read the full file on GitHub · 41 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday Changed cc781e8917ab
  2. 6d ago First seen · 41 lines · 89 tokens per session scan A 6f1873477459

Subscribe to this mod's changes

git-branch-sync is a skill published in the GitHub repository pivoshenko/pivoshenko.ai (4 stars, last pushed yesterday), licensed MIT. It adds 89 tokens to every session and 666 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

80-livekit-agents-majiayu000-claude-skill-registr

Create your LiveKit Agents skill from official documentation, then learn to improve it throughout the chapter.

majiayu000/claude-skill-registry · 18 tokens

agent-creation-skill

Procedural guide for creating new agents from templates when project complexity requires delegation.

majiayu000/claude-skill-registry · 0 tokens

agent-creator

Meta-agent for creating new custom agents, skills, and MCP integrations. Expert in agent design, MCP development, skill architecture, and rapid prototyping. Activate on 'create agent', 'new skill', 'MCP server', 'custom tool', 'agent design'. NOT for using existing agents (invoke them directly), general coding (use…

majiayu000/claude-skill-registry · 84 tokens

semantic-persona-routing

Erstellt und verwendet einen anbieterneutralen semantischen Routing-Graphen aus Personas, koordinierenden Rollen, Experten und aktiven Skill-Endpunkten. Verwenden, wenn ein LLM eine Anfrage von einer Leitrolle über einen Experten zu einem Skill routen, aus einem vorhandenen Agentensystem einen portablen Persona-Router…

ellmos-ai/skills · 168 tokens

80-livekit-agents-panaversity-agentfactory-1f8ecf89

Create your LiveKit Agents skill from official documentation, then learn to improve it throughout the chapter.

majiayu000/claude-skill-registry · 18 tokens

agent-creator

Meta-agent for creating new custom agents, skills, and MCP integrations. Expert in agent design, MCP development, skill architecture, and rapid prototyping. Activate on 'create agent', 'new skill', 'MCP server', 'custom tool', 'agent design'. NOT for using existing agents (invoke them directly), general coding (use…

majiayu000/claude-skill-registry · 84 tokens