sync-setup

sync-setup is a command for Claude Code from w2ur/claude-code-setup. It costs 51 tokens per session (1,898 once invoked), scanned A, original, MIT.

A command that synchronizes the live Claude Code configuration into a repository. It copies generated files, removes private sections, cleans stale files, updates documentation counts, and checks for leaks or unsafe overwrites.

In plain words
What is it for?
Use it to publish updated commands, agents, skills, hooks, and scripts from the live configuration into the setup repository.
Why use it?
It keeps the published repository aligned with the live configuration while protecting private content and detecting hand-edited generated files.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: model in frontmatter; reads .claude/ paths; mentions .claude-plugin.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is cd ~/Dev/claude-code-setup && ./scripts/sync.py $0.

Good fit Use it to publish updated commands, agents, skills, hooks, and scripts from the live configuration into the setup repository.

Compare 6 commands from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/w2ur/claude-code-setup
agentmods
npx agentmods add commands/w2ur/claude-code-setup/sync-setup

Made for: Claude Code.

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

README.md
[![agentmods](https://agentmods.dev/badge/commands/w2ur/claude-code-setup/sync-setup/github.svg)](https://agentmods.dev/commands/w2ur/claude-code-setup/sync-setup)
Your own site
<a href="https://agentmods.dev/commands/w2ur/claude-code-setup/sync-setup"><img src="https://agentmods.dev/badge/commands/w2ur/claude-code-setup/sync-setup/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 sync-setup

Your own site · 80×15
<a href="https://agentmods.dev/commands/w2ur/claude-code-setup/sync-setup"><img src="https://agentmods.dev/badge/commands/w2ur/claude-code-setup/sync-setup.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 51 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,898 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.00051 $0.01898
Opus 5.5 $0.00020 $0.00759
Sonnet 5.5 $0.00010 $0.00380
Haiku 4.5 $0.00005 $0.00190

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

Security

Grade A, and why

sync-setup 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 6d 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.

commands/sync-setup.md · 126 lines

How it starts

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

Sync the claude-code-setup repo from the live ~/.claude/ configuration.

The rule that governs every step below

The arrow only points one way: ~/.claude/ → the repo. Everything under commands/, agents/, skills/, hooks/, mods/ and claude-scripts/ is generated, so fixing something by editing the repo's copy accomplishes nothing — the next sync reverts it. sync.py refuses (exit 2) when a destination matches neither the incoming content nor HEAD, which is what a hand edit looks like; --allow-dirty discards them on purpose.

The same applies to the SYNC-PRIVATE markers (the BEGIN / END pair), which drop a private section from the published copy: they belong in the live file, never in the repo. Every run reports how many regions it removed and from where — if that count drops unexpectedly, a marker was lost in an edit to the live source. Note this file deliberately never spells the pair out contiguously: it is a sync SOURCE, so a literal marker here would be read as a real one. scripts/README.md in the repo is owner-maintained, never synced, and carries the full syntax.

Owner-maintained files are the exception and are never synced: README.md, docs/, hooks/README.md, claude-scripts/README.md, root-level files.

Step 1: Run sync.py

cd ~/Dev/claude-code-setup && ./scripts/sync.py $0

If $0 is --dry-run or --audit-only, stop after this step.

If it exits 2 refusing to overwrite hand edits, do not reach for --allow-dirty first. Read the named files: the change they carry is usually one that belongs in ~/.claude/, and porting it there is the fix.

Step 2: Verify stale-file cleanup

sync.py prunes orphans: any file under a synced root (commands/, agents/, skills/, hooks/, mods/, claude-scripts/) whose live source has disappeared is deleted on a real run (reported on --dry-run) and listed under the ── Orphans ── section of the output. Common cases: renamed agents (e.g., old architect.md after rename to troubleshooter.md), deleted commands, removed skills, retired hooks.

Read the full file on GitHub · 126 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. 6d ago Changed 480c6fc1c00a
  2. 12d ago Changed · +2 lines de21fec13141
  3. 21d ago Changed · +5 lines 982728c27cd8
  4. 22d ago Changed c3bffc740692
  5. 1mo ago Changed 9b7a826f1b5a
  6. 1mo ago First seen · 119 lines · 51 tokens per session scan A 2e333f18fb70

Subscribe to this mod's changes

sync-setup is a command published in the GitHub repository w2ur/claude-code-setup (2 stars, last pushed 3d ago), licensed MIT. It adds 51 tokens to every session and 1,898 once invoked, about $0.0002 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.