1
Tell HN: Git hook to keep LLM signatures out of your commit history
I’ve noticed a trend where LLMs append Co-authored-by: [AI Name] to the end of commit messages. Even if you try to prompt it away, context drift or new sessions eventually lead to one slipping through into the codebase.
I’m using a git hook to prevent any of that from reaching my commits instead of relying on LLMs.
#!/bin/sh
if grep -qi "co-authored-by" "$1"; then
echo "error: commit message contains 'Co-authored-by'. Commit rejected." >&2
exit 1
fi