Table of Contents
Overview
When you work with Claude Code, you’ll notice that commit messages automatically end with a Co-Authored-By: Claude ... trailer, and PR bodies end with a 🤖 Generated with Claude Code line. Depending on your personal project or company policy, you may want to hide this attribution.
In this post, we’ll walk through how to use Claude Code’s attribution setting to remove the attribution from commits and PRs.
For Claude Code installation and basic usage, see Claude Code Basics and Basic Usage.
Why Hide the Attribution?
By default, Claude Code adds two pieces of attribution automatically:
- Commit message: A
Co-Authored-By: Claude <[email protected]>trailer at the end. - PR body: A
🤖 Generated with [Claude Code](https://claude.com/claude-code)line at the end.
There are various reasons to hide this attribution.
- Company policy that prohibits leaving third-party tool attributions in commit history.
- Wanting a clean commit log on personal projects.
- Not wanting Claude to appear in GitHub’s contributor graph.
- Wanting to keep PR bodies more concise.
Checking the Default Behavior
Before changing the setting, let’s confirm the default behavior. Without any configuration, a commit created by Claude Code looks like this:
feat: add user login feature
Implements login with email and password.
Co-Authored-By: Claude <[email protected]>
And a PR body ends like this:
## Summary
- Add user login feature
- Implement email/password validation logic
## Test plan
- [ ] Normal login test
- [ ] Invalid password input test
🤖 Generated with [Claude Code](https://claude.com/claude-code)
After applying this setting, only the trailing attribution line is removed. The rest of the commit message and PR body stays exactly the same.
includeCoAuthoredBy Setting (Deprecated)
In the past, people would set includeCoAuthoredBy to false to hide the attribution.
{
"includeCoAuthoredBy": false
}
However, this setting is now deprecated. The official Claude Code schema states:
Deprecated: Use attribution instead. Whether to include Claude’s co-authored by attribution in commits and PRs (defaults to true)
When adding a new configuration, it’s better to use the attribution approach. If you previously set includeCoAuthoredBy, switching to attribution will avoid any future compatibility issues.
attribution Setting (Recommended)
The attribution setting lets you control the commit and PR attribution independently.
{
"attribution": {
"commit": "",
"pr": ""
}
}
Specifying an empty string ("") hides that attribution.
The important point is that only the attribution portion is hidden. The commit message body or the PR body itself does not become empty. The normal commit message and PR body that Claude Code writes are preserved, and only the trailing trailer/line that was automatically appended is removed.
Controlling commit and pr Independently
Because commit and pr can be set separately, you can hide only one of them.
{
"attribution": {
"commit": "",
"pr": "🤖 Generated with [Claude Code](https://claude.com/claude-code)"
}
}
The example above hides only the Co-Authored-By trailer in commits while keeping the default attribution in PR bodies. Conversely, you can keep the trailer in commits and hide it only on PRs.
Replacing with Custom Text
Instead of hiding the attribution completely, you can also replace it with custom text.
{
"attribution": {
"commit": "Reviewed-by: Team Lead\nGenerated-by: Internal AI Assistant",
"pr": "---\n_This PR was assisted by an AI tool, and all changes were reviewed by a human._"
}
}
This is useful when you want to standardize the attribution format according to your company policy.
Choosing the Settings Scope
Claude Code’s settings files live in several locations, depending on their purpose.
| Scope | File Path | Applies To |
|---|---|---|
| User (Global) | ~/.claude/settings.json | All projects |
| Project | .claude/settings.json | All collaborators on this project |
| Local | .claude/settings.local.json | Only you, only this project |
Recommended locations for the attribution setting:
- Apply to all projects in your personal environment:
~/.claude/settings.json(user global) - Apply an attribution policy across the entire team:
.claude/settings.json(project, committed to Git) - Apply only to yourself without sharing with the team:
.claude/settings.local.json(local, gitignored)
If you want to hide the attribution for yourself while letting teammates use the default, add it to the global settings (~/.claude/settings.json).
Verifying the Settings
To check the settings file directly, run:
cat ~/.claude/settings.json
Or use jq to inspect only the attribution field.
jq '.attribution' ~/.claude/settings.json
If applied correctly, it should output:
{
"commit": "",
"pr": ""
}
After modifying the settings file, no Claude Code restart is needed — the change takes effect from the next commit/PR creation.
Things to Note
There are a few things to be aware of regarding the attribution setting.
- Do not set
includeCoAuthoredByandattributionat the same time. They can conflict, so use onlyattribution. - The attribution setting only affects the automatically appended portion. It does not affect the body of the commit message or PR description that Claude Code writes.
- Trailers in existing commits are not changed. This setting change only applies to commits and PRs created from now on.
- To enforce it as a company policy, include it in the project settings and commit it to Git. Note, however, that team members can override it with local settings.
Conclusion
That’s how to use Claude Code’s attribution setting to hide the Co-Authored-By attribution in commits and PRs.
Because includeCoAuthoredBy is deprecated, using attribution is recommended for any new configuration. You can control commit and pr independently, hide them with empty strings, or replace them with custom text — set them up to match your environment.
Was my blog helpful? Please leave a comment at the bottom. it will be a great help to me!
App promotion
Deku.Deku created the applications with Flutter.If you have interested, please try to download them for free.