On this page
Disable Claude Code's Co-Author Git Attribution
Today I learned how to stop Claude Code from adding git attribution trailers to my commits and pull requests.
I initially added "gitCommitCoAuthor": false to my settings file. I expected that to silence the AI commit signatures. It did not. Claude Code continued stamping Co-Authored-By: Claude <[email protected]> trailers onto every commit and appending footer notes to pull requests.
The culprit was a configuration mismatch. Older boolean flags like includeCoAuthoredBy are deprecated, and unmapped keys like gitCommitCoAuthor are ignored. Current versions of Claude Code control this behavior through a dedicated attribution configuration object.
The Default Behavior
By default, Anthropic configures Claude Code to stamp provenance data onto your version control artifacts:
- Git commits: Appends a
Co-Authored-By: Claude <[email protected]>trailer line. - Pull requests: Appends a
Generated with Claude Codefooter note. - Remote sessions: Appends a
Claude-Session: <url>trailer line.
This metadata suits teams that require audit trails for generated code. But for solo developers, client repositories with strict authorship guidelines, or engineers who view Claude Code as a local editor tool, these trailers clutter your git log.
The Fix: The attribution Setting
To turn off git and pull request attribution, update your settings.json file. You can configure this globally for all projects or locally within a single repository:
- Global configuration:
~/.claude/settings.json - Project-level configuration:
.claude/settings.json(inside your repository root)
Set the commit and pr properties to empty strings:
{
"attribution": {
"commit": "",
"pr": ""
}
}
If you also run Claude Code from web or remote sessions, suppress the session URL trailer by setting sessionUrl to false:
{
"attribution": {
"commit": "",
"pr": "",
"sessionUrl": false
}
}
Passing empty strings instructs the harness to drop the trailer lines entirely instead of falling back to default text.
Configuration Keys Compared
Claude Code’s configuration options changed across releases. Here is how the keys differ:
| Setting Key | Status | Result |
|---|---|---|
"gitCommitCoAuthor": false | Invalid | Key is ignored. Claude Code continues appending commit trailers. |
"includeCoAuthoredBy": false | Deprecated | Replaced by attribution. Ignored in modern releases. |
"attribution": { "commit": "", "pr": "" } | Current standard | Empties the commit trailer and drops the pull request footer. |
Defense in Depth: Project Instructions and Git Hooks
The attribution setting handles automated tools. But Claude Code can still construct commit trailers manually if prompted to write a commit message in a shell command. Two extra layers prevent this.
1. Add Rules to CLAUDE.md
Add an explicit rule to your global ~/.claude/CLAUDE.md or repository-level CLAUDE.md file:
## Git Commit Conventions
- Never add `Co-Authored-By` or AI attribution trailers to commit messages.
- Never add "Generated with Claude Code" footers to pull request descriptions.
2. Enforce with a Local Git Hook
If you want absolute enforcement across all agent runs and terminal sessions, add a commit-msg hook to your repository:
cat << 'EOF' > .git/hooks/commit-msg
#!/bin/sh
COMMIT_MSG_FILE=$1
sed -i '' '/Co-Authored-By: Claude/d' "$COMMIT_MSG_FILE" 2>/dev/null || sed -i '/Co-Authored-By: Claude/d' "$COMMIT_MSG_FILE"
EOF
chmod +x .git/hooks/commit-msg
The hook strips any Co-Authored-By: Claude lines from the commit message file before git creates the commit object.
Cleaning Up Recent Commits
If Claude Code already stamped trailers onto your latest unpushed commit, remove the trailer by amending the commit message:
git commit --amend --no-edit
For older unpushed commits, run an interactive rebase (git rebase -i HEAD~N) and reword the commit messages to remove the trailer lines.
What I Learned
"gitCommitCoAuthor": falseis not a valid setting. Claude Code ignores it and continues stamping commits.- Claude Code deprecated the older
"includeCoAuthoredBy": falseflag in favor of the structured"attribution"setting. - Setting
"commit": ""and"pr": ""inside the"attribution"object strips attribution trailers from commits and pull requests. - Set
"sessionUrl": falseinside the"attribution"block to remove session link trailers during remote runs. - Combining the
attributionconfiguration with aCLAUDE.mdprompt rule and a localcommit-msghook stops attribution across every surface.
References
Prefer keeping your Git history free of AI attribution trailers? Tell me how your team handles commit provenance on LinkedIn.