sync

A pre-flight workspace check for synchronising a Git repository before work begins.

In plain words
What is it for?
Use it to fetch remote references, inspect the working tree and branch history, update master when safe, and show recent commits.
Why use it?
It reveals branch status, remote changes, local edits, and unpushed commits before they cause conflicts or accidental loss of work.

Skill for Claude CodeCodex

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/stranma/claude-code-python-template/sync
Any agent
npx skills add stranma/claude-code-python-template --skill sync
Clone the repo
git clone --depth 1 https://github.com/stranma/claude-code-python-template

Made for: Claude Code, Codex.

Per session 27 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 491 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 $0.00027 $0.00491
Opus 5 $0.00014 $0.00246
Sonnet 5 $0.00005 $0.00098
Haiku 4.5 $0.00003 $0.00049

Measured yesterday against content hash 086ad7263013, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

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.

.claude/skills/sync/SKILL.md · 56 lines

What it actually says

Sync

Pre-flight workspace sync. Run this before starting any work.

Steps

  1. Fetch remote refs

    • Run git fetch origin
  2. Check workspace state

    • Run git status to see dirty files, staged changes, untracked files
    • Run git branch -vv to see current branch, tracking info, ahead/behind counts
  3. Auto-reset to master if nothing is blocking

    If ALL of the following are true, automatically run git checkout master && git pull --rebase without asking:

    • Working tree is clean (no staged, unstaged, or untracked changes that matter)
    • Current branch is NOT master (already on a feature branch that can be left)
    • The feature branch has no unpushed commits (ahead 0, or branch was already merged)

    If any blocker exists, do NOT auto-reset. Instead report the blocker and ask what to do:

    • Dirty working tree: list the files and ask whether to stash, commit, or discard
    • Unpushed commits on current branch: warn and ask whether to push first or switch anyway
    • Already on master: just git pull --rebase to update
  4. Show recent context

    • Run git log --oneline -3 to show the last 3 commits (after any branch switch)
  5. Output structured report

# Workspace Sync

Branch: <name> (tracking: <remote>/<branch>)
Status: <clean | N dirty files | N staged, M unstaged>
Remote: <up to date | N ahead, M behind>

## Actions Taken
- <e.g. "Switched to master and pulled 5 new commits", or "None -- already on clean master">

## Blockers (if any)
- <e.g. "Unstaged changes in .claude/settings.json -- stash, commit, or discard?">

## Recent Commits
- <hash> <message>
- <hash> <message>
- <hash> <message>
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 First seen · 56 lines · 27 tokens per session scan A 086ad7263013

Subscribe to this mod's changes

sync is a skill published in the GitHub repository stranma/claude-code-python-template (2 stars, last pushed 4mo ago), licensed MIT. It adds 27 tokens to every session and 491 once invoked, about $0.0001 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.