Claude Code commit trailer lock

Keep Claude Code’s commit trailer on for everyone

For: the admin who manages Claude Code for your organization. Why Metrxbot asks: Metrxbot counts a merged pull request as AI-marked when at least one of its commits carries an AI trailer, such as Co-Authored-By: Claude … <noreply@anthropic.com>. Claude Code adds that trailer by default, but each developer can turn it off in their own settings. When the trailer is off, the commit looks like a commit written without AI, and the team page under-counts. This guide shows how to set the trailer once in managed settings so that no personal setting can remove it.

Checked against Anthropic’s Claude Code docs on 2026-11-25: settings reference, “Git and attribution”, managed settings and server-managed settings. If a step here disagrees with those pages, the docs win. Please tell us.

What the lock does and does not do

  • Claude Code has no switch that forces the trailer on. You lock it on by setting the trailer text yourself, in managed settings. A managed key beats every user, project and --settings value. Claude Code also tells Claude that a CLAUDE.md or memory rule about attribution does not override a commit line set in managed settings.
  • It covers commits that Claude Code makes. A commit a person types by hand, a squash that rewrites the message, or a git hook that strips trailers removes the mark. Metrxbot’s count therefore stays a lower bound, and the team page says “at least” next to it.
  • It does not record prompts, code or anything else. The trailer is one line in the commit message.

The setting

Put this in managed settings:

{
  "attribution": {
    "commit": "Co-Authored-By: Claude <noreply@anthropic.com>"
  }
}
  • Keep the <noreply@anthropic.com> address. Metrxbot matches on it.
  • Setting the text fixes the name to Claude. The default would name the model in use, such as Claude Sonnet 5. Metrxbot does not read the name.
  • Leave attribution.pr unset unless you want to change the pull request text. Metrxbot reads commits, not PR descriptions.
  • Do not set attribution to false, and do not set includeCoAuthoredBy to false, anywhere in managed settings. Either one turns the trailer off for everyone.
  • Keep includeGitInstructions unset or true. Setting it to false removes Claude Code’s built-in commit instructions, and the docs do not say whether the trailer survives that.

Where to put it

Use the one place your organization already manages Claude Code from. By default Claude Code reads only the highest-ranked managed source that sets any key and ignores the rest. If you already use the claude.ai console, a file on each laptop is skipped.

If you manage Claude Code throughPut the setting in
The claude.ai console (Team or Enterprise plans)Organization settings → Claude Code → Managed settings. Add the attribution key to the JSON already there. Clients pick it up at their next start or within the hour. On Enterprise, add it to every group configuration you use.
MDM (Jamf, Intune, Group Policy)macOS: the com.anthropic.claudecode managed-preferences domain, with attribution as a dictionary. Windows: the JSON in the Settings value under HKLM\SOFTWARE\Policies\ClaudeCode.
A file on each machinemacOS: /Library/Application Support/ClaudeCode/managed-settings.json. Linux and WSL: /etc/claude-code/managed-settings.json. Windows: C:\Program Files\ClaudeCode\managed-settings.json. You can also use a drop-in file in managed-settings.d/ next to it.

Cloud sessions on claude.ai read only console-managed settings, not a laptop’s file or MDM profile. If your developers use cloud sessions, set the key in the console.

Check that it took

  1. On one developer machine, restart Claude Code and run /status. The Setting sources line should list Enterprise managed settings, with remote, file or the MDM source in parentheses.
  2. Ask that developer to have Claude Code make a small commit on a scratch branch, then run git log -1. The message should end with Co-Authored-By: Claude <noreply@anthropic.com>.
  3. Have the developer set "attribution": false in their own ~/.claude/settings.json, restart, and make another commit. The trailer should still be there. If it is missing, the managed key is not in force. Check which source /status names.
  4. Remove the developer’s test setting afterwards.

What Metrxbot does with it

On a team workspace, an admin turns this on under Settings → Integrations → Team work usage → GitHub pull requests, after the employee notice is attested. Metrxbot then reads, once a day, the pull requests in the repositories you shared with its GitHub App. It uses the Pull requests: read permission the App already has; it does not ask for contents: read and never reads code. For each merged pull request it reads the commit messages in memory, notes whether one carries an AI trailer, and stores only that yes or no, never the message. The team page will show AI-marked pull requests as a share of all merged pull requests, for the team, never per person. You can set the lock now, so the history it reads is already marked.