cd /news/ai-tools/til-disable-claude-code-s-co-author-… · home › topics › ai-tools › article
[ARTICLE · art-158688] src=kondasamy.com ↗ pub= topic=ai-tools verified=true sentiment=· neutral

TIL: Disable Claude Code's Co-Author Git Attribution

Claude Code now controls git and pull-request attribution through a dedicated `attribution` configuration object, and older keys such as `gitCommitCoAuthor` and the deprecated `includeCoAuthoredBy` are ignored, according to a TIL write-up on disabling the trailers. By default Anthropic's Claude Code appends a `Co-Authored-By: Claude` trailer to commits, a `Generated with Claude Code` footer to pull requests, and a `Claude-Session: <url>` trailer to remote sessions; setting `commit` and `pr` to empty strings in `~/.claude/settings.json` or `.claude/settings.json` drops them, and `sessionUrl: false` suppresses the session URL. The write-up also recommends `CLAUDE.md` rules and a `commit-msg` git hook to strip `Co-Authored-By: Claude` lines for enforcement across agent runs.

by read4 min views2 publishedOct 27, 2026
TIL: Disable Claude Code's Co-Author Git Attribution
Image: Kondasamy (auto-discovered)

On this page #

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 < trailers onto every commit and appending footer notes to pull requests.[email protected]>

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:

  1. Git commits: Appends aCo-Authored-By: Claude <[email protected] > trailer line.
  2. Pull requests: Appends aGenerated with Claude Code footer note.
  3. Remote sessions: Appends aClaude-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": false is not a valid setting. Claude Code ignores it and continues stamping commits.
  • Claude Code deprecated the older "includeCoAuthoredBy": false flag 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": false inside the"attribution" block to remove session link trailers during remote runs.
  • Combining the attribution configuration with aCLAUDE.md prompt rule and a localcommit-msg hook 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.

── more in #ai-tools 4 stories · sorted by recency
── more on @claude code 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/til-disable-claude-c…] indexed:0 read:4min 2026-10-27 · —