[BUG] Commit messages polluted by `Generated with [Claude Code](https://claude.ai/code)` entries
Despite clear rules in CLAUDE.md to not do that, I still need to combat Claude spamming my commit messages with
│ 🤖 Generated with [Claude Code](https://claude.ai/code) │
│ │
│ Co-Authored-By: Claude <[email protected]>" │
Can you please stop or at least add option to opt-out?
https://docs.anthropic.com/en/docs/claude-code/settings#available-settings
| Key | Description | Example |
|---|---|---|
| apiKeyHelper | Custom script to generate an Anthropic API key | /bin/generate_temp_api_key.sh |
| cleanupPeriodDays | How long to locally retain chat transcripts (default: 30 days) | 20 |
| env | Environment variables that will be applied to every session | {"FOO": "bar"} |
| includeCoAuthoredBy | Whether to include the co-authored-by Claude byline in git commits and pull requests (default: true) | false |
At least try reading the docs folks
% claude config set includeCoAuthoredBy false
Error: Cannot set 'includeCoAuthoredBy'. Only these keys can be modified: allowedTools, dontCrawlDirectory, hasTrustDialogAccepted, hasCompletedProjectOnboarding, ignorePatterns. Did you mean --global?
% claude config set -g includeCoAuthoredBy false
Error: Cannot set 'includeCoAuthoredBy'. Only these keys can be modified: apiKeyHelper, autoUpdaterStatus, theme, verbose, preferredNotifChannel, shiftEnterKeyBindingInstalled, editorMode, hasUsedBackslashReturn, supervisorMode, autoCompactEnabled, diffTool, env, tipsHistory, parallelTasksCount, todoFeatureEnabled, messageIdleNotifThresholdMs
@dragonfax OK sorry to hear that, the documentation is always changing but this... was a feature.
Looks like the opt out includeCoAuthoredBy is broken - would be nice if it was either fixed, or if the documentation was fixed so people don't waste time trying something that doesn't work.
I manually added "includeCoAuthoredBy": false to ~/.claude/settings.local.json and I believe it worked.
I guess the CLI hasn't caught up, but it did work for me in ~/.claude/settings.json as well. So go for it.
I didn't really mind the "Co-Authored-By: Claude [email protected]" but it's causing the GitHub UI to tag some random guy (who has presumably claimed that's his email address?) in my commits which is annoying. So I've disabled it now, thanks to the comments here
Same issue, same user. I'm sure this will be fixed by Anthropic or Github, but cost me 2 hrs reviewing all the security settings, collaborators, keys, etc. Just heads up for others out there: In addition to the setting described by others, good idea to setup GPG key, so future commits will be verified. Then unverified or partially verified commits will stand out visually.
test
I guess the CLI hasn't caught up, but it did work for me in ~/.claude/settings.json as well. So go for it.
Not working on 1.0.43
I had the ignore flag in the project settings.local.json - claude delete it, along with my ENV vars.... I swear it's one step forward 2 steps back sometimes...
Based on similar closed issues (#617, #4204), here's the solution:
Solution
Manually add the includeCoAuthoredBy setting to your settings file:
~/.claude/settings.json (global) or .claude/settings.json (project-specific):
{
"includeCoAuthoredBy": false
}
Note: The claude config set command doesn't support this setting - manual editing is required.
This disables both the "🤖 Generated with [Claude Code]" line and "Co-Authored-By" attribution.
See settings documentation for more details.
🤖 Generated with Claude Code
FYI: Here's a complete summary of commands to fully clean up commits with Co-Authored-By attributions:
Complete Cleanup Commands
1. Create backup branch (safety first)
git branch backup-before-removing-attributions
2. Remove attributions from commit messages
FILTER_BRANCH_SQUELCH_WARNING=1 git filter-branch --msg-filter 'sed -e "/^Co-Authored-By:/d" -e "/🤖 Generated with \[Claude Code\]/d" | sed -e :a -e
"/^\s*$/{\$d;N;ba" -e "}"' -- --all
3. Clean up filter-branch backup refs
git for-each-ref --format="%(refname)" refs/original/ | xargs -n 1 git update-ref -d
4. Delete backup branch (optional - only after verifying success)
git branch -D backup-before-removing-attributions
5. Expire reflog immediately (optional - for complete removal)
git reflog expire --expire=now --all
git reflog expire --expire-unreachable=now --all
6. Aggressive garbage collection (optional - removes old objects)
git gc --prune=now --aggressive
7. Force push to remote (updates remote history)
git push --force-with-lease origin main
Notes:
- Steps 1-3 are essential
- Steps 4-6 are optional for complete local cleanup
- Step 7 updates the remote repository
- The remote will eventually garbage collect old commits on its own
--force-with-leaseis safer than--forceas it prevents overwriting others' work
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.