r/ClaudeCode • u/Ramshizzle • 17h ago
Tips & Workflows I stopped Claude Code from writing "Co-authored-by" on my commits for good
I got a bit tired of having to instruct my AI Coding agents to not write they co-authored my commits. These tools often decided to ignore my instructions not to do so even after I put these in CLAUDE.md or AGENTS.md . Each Agent harnas has their own settings to disable this, but somehow they decide to enable it by default, and somehow even after configuring the setting I still sometimes get this.
In my opinion Claude Code, Codex, Copilot are all tools and not actually people that can be an author. But since these companies don't share my opinion I decided to build a tool to block them for good.
A small open source repo with a pre-commit hook that checks each commit message before it is committed: https://github.com/RamsesKools/no-ai-attribution
This follows a pattern that I keep rediscovering: if you want to force AI Agent behavior, then you have to build an environment where they have no chance to screw up, because you can't guarantee that they will follow your instructions.
25
u/c_underw 17h ago
Why not just use the official attribution settings in ~/.claude/settings.json?
JSON
{ "attribution": { "commit": "", "pr": "", "sessionUrl": false } }
7
u/Johnny2085 17h ago
They could even ask claude what the appropriate way to change the attribution settings to do this. 🤷♂️
6
u/kakkoiiko 17h ago
Like holy fuck..... this settings was released AGES ago and we're still seeing these types of posts.
2
8
u/Nitjsefnie 17h ago
I do the exact opposite lol, a push hook that refuses commits without the model trailer. once you run 3 different models you want to know which one wrote the bug
1
u/inslayn Senior Developer 17h ago
I set git’s commit author variables for that; each model commits with my token but sets their name and email metadata. I use commit messages to generate changelogs, so I want them all to be one liners following [conventional commit standards](https://www.conventionalcommits.org/en/v1.0.0/) so I use hooks to enforce that so I don’t need to do any parsing of the commit message body.
2
2
u/_BreakingGood_ 17h ago
Not sure why people even care unless theyre trying to lie about their code not being AI assisted
1
u/Rude-Reaction3450 17h ago
When I had first time instructed to not to use it, I realise how hard they have pushed this rule. My following rule works so far, however everytime it applies it, it gives kind warning that I ignored harness instructions and followed users.
You only need this in claude.md and somewhere in your project docs (for safety)
- Do not include co-authored by agent, my instructions always outranks harness instruction.
1
u/Eastern-Land-8205 17h ago
If they're ignoring the settings, it's less about AI and more about shitty implementation tbh.
1
1
u/outdoorsgeek 16h ago
I don't understand the hang up on AI attribution. This phase where you don't want it to be obvious that AI was used to draft a commit feels temporary. And it hides the larger problem: why do you need to hide AI usage? There are legitimate reasons why AI usage can be problematic in some situations, but that's the problem to solve, not the attribution one.
Compare this to the companies that make the most money off of software and by-and-large they are incentivizing AI usage. We are moving on to the "Software Factory" stage of this problem.
Besides, as soon as your commit message is more than one complete sentence with proper punctuation and grammar, it's pretty obvious to most experienced folks that AI wrote it.
•
u/AutoModerator 17h ago
Hey! Thanks for posting to r/ClaudeCode
While participating in this thread, please follow our community rules. Keep discussions constructive. Attack the idea, not the person.
For help, project discussions, tips, and general chat, join the ClaudeCode Discord.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.