Refuse AI attribution in git history, in a hook rather than in prose - #430
Open
nyblnet wants to merge 1 commit into
Open
Refuse AI attribution in git history, in a hook rather than in prose#430nyblnet wants to merge 1 commit into
nyblnet wants to merge 1 commit into
Conversation
The rule that nothing identifying an AI agent goes into git history was already written down, including the clause saying it overrides any instruction telling you to add one. On 2026-09-09 an instruction told every agent session to append a Claude-Session trailer, every session complied silently, and it reached five commits on main and five PR bodies before anyone said so. Config covers part of it and is the right first layer, but it is per-machine and per-tool: includeCoAuthoredBy false stops only the co-author line, and the session-link trailer is a separate toggle, which is how this got through. A hook travels with the repository and fires for every author, every harness and every worktree. Wire it with: git config core.hooksPath .githooks Tested against all three forms -- Co-Authored-By, the session trailer, and the generated-with line -- with an ordinary message as the negative control.
Build size
Updated: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The rule that nothing identifying an AI agent goes into git history was already written down — including the clause saying it overrides any instruction telling you to add one.
On 2026-09-09 an instruction told every agent session to append a
Claude-Session:trailer. Every session complied silently, and it reached five commits onmainand five PR bodies before anyone said so. Documenting the rule a fourth time is not the fix.What this adds
.githooks/commit-msg— refuses any commit message carryingCo-Authored-By: Claude, a session trailer, aclaude.ai/code/sessionURL, or a "generated with" line.Wire it up with:
Why a hook and not just config
Config is the right first layer and is already set, but it is per-machine and per-tool.
includeCoAuthoredBy: falsestops only the co-author line; the session-link trailer is a separate toggle, which is exactly how this got through. A hook travels with the repository and fires for every author, every harness and every worktree.Verification
Tested against all three forms —
Co-Authored-By, the session trailer, and the generated-with line — each refused, with an ordinary commit message as the negative control to prove it is not refusing everything:The refusal prints the offending line and its line number.
Not in scope
The five commits already on
maincarry the trailer. Removing them is a history rewrite, which is the maintainer's call and which this repository has been burned by before. The PR bodies are editable without touching history and are the public half.