git-sync

git-sync is a skill for Claude Code from mgiovani/cc-arsenal. It costs 94 tokens per session (1,313 once invoked), scanned A, original, MIT.

A workflow for bringing a Git feature branch up to date with its base or upstream branch using a merge by default, or a rebase when explicitly requested. A branch is a separate line of code changes.

In plain words
What is it for?
Use it to merge updates from main or another base branch, explicitly rebase when desired, sync a fork with upstream, and identify conflicts.
Why use it?
It checks the actual branch and remote state before syncing, detects conflicts, and handles uncommitted changes safely instead of guessing.

Skill for Claude Code

Written for Claude Code: argument-hint in frontmatter.

Part of the cc-arsenal-git plugin — 6 skills shipped together , and of cc-arsenal

Good fit Use it to merge updates from main or another base branch, explicitly rebase when desired, sync a fork with upstream, and identify conflicts.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/mgiovani/cc-arsenal/git-sync
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.

Any agent
npx skills add mgiovani/cc-arsenal --skill git-sync
Clone the repo
git clone --depth 1 https://github.com/mgiovani/cc-arsenal

Made for: Claude Code.

Or install cc-arsenal-git, the plugin that ships this one along with the rest of its 6 skills.

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-sync

README.md
[![agentmods](https://agentmods.dev/badge/skills/mgiovani/cc-arsenal/git-sync/github.svg)](https://agentmods.dev/skills/mgiovani/cc-arsenal/git-sync)
Your own site
<a href="https://agentmods.dev/skills/mgiovani/cc-arsenal/git-sync"><img src="https://agentmods.dev/badge/skills/mgiovani/cc-arsenal/git-sync/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for git-sync

Your own site · 80×15
<a href="https://agentmods.dev/skills/mgiovani/cc-arsenal/git-sync"><img src="https://agentmods.dev/badge/skills/mgiovani/cc-arsenal/git-sync.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 94 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,313 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.00094 $0.01313
Opus 5.5 $0.00038 $0.00525
Sonnet 5.5 $0.00019 $0.00263
Haiku 4.5 $0.00009 $0.00131

Measured 22d ago against content hash a4ff90c9873b, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

git-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 22d ago.

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-sync/SKILL.md · 142 lines

How it starts

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

Git Sync

Sync the current branch with its base or upstream branch. Defaults to merge to preserve history; rebase is opt-in only. Only ever act on what git status and git log actually show: never guess branch state or conflicts.

Workflow

Phase 1: Detect & Decide

Run the following to understand current branch state:

git branch --show-current
git status --porcelain
git remote -v
git log --oneline HEAD..origin/main 2>/dev/null | head -20
git log --oneline origin/main..HEAD 2>/dev/null | head -20

Also check whether the branch is pushed to remote (git log origin/<branch>..HEAD: an error means local-only).

Determine the base branch once, and reuse the result for the rest of the run:

  1. User passed --base <branch>: use it.
  2. Otherwise gh pr view --json baseRefName -q .baseRefName 2>/dev/null (if an open PR exists).
  3. Otherwise git config branch.<name>.merge.
  4. Otherwise ask the user which base branch to use.

Determine sync strategy:

Merge (default): use when the branch has been pushed to remote, the user did not pass --rebase, or you are unsure.

Rebase (opt-in): use only when the user explicitly passed --rebase.

Fork sync (--upstream) syncs from the upstream remote instead of origin: git fetch upstream && git merge upstream/<base>.

Display the detected state and proposed strategy before proceeding:

Current branch: feature/my-feature
Base branch:    main
Strategy:       merge (default)
Commits behind: 5
Commits ahead:  2
Dirty tree:     no

Phase 2: Pre-sync Safety

  1. Dirty working tree: with --stash, run git stash push -m "git-sync auto-stash" before syncing. Without --stash, abort and tell the user to commit, stash, or re-run with --stash.
  2. Fetch latest: git fetch origin (and git fetch upstream for fork sync).
  3. Re-check divergence after fetch so the numbers you report are accurate, not the pre-fetch snapshot.

Phase 3: Execute & Report

Merge: git merge origin/<base>

Rebase, local-only branch: git rebase origin/<base>

Read the full file on GitHub · 142 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 22d ago Changed · -5 lines a4ff90c9873b
  2. 1mo ago Changed 23a7b0501bbc
  3. 1mo ago Changed · +1 lines 8ab7b85bd4e3
  4. 1mo ago First seen · 146 lines · 94 tokens per session scan A b9729cc00325

Subscribe to this mod's changes

git-sync is a skill published in the GitHub repository mgiovani/cc-arsenal (8 stars, last pushed 2d ago), licensed MIT. It adds 94 tokens to every session and 1,313 once invoked, about $0.0004 per session on Opus 5.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