[FEATURE REQUEST] Allow disabling Claude attribution in git commit messages
Environment
- Platform (select one):
- [X] Anthropic API
- [ ] AWS Bedrock
- [ ] Google Vertex AI
- [X] Other
- Claude CLI version: 0.2.53
- Operating System: macOS 15.3.2
- Terminal: Warp + zsh
When using the Bash tool for git commits, Claude automatically adds attribution lines:
🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
This conflicts with our organization's commit message standards, which require single-line commits with no attribution.
## Feature request
Please add an option to disable Claude attribution in git commits. This could be implemented as:
- A configuration setting in Claude Code
- A parameter in the Bash tool when used for git commits
- Respecting project-level .git-commit-template files
Impact
This attribution creates extra work as we must manually remove it for every commit. It also poses risks of accidental attribution appearing in our git history,
which violates our standards.
## Additional context
Our CLAUDE.md (project guidelines) explicitly state: "Do not include attribution to Claude in the commit message or co-author attribution. Ever."
- issue text created by
claude-code:)
22 Comments
@mackermedia You mentioned adding an instruction to your CLAUDE.md. Does that fix the problem and you still want a config option, or does it not fix it?
I've added an instruction to my projects, but it usually forgets when the context is pretty full.
@reverie - I had previously added that instruction to my CLAUDE.md, but it didn't seem to respect it. Which is why I filed this issue.
Claude code had suggested I also add:
🐛 Fix order processing calculation for multi-origin shipments
✨ Add customer referral tracking feature
🔄 Update dealer dashboard with sales metrics
Please fix this.
CLAUDE.mdis not being respectedVery impressed with Claude Code in general.
Not very impressed that this attribution apparently has no way to be turned off, and furthermore that instructing via CLAUDE.md / other rules has no effect.
What purpose does this serve for Anthropic? Is marketing via my git commits really worth not respecting me as a dev?
Would using Github MCP to manage git workflow effectively remove the attribution, or would Claude just add the attribution there? Guess I'll try that out...
Here’s how is how I set up a global git hook to remove the attribution:
First, create a dedicated directory in your home folder to store your global Git hook scripts. If you already have one, you can skip this step.
Tell Git to use this newly created directory as the source for global hooks for all your repositories:
Create a new file named commit-msg (no extension) inside your ~/.git-hooks directory:
Open this ~/.git-hooks/commit-msg file with your preferred text editor and paste the following script into it. This script will remove the specified lines and clean up blank lines.
(Note for script users: Ensure this script file is saved with UTF-8 encoding for the 🤖 emoji to be handled correctly.)
Finally, make the commit-msg script (and any other scripts in that directory) executable:
How it Works:
This hardcoded attribution raises concerns beyond just workflow preferences. Once these attributions hit git commits, especially on GitHub, they create a permanent data trail of Claude usage patterns.
I'd like transparency on:
The fact that this ignores explicit user instructions (CLAUDE.md, .git-commit-template, etc.) suggests this serves purposes beyond simple transparency.
Request: Please provide both a configuration option to disable attribution AND clear documentation about why this was implemented as mandatory, what data (if any) is collected via these attributions, and how user privacy is protected.
Found this in .claude/local/node_modules/@anthropic-ai/claude-code/cli.js:
Modifying this should fix the issue?
p.s Wouldn't it be great if all those prompts were placed inside the users .claude folder for easy modification? That way one could modify it to ones liking e.g have to follow the Conventional Commits specification for all commit messages
My experience with this is that commit instructions in CLAUDE.md will often get ignored and i often have to say something like "commit (and remember to follow instructions in your memory)" -- it would be nice if it could be told to prefer CLAUDE.md commit instructions over its default instructions...
Would be really nice to have a configuration to turn this off as mentioned. Quite annoying and always have to cancel commits and tell it to remove the co-author.
Actually it has the option in documentation, but does not work.
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
``` zsh
~ on 🅰 (us-east-1)
at 18:28:22 λ 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, parallelAgents, todoFeatureEnabled, messageIdleNotifThresholdMs
This is shipped! We're working on making settings configurable via
config set. To unblock you for now, edit your settings.json to setincludeCoAuthoredBydirectly.given that this user https://github.com/Panchajanya1999 has attributed themselves to that email, you should probably change the default (and reclaim this email address on github)
Will this setting prevent the
🤖 Generated with [Claude Code](https://claude.ai/code)message added to Pull Requests as well?Thank you!
@bcherny claude still adds the claude attribution w/robot emoji to git commit messages, even with this added to
.claude/settings.json"includeCoAuthoredBy": false,edit: I think the problem was because I had a comment in the .json file, and maybe claude silently skips the file in that case. I'll re-comment if that is not the case.
This is still happening by the way, despite ""includeCoAuthoredBy": false" AND explicit instructions in CLAUDE.md.
It just forgets after a while, and I sometimes don't notice, and then I have to rewrite my git history.
Very annoying issue.
@mannewalis
i found that if your
.claude/settings.jsonis not 100% syntactically correct JSON (no extra commas, comments, etc) it will silently be ignored, and so your includeCoAuthoredBy option is not respected. with a valid settings.json i have not had this issue anymore.JSON is valid, but I am using settings.local.json in my project dir. I will try the global one.
@mannewalis it has to be in
.claude/settings.json(not.local) relative to the root folder you run claude from.mine has contents:
ok thank you @jasonswearingen I have made the change, and will report back if it adds the attribution again.
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
3. Clean up filter-branch backup refs
4. Delete backup branch (optional - only after verifying success)
5. Expire reflog immediately (optional - for complete removal)
6. Aggressive garbage collection (optional - removes old objects)
7. Force push to remote (updates remote history)
Notes:
--force-with-leaseis safer than--forceas it prevents overwriting others' workThis 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.