···32323333let commit_msg_hook =
3434 {|#!/bin/sh
3535-# Check commit message for emojis and remove Claude attribution lines
3535+# Check commit message for emojis and remove AI attribution lines
36363737COMMIT_MSG_FILE="$1"
3838···4242 exit 1
4343fi
44444545-# Remove lines containing 'claude' (case-insensitive)
4646-if grep -qi 'claude' "$COMMIT_MSG_FILE"; then
4747- # Use sed to filter out claude lines in-place
4545+# Remove AI attribution lines (Co-Authored-By: Claude or similar patterns)
4646+if grep -qiE 'Co-Authored-By:.*[Cc]laude' "$COMMIT_MSG_FILE"; then
4747+ # Use sed to filter out AI attribution lines in-place
4848 if [ "$(uname)" = "Darwin" ]; then
4949- sed -i '' '/[Cc][Ll][Aa][Uu][Dd][Ee]/d' "$COMMIT_MSG_FILE"
4949+ sed -i '' '/[Cc]o-[Aa]uthored-[Bb]y:.*[Cc]laude/d' "$COMMIT_MSG_FILE"
5050 else
5151- sed -i '/[Cc][Ll][Aa][Uu][Dd][Ee]/d' "$COMMIT_MSG_FILE"
5151+ sed -i '/[Cc]o-[Aa]uthored-[Bb]y:.*[Cc]laude/d' "$COMMIT_MSG_FILE"
5252 fi
5353fi
5454···190190let check_ai_attribution dir =
191191 if not (file_exists (Filename.concat dir ".git")) then []
192192 else
193193- (* Get commits by the configured user that contain "claude" *)
193193+ (* Get commits by the configured user that contain AI attribution patterns *)
194194 let cmd =
195195- "git log --format='%h %s' --grep='[Cc]laude' --author=\"$(git config \
196196- user.name)\" 2>/dev/null"
195195+ "git log --format='%h %s' --grep='Co-Authored-By.*[Cc]laude' \
196196+ --author=\"$(git config user.name)\" 2>/dev/null"
197197 in
198198 let lines = run_in_dir dir cmd in
199199 List.filter_map