sync-claude-md
Installation
SKILL.md
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-treefails) → the analysis below is git history; without it this skill has nothing to work from. Point the user to/initand 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/initto 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