sync-docs

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

A command that updates core project planning and instruction files from recent work. It can inspect the latest commits and detect untracked files that are scattered in the project folder.

In plain words
What is it for?
Use it to synchronize files such as prompt plans, specifications, agent instructions, and project rules after completing a task.
Why use it?
It helps keep project metadata aligned with code changes and can warn about suspected sensitive files before documentation is changed. A check-only mode reports required 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-docs
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-docs

README.md
[![agentmods](https://agentmods.dev/badge/commands/sangrokjung/claude-forge/sync-docs.svg)](https://agentmods.dev/commands/sangrokjung/claude-forge/sync-docs)
Your own site
<a href="https://agentmods.dev/commands/sangrokjung/claude-forge/sync-docs"><img src="https://agentmods.dev/badge/commands/sangrokjung/claude-forge/sync-docs.svg" alt="Measured on agentmods" height="20"></a>
Per session 34 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,611 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.00034 $0.03611
Opus 5 $0.00017 $0.01806
Sonnet 5 $0.00007 $0.00722
Haiku 4.5 $0.00003 $0.00361

Measured 4d ago against content hash ea1072b13b75, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

sync-docs 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-docs.md · 356 lines

How it starts

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

/sync-docs - 문서 동기화 (v7.1)

Scope: prompt_plan.md, spec.md, CLAUDE.md, .claude/rules/ 등 핵심 프로젝트 메타 문서 동기화. 일반 문서(README, API docs, 가이드)는 /update-docs를 사용하세요.


0단계: 작업 설명 확인

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

git log --oneline -5

0.5단계: 흩어진 파일 housekeeping scan (CRITICAL, 2026-05-29 신설)

규칙: ~/qjc-office/dotclaude/rules/sync-housekeeping.md

문서 동기화 전, cwd에 흩어진 untracked 파일을 감지한다. 실제 이동은 본 명령어가 수행하지 않으며, 감지만.

~/.claude/scripts/sync-housekeeping-scan.sh --json > /tmp/sync-docs-housekeeping.json
LEVEL=$(python3 -c "import json; print(json.load(open('/tmp/sync-docs-housekeeping.json'))['level'])")
Level 동작
alert (PII/시크릿 패턴 감지) 즉시 중단 + /save-work --apply로 sanitize 권장 안내
warn (민감 파일 의심 또는 10개+ 흩어진 문서) 한국어 배너 stderr 출력 + 진행 유지 + /save-work --apply 권장
info (흩어진 파일 1~9개) 한 줄 카운트 출력 + 진행 유지
ok (정상) 출력 없이 진행

비활성: export QJC_SYNC_HOUSEKEEPING_DISABLED=1


1단계: 모드 결정 (CRITICAL)

인자에 --check-only가 포함되어 있으면:

  • 모든 Write/Edit 도구 호출을 금지한다.
  • 각 단계에서 "변경이 필요한 항목"만 수집한다.
  • 9단계의 --check-only 출력 형식을 사용한다.

이 판단은 이후 모든 단계에 적용된다. --check-only 모드에서는 Read/Glob/Grep/Bash(git)만 사용한다.


2단계: 변경된 코드 분석

현재 브랜치에서 변경된 파일과 내용을 파악한다.

diff 범위 자동 감지:

# main/master 브랜치와의 분기점 기반 (우선)
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
  # 분기점이 없으면 (main 브랜치 자체) 최근 커밋 기반
  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가 출력되면 동기화할 변경사항이 없으므로 사용자에게 알리고 종료한다.


충돌 해결 원칙

Read the full file on GitHub · 356 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 · 356 lines · 34 tokens per session scan A ea1072b13b75

Subscribe to this mod's changes

sync-docs is a command published in the GitHub repository sangrokjung/claude-forge (821 stars, last pushed 5d ago), licensed MIT. It adds 34 tokens to every session and 3,611 once invoked, about $0.0002 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.