attribution.commit: "" does not disable Co-Authored-By trailer
Bug
Setting attribution.commit to "" (empty string) in ~/.claude/settings.json does not disable the Co-Authored-By trailer on commits. The docs and the embedded help text both state:
Setcommitorprto empty string""to hide that attribution.
But commits still get the trailer appended.
Repro
- Set
~/.claude/settings.json:
{
"attribution": {
"commit": "",
"pr": ""
}
}
- Start a new Claude Code session
- Ask Claude to make a change and commit it (or use
/commit) - The commit message includes
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Analysis
From the compiled binary (v2.1.85), the relevant logic:
function fVH() {
// ...
let K = `Co-Authored-By: ${q} <noreply@anthropic.com>`;
let O = R8(); // reads settings
if (O.attribution)
return { commit: O.attribution.commit ?? K, pr: O.attribution.pr ?? $ };
if (O.includeCoAuthoredBy === false)
return { commit: "", pr: "" };
return { commit: K, pr: $ };
}
The ?? (nullish coalescing) logic is correct — "" ?? K should return "". So fVH() likely returns { commit: "", pr: "" } as expected.
However, the caller (the built-in /commit skill prompt via Rs1()) appears to inject the trailer into the commit message regardless, possibly through the system prompt instructing the model to add it, or through a separate code path that doesn't check the return value properly.
Expected behavior
With attribution.commit: "", no Co-Authored-By trailer should appear in commit messages.
Workaround
A commit-msg git hook that strips the trailer:
#!/bin/sh
sed -i '' '/^Co-Authored-By:.*<noreply@anthropic.com>/d' "$1"
Environment
- Claude Code v2.1.85
- macOS (Darwin 24.6.0, arm64)
- Setting was in
~/.claude/settings.json(user scope), last modified before the affected commits - New sessions still produce the trailer
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗