sync

sync is a command for coding agents from sangrokjung/claude-forge. It costs 22 tokens per session (2,112 once invoked), scanned A, original, MIT.

A command that pulls the latest code from the main Git branch and updates the project's key planning and instruction documents to match it.

In plain words
What is it for?
Use it after changes have been made elsewhere to update your local project and keep its documentation aligned with the code.
Why use it?
It combines two steps that can otherwise be forgotten or done inconsistently. It also warns about uncommitted work and can show needed document changes without editing files.

Command

Part of the claude-forge plugin — 5 skills, 35 commands, 17 agents shipped together

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 commands/sangrokjung/claude-forge/sync
Clone the repo
git clone --depth 1 https://github.com/sangrokjung/claude-forge

Or install claude-forge, the plugin that ships this one along with the rest of its 5 skills, 35 commands, 17 agents.

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

README.md
[![agentmods](https://agentmods.dev/badge/commands/sangrokjung/claude-forge/sync.svg)](https://agentmods.dev/commands/sangrokjung/claude-forge/sync)
Your own site
<a href="https://agentmods.dev/commands/sangrokjung/claude-forge/sync"><img src="https://agentmods.dev/badge/commands/sangrokjung/claude-forge/sync.svg" alt="Measured on agentmods" height="20"></a>
Per session 22 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,112 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.00022 $0.02112
Opus 5 $0.00011 $0.01056
Sonnet 5 $0.00004 $0.00422
Haiku 4.5 $0.00002 $0.00211

Measured 4d ago against content hash b33ff55c5e6a, 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 4d 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.md · 284 lines

How it starts

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

/sync - Git Pull + 문서 동기화


플래그

플래그 설명
--no-pull pull 건너뛰고 문서 동기화만 실행 (/sync-docs와 동일)
--check-only 문서 변경 필요 사항만 보여주고 수정하지 않음
(없음) pull + 문서 동기화 모두 실행

Phase 1: Git Pull (--no-pull 시 스킵)

1-1. 현재 상태 확인

git branch --show-current
git status --short

커밋되지 않은 변경사항이 있으면 경고:

작업 중인 변경사항이 있습니다. stash 후 진행할까요? (Y/n)
  • Y: git stash 후 진행, pull 후 git stash pop
  • n: 그대로 pull 시도

1-2. Pull 실행

git pull origin main

충돌 발생 시 Phase 2 진행하지 않고 충돌 보고 후 중단.


Phase 2: 문서 동기화 (sync-docs v7 로직)

2-0. 모드 결정 (CRITICAL)

--check-only 플래그가 있으면:

  • 모든 Write/Edit 도구 호출을 금지한다.
  • 각 단계에서 "변경이 필요한 항목"만 수집한다.
  • Read/Glob/Grep/Bash(git)만 사용한다.

2-1. 작업 설명 확인

인자로 전달된 작업 설명을 확인한다. 인자가 없으면 최근 커밋 메시지에서 작업 내용을 추론한다.

git log --oneline -5

2-2. 변경된 코드 분석

diff 범위 자동 감지:

BASE=$(git merge-base HEAD main 2>/dev/null || git merge-base HEAD master 2>/dev/null)
if [ -n "$BASE" ] && [ "$BASE" != "$(git rev-parse HEAD)" ]; then
  git diff --name-only "$BASE"..HEAD
  git diff --stat "$BASE"..HEAD
else
  COMMIT_COUNT=$(git rev-list --count HEAD 2>/dev/null || echo "0")
  if [ "$COMMIT_COUNT" -eq 0 ]; then
    echo "NO_COMMITS"
  elif [ "$COMMIT_COUNT" -ge 3 ]; then
    git diff --name-only HEAD~3..HEAD
    git diff --stat HEAD~3..HEAD
  else
    git diff --name-only HEAD~1..HEAD
    git diff --stat HEAD~1..HEAD
  fi
fi

NO_COMMITS가 출력되면 동기화할 변경사항이 없으므로 사용자에게 알리고 종료한다.

충돌 해결 원칙

소스 코드(git diff)가 최우선 진실 소스(source of truth)이다.

2-3. prompt_plan.md 동기화

Glob 패턴으로 prompt_plan.md를 탐색한다:

  • ./prompt_plan.md
  • ./.claude/prompt_plan.md
  • ./docs/prompt_plan.md

업데이트 항목:

  • 완료된 작업 항목 체크 (- [x])
  • 진행 상황 갱신
  • 다음 단계 업데이트

파일이 없으면 건너뛴다.

2-4. spec.md 동기화

Glob 패턴으로 spec.md를 탐색한다:

  • ./spec.md
  • ./docs/spec.md
  • ./.claude/spec.md

업데이트 항목:

  • 구현된 기능 반영
  • API 변경사항 반영
  • 데이터 모델 변경 반영

파일이 없으면 건너뛴다.

2-5. CLAUDE.md 동기화 (200줄 원칙 (Anthropic 공식))

Read the full file on GitHub · 284 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. 4d ago First seen · 284 lines · 22 tokens per session scan A b33ff55c5e6a

Subscribe to this mod's changes

sync is a command published in the GitHub repository sangrokjung/claude-forge (822 stars, last pushed today), licensed MIT. It adds 22 tokens to every session and 2,112 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-30.