.agents/memory/2026-02-27-block-co-authored-by-attribution-hook.md

946 B

2026-02-27 Session Notes

Block Co-Authored-By Attribution Hook

Nicholai requested implementation of a PreToolUse hook to block git commits containing Claude's automatic Co-Authored-By: attribution. The plan specifies creating a bash script at ~/.claude/hooks/block-coauthor.sh that:

  • Reads PreToolUse JSON payload from stdin
  • Extracts the git command via jq
  • Searches for the pattern Co-Authored-By:.*Claude (case-insensitive)
  • Returns permissionDecision: "deny" if found, otherwise allows execution

The hook must be registered in ~/.claude/settings.json with a 5-second timeout and status message.

Session work:

  • Reviewed existing settings.json structure to understand hook architecture
  • Confirmed hook format uses event-based triggers (SessionStart, UserPromptSubmit, SessionEnd)
  • Ready to implement both the script and settings modification

Next steps: Create the hook script and update settings.json configuration.