Noticed while working on PR #2100 (fix/guard-git-mergehead-skip).
Context: docs/examples/claude-code-hooks/guard-git.sh is meant to be an example copy of .claude/hooks/guard-git.sh, but it has drifted significantly out of sync — missing the -C worktree detection (detect_work_dir), branch-name validation, AI-attribution blocking in commit messages, and now the MERGE_HEAD merge-commit bypass added in PR #2100. A diff between the two files shows the example is missing most of the current hook's logic.
Why out of scope for #2100: the drift predates this PR by many prior PRs/features; fixing it is a separate, standalone doc-sync concern, not something introduced or required by the MERGE_HEAD fix.
Suggested fix: either resync docs/examples/claude-code-hooks/guard-git.sh with the current .claude/hooks/guard-git.sh, or replace the static copy with a build/CI step (or a note) that keeps the example in sync automatically so this doesn't keep drifting.
Noticed while working on PR #2100 (fix/guard-git-mergehead-skip).
Context:
docs/examples/claude-code-hooks/guard-git.shis meant to be an example copy of.claude/hooks/guard-git.sh, but it has drifted significantly out of sync — missing the-Cworktree detection (detect_work_dir), branch-name validation, AI-attribution blocking in commit messages, and now the MERGE_HEAD merge-commit bypass added in PR #2100. Adiffbetween the two files shows the example is missing most of the current hook's logic.Why out of scope for #2100: the drift predates this PR by many prior PRs/features; fixing it is a separate, standalone doc-sync concern, not something introduced or required by the MERGE_HEAD fix.
Suggested fix: either resync
docs/examples/claude-code-hooks/guard-git.shwith the current.claude/hooks/guard-git.sh, or replace the static copy with a build/CI step (or a note) that keeps the example in sync automatically so this doesn't keep drifting.