Claude Code may add a Co-Authored-By: Claude line to commit messages it creates. It can also add a "Generated with Claude Code" line to pull-request descriptions and, in cloud or Remote Control sessions, a Claude-Session trailer.

If your team does not want that metadata in its history, you can switch it off. This article covers the settings that control it, a fallback for when settings are not enough, and how to clean up commits that already exist.

What Claude Code Adds and Why It Shows Up

A Git trailer is a key-value line at the end of a commit message, such as Co-Authored-By: Name <email>. Platforms like GitHub read this particular trailer and list the named person as a co-author on the commit.

Claude Code adds attribution by default, so a commit it writes can credit Claude alongside you. Several users have filed GitHub issues asking for an option to stop this, and one early workaround was to rewrite history by hand after every commit.

Attribution can appear in up to three places:

  • The Co-Authored-By trailer in commit messages.
  • A "Generated with Claude Code" line in pull-request descriptions.
  • A Claude-Session trailer when you use cloud or Remote Control sessions.

Removing the co-author line alone does not necessarily remove the other two, so it helps to configure all of them.

Disabling Attribution in settings.json

Claude Code reads settings from JSON files. You can put them in ~/.claude/settings.json to apply to every project, or in a project's .claude/settings.json to apply to one repository and share it with your team.

The current approach is the attribution setting. Setting each field to an empty string, and the session URL option to false, removes attribution entirely and leaves you as the sole author:

{
  "attribution": {
    "commit": "",
    "pr": "",
    "sessionUrl": false
  }
}
  • commit controls the text added to commit messages.
  • pr controls the text added to pull-request descriptions.
  • sessionUrl controls whether a Claude session URL is added to commits or pull requests.

If you already have a settings file, merge the attribution block into it rather than overwriting the file. Restart Claude Code afterward so the change is picked up.

The older includeCoAuthoredBy setting

Older guides recommend a boolean instead:

{
  "includeCoAuthoredBy": false
}

One user report describes this option defaulting to true in Claude Code v2.1.259. Another GitHub issue, reported against the latest version as of May 2026, says the setting was ignored and co-author credits kept appearing. Because of that, prefer the attribution block, and use the older flag only as an addition if you want to be thorough.

Backstops When Settings Are Not Enough

Some users report that attribution still appears intermittently even with settings in place. Two additional layers are worth adding.

Tell Claude in CLAUDE.md

Add an explicit rule to the project's CLAUDE.md file, which Claude Code reads as standing instructions:

## Git commits

- Never add a Co-Authored-By line to commit messages.
- Never add Claude or Claude Code attribution to commits or pull requests.

Telling Claude directly in a session, such as "don't add the Co-Authored-By line to commits," can also work, but nothing guarantees it is followed every time. Treat it as a hint, not enforcement.

Enforce it with a commit-msg hook

A commit-msg hook runs after a message is written and can edit it before the commit is recorded. This one strips any Co-Authored-By line that mentions Claude. Save it as .git/hooks/commit-msg and make it executable:

#!/bin/sh
# Remove Claude co-author trailers from the commit message file ($1)
sed -i.bak '/^Co-Authored-By:.*Claude/Id' "$1" && rm -f "$1.bak"
chmod +x .git/hooks/commit-msg

Hooks in .git/hooks are local and not shared through the repository, so each contributor must install them. This hook is independent of Claude's own behavior, which is why it works as a reliable last line of defense.

Cleaning Up Existing Commits

Settings only affect new commits. If the trailer is already on your latest commit, amend it and delete the line in the editor that opens:

git commit --amend

You can also edit the message before saving when Claude proposes a commit in an editor. For older commits, an interactive rebase (git rebase -i) lets you reword them.

Be careful with any history rewrite on commits you have already pushed. Rewriting changes commit hashes, so it requires a force push and can disrupt collaborators. Only do this on branches that nobody else depends on.

Conclusion

The primary fix is the attribution block in settings.json, with commit and pr set to empty strings and sessionUrl set to false. Put it in your user settings for a global effect or in the project's .claude folder for a team-wide one.

Because reports show attribution sometimes slipping through, add a rule to CLAUDE.md and consider a commit-msg hook for enforcement. Check your next few commits with git log to confirm the trailer is gone.