1014 B
2026-02-27 Session Notes
Claude Code Attribution Hook
Initiated implementation of a PreToolUse hook to block git commits containing Claude Code's automatic "Co-Authored-By: Claude noreply@anthropic.com" attribution. The plan involves two tasks:
-
Hook Script Creation - A bash script at
~/.claude/hooks/block-coauthor.shthat reads JSON from stdin, extracts the command viajq, checks forgit commitoperations, and scans for the Co-Authored-By pattern (case-insensitive). Denies execution if found, allows otherwise. -
Settings Registration - Adding a PreToolUse entry to
~/.claude/settings.jsonhooks object with matcher "Bash", 5-second timeout, and status message.
Examined existing settings.json structure which already has hooks configured for SessionStart, UserPromptSubmit, and SessionEnd via signet commands. The PreToolUse hook will follow the same pattern structure.
Session ended after reading settings.json; implementation of the hook script and settings update pending.