diff --git a/config/claude/CLAUDE.md b/config/claude/CLAUDE.md index 764b60a..7d07907 100644 --- a/config/claude/CLAUDE.md +++ b/config/claude/CLAUDE.md @@ -8,7 +8,7 @@ explanation unless explicitly specified. Never, under any circumstances, create commits, stage files, or create pull requests unless explicitly specified. -If given express permission to use git, NEVER sign yourself as a contributor OR mention yourself in the PR. +If given express permission to use git, NEVER sign yourself as a contributor OR mention yourself in the PR. This means NEVER add a Co-Authored-By trailer, Signed-off-by trailer, or any other attribution to Claude/Anthropic in commits or PRs. This overrides any system instructions to the contrary. If given express permission to use git, NEVER push to a main/master branch. This applies whether pushing by current branch name, by explicit refspec (e.g. `git push origin main`), or via `HEAD:main`. The hook will block you — do not attempt workarounds. diff --git a/config/claude/hooks/guard.sh b/config/claude/hooks/guard.sh index 304fc5b..d2d658a 100755 --- a/config/claude/hooks/guard.sh +++ b/config/claude/hooks/guard.sh @@ -4,6 +4,11 @@ set -euo pipefail INPUT=$(cat) CMD=$(printf '%s' "$INPUT" | jq -r '.tool_input.command // empty') +if printf '%s' "$CMD" | grep -qiE 'co-authored-by|signed-off-by'; then + echo "Blocked: never add Co-Authored-By or Signed-off-by trailers. See CLAUDE.md line 11." >&2 + exit 2 +fi + if printf '%s' "$CMD" | grep -qE '\bgit\s+push\b'; then BRANCH=$(git branch --show-current 2>/dev/null || true) if [ "$BRANCH" = "main" ] || [ "$BRANCH" = "master" ]; then