sync-claude-md

A workflow for keeping a project's CLAUDE.md instructions aligned with how its codebase has changed. CLAUDE.md is a project guidance file used by Claude Code.

In plain words
What is it for?
Use it to review git history, identify outdated guidance, and propose updates without committing them.
Why use it?
It reveals when the instructions no longer match the repository, using the changes made since the file was last updated.

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

Made for: Claude Code, Codex.

Per session 30 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 630 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.00030 $0.00630
Opus 5 $0.00015 $0.00315
Sonnet 5 $0.00006 $0.00126
Haiku 4.5 $0.00003 $0.00063

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

Security

Grade A, and why

sync-claude-md 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 2d 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.

context-management/skills/sync-claude-md/SKILL.md · 48 lines

How it starts

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

Sync CLAUDE.md

Keeps project-level CLAUDE.md synchronized with codebase evolution. Never commits: the user commits manually.

Preconditions:

  • Not in a git repo (git rev-parse --is-inside-work-tree fails) → the analysis below is git history; without it this skill has nothing to work from. Point the user to /init and stop.
  • Locate the file: check ./CLAUDE.md (preferred), then ./.claude/CLAUDE.md. If both exist, warn about the duplicate, recommend consolidating to ./CLAUDE.md, and ask which to update. Missing → suggest /init to bootstrap one and stop.

1. Gather change context

Use the path located above (not a hardcoded CLAUDE.md):

path=<located path, e.g. ./CLAUDE.md>
last=$(git log --follow --format="%H" -1 -- "$path")
git rev-list --count "$last"..HEAD
git log --oneline "$last"..HEAD

Identify commits that contradict or outgrow what CLAUDE.md claims: library migrations, new tools or commands, architecture shifts. If more than 10 commits, delegate complex change areas to a subagent via the Agent tool; require its findings in the format <sha> | <CLAUDE.md claim impacted>, one line each, so the SHAs survive into the proposal. For 10 or fewer, read the commits directly (git show --stat on key ones).

Zero relevant commits since the last CLAUDE.md change → say so and stop. Do not pad an empty proposal.

2. Proposal

Draft a proposal: summary, then sections to add / modify / remove, each with exact content, a one-line rationale, and a Motivated by: <sha> (or <A>..<B>) line. Every SHA cited in a Motivated by: line (for a range, both endpoints) must appear in step 1's git log output. An item without a motivating commit is not proposed. General improvement of the file is context-audit's territory, not this skill's. Preserve existing good content; never remove anything whose purpose you don't understand.

3. Approval and apply

Present the full proposal, then use AskUserQuestion to confirm (apply / reject). On approval: apply with Edit (Write only for a full rewrite), summarize what changed, remind the user to review and commit. On rejection: offer to save the proposal to a file for later.

Read the full file on GitHub · 48 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. 2d ago First seen · 48 lines · 30 tokens per session scan A 9feadab0aa04

Subscribe to this mod's changes

sync-claude-md is a skill published in the GitHub repository bengous/claude-code-plugins (4 stars, last pushed 3d ago), licensed MIT. It adds 30 tokens to every session and 630 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-31.