Git and attribution
Control the attribution Claude Code adds to commits and pull requests and how it works with git.
<span id="attribution-settings" />
attribution
Customize the attribution Claude Code adds to git commits and pull requests. Commits get a git trailer such as Co-Authored-By by default; pull request descriptions get plain text. Set each part separately with the sub-keys below.
- Scope:
Any file - Type: object with
commitandprstrings and asessionUrlBoolean - Default: unset, so Claude Code uses the standard attribution shown under each sub-key
This example replaces the commit attribution, removes pull request attribution, and drops the session link:
{
"attribution": {
"commit": "Generated with AI\n\nCo-Authored-By: AI <ai@example.com>",
"pr": "",
"sessionUrl": false
}
}To hide all attribution, set commit and pr to empty strings and sessionUrl to false. Once you set commit or pr, Claude Code ignores the deprecated includeCoAuthoredBy setting and uses its default text for whichever of the two you left unset.
includeCoAuthoredBy
Deprecated since v2.0.62, when attribution replaced it. Claude Code still reads it, but new configurations should set attribution.
Use attribution instead, which replaces this key and lets you change or hide the commit trailer, the pull request text, and the session link separately. Claude Code still honors includeCoAuthoredBy: false from settings files that predate attribution, but ignores it once you set attribution.commit or attribution.pr.
- Scope:
Any file - Type: Boolean
true: the same as unset; Claude Code adds the commit trailer and the pull request attribution textfalse: Claude Code omits both the commit trailer and the pull request attribution text, unlessattributionsetscommitorpr, in which case theattributionrules apply
- Default:
true
{
"includeCoAuthoredBy": false
}To hide all attribution today, set attribution.commit and attribution.pr to empty strings and attribution.sessionUrl to false.
includeGitInstructions
At session start, Claude Code adds two git-related pieces to Claude's prompt: its built-in instructions for how to write commits and pull requests, in the Bash tool's description, and a git status snapshot of your repository in the system prompt, meaning the current branch, the main branch, git status output, and recent commits. Set this key to false to leave both out, for example when you use your own git workflow skills.
- Scope:
Any file - Type: Boolean
true: Claude Code includes its built-in commit and pull request workflow instructions and the git status snapshot. Cloud sessions never include the snapshotfalse: Claude Code leaves both out
- Default:
true - Per-session overrides:
CLAUDE_CODE_DISABLE_GIT_INSTRUCTIONStakes precedence over this key for one session
{
"includeGitInstructions": false
}prUrlTemplate
Point the PR links Claude Code renders, in the footer badge and in tool-result summaries, at an internal code-review tool instead of github.com. Claude Code substitutes \{host\}, \{owner\}, \{repo\}, \{number\}, and \{url\} from the PR URL. GitLab merge request links on both surfaces keep their GitLab URL.
- Scope:
Any file - Type: string, a URL template using any of the five placeholders
- Default: unset
{
"prUrlTemplate": "https://reviews.example.com/{owner}/{repo}/pull/{number}"
}Claude Code applies the template only to the links it renders itself; a PR number Claude writes in a message, such as #123, stays as Claude wrote it. A URL that doesn't have the /pull/<number> shape is left unchanged.
attribution.commit
Set the attribution text Claude Code adds to git commits, including any trailers. Set it to an empty string to hide commit attribution.
- Scope:
Any file - Type: string
- Default: unset, so Claude Code adds
Co-Authored-By: <name> <noreply@anthropic.com>. The name is the session's active model, such asClaude Sonnet 5.- When Claude Code recognizes the model as a Claude model but can't confirm its exact version, it writes
Claudealone. - When it can't match the model ID to any Claude model, such as a third-party model served through a custom
ANTHROPIC_BASE_URL, it writesClaude Code.
- When Claude Code recognizes the model as a Claude model but can't confirm its exact version, it writes
This example replaces the default trailer with a custom line and a custom Co-Authored-By trailer:
{
"attribution": {
"commit": "Generated with AI\n\nCo-Authored-By: AI <ai@example.com>"
}
}attribution.pr
Set the attribution text Claude Code adds to pull request descriptions. Set it to an empty string to hide pull request attribution.
- Scope:
Any file - Type: string
- Default: unset, so Claude Code adds
🤖 Generated with [Claude Code](https://claude.com/claude-code)
{
"attribution": {
"pr": ""
}
}attribution.sessionUrl
Choose whether Claude Code appends the claude.ai session link when it commits or opens a pull request from a cloud or Remote Control session. Claude Code adds the link as a Claude-Session trailer on commits and as a link in pull request descriptions. Set it to false to omit the link.
- Scope:
Any file - Type: Boolean
true: Claude Code appends the claude.ai session link when it commits or opens a pull request from a cloud or Remote Control sessionfalse: Claude Code omits the link
- Default:
true
{
"attribution": {
"sessionUrl": false
}
}<span id="hook-configuration" />
<span id="hook-and-skill-settings" />