iTranslated by AI

The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
🤫

Customizing Commit and PR Attribution Text with Claude Code's attribution Setting

に公開

Introduction

When developing with Claude Code, you may find that text like the following is automatically appended to commit messages or PR descriptions, or that icons appear as if it's a co-authored work due to Co-Authored-By.

Commit Message

feat: ログインフォームを追加

Generated with Claude Code
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

End of PR Body

Generated with Claude Code

Co-Authored-By

Depending on team development rules or project policies, there may be cases where you want to change or hide this default notation.

In this article, I will introduce how to customize these texts using the attribution setting.

includeCoAuthoredBy is now Deprecated

Previously, the includeCoAuthoredBy setting was used to control the addition of Co-Authored-By.

{
  "includeCoAuthoredBy": false
}

This setting is now deprecated. It is also stated in the official documentation as follows:

https://code.claude.com/docs/ja/settings

includeCoAuthoredBy: Deprecated: Please use attribution instead.

Since includeCoAuthoredBy can only control the presence of Co-Authored-By and cannot individually customize the entire attribution text for commit messages or PR descriptions, it is recommended to use the attribution setting going forward.

Overview of attribution Setting

attribution is a setting that allows you to customize attribution text for commits and PRs individually.

Property Target Default Value
commit Attribution text at the end of git commit messages Generated with Claude Code + Co-Authored-By: ...
pr Attribution text at the end of PR description Generated with Claude Code

By setting an empty string "", you can completely hide the attribution text.

Configuration File Locations

attribution is configured in settings.json type files. The storage location differs depending on the scope.

Scope File Path Purpose
User Settings ~/.claude/settings.json Applied to all projects
Project Settings .claude/settings.json Settings shared with the team
Local Settings .claude/settings.local.json For individual use (gitignored)

.claude/settings.local.json is automatically added to .gitignore, so there is no need to worry about personal settings being included in the repository.

Configuration Examples

Customizing Attribution Text

{
  "attribution": {
    "commit": "Created by author with Claude Code",
    "pr": "このPRはClaude Codeを活用して作成しました"
  }
}

In this case, the commit message will look like this:

このPRはClaude Codeを活用して作成しました will be appended to the end of the PR body.

Completely Hiding Attribution Text

{
  "attribution": {
    "commit": "",
    "pr": ""
  }
}

Attribution text will no longer be added to either commits or PRs.

Hiding Only Commits

{
  "attribution": {
    "commit": "",
    "pr": "このPRはClaude Codeを活用して作成しました"
  }
}

Nothing is added to the commit messages, and the custom text is only appended to the PR body.

Appearance in PRs

Comparison with includeCoAuthoredBy

Perspective includeCoAuthoredBy attribution
Status Deprecated Recommended
Commit Attribution Control Presence of Co-Authored-By only Entire text can be customized
PR Attribution Control Not possible Entire text can be customized
Individual Control Not possible Commits and PRs can be controlled individually

attribution is upwardly compatible with includeCoAuthoredBy, and if both are set, attribution takes precedence.

Overall View of an Actual Configuration File

Below is an actual example of .claude/settings.local.json combined with permission settings.

{
  "attribution": {
    "commit": "Created by author with Claude Code",
    "pr": "このPRはClaude Codeを活用して作成しました"
  },
}

Summary

  • includeCoAuthoredBy is deprecated. You should avoid using it in new configurations.
  • attribution allows you to customize attribution text for commits and PRs individually.
  • You can hide text with an empty string or customize it with any string.
  • Settings are written in .claude/settings.local.json (personal) or .claude/settings.json (team sharing).

References

Use Cases

I feel like there aren't many use cases lol

Discussion