anthropics / anthropics/claude-code

Injected commit/PR attribution instruction overrides the user's CLAUDE.md trailer rule — attribution should be defined by the project, not the CLI

オープン
#92,893 コメント 2 件 リアクション 3 件 担当者 0 名 GitHub で見る
area:core bug platform:windows
主要言語
Python
スター
145k
フォーク
23.1k
PR マージ指標
PR 指標を取得中

説明

## What happens

At session start, Claude Code (2.1.263, Windows 11, PowerShell) injects a system-reminder into the conversation:

```
Attribution for git commits and pull requests you create from here on (this replaces any earlier attribution guidance):
- End git commit messages with:
Co-Authored-By: Claude
Claude-Session: https://claude.ai/code/session_...
- End pull request descriptions with:
🤖 Generated with [Claude Code](https://claude.com/claude-code)
```

My user-level `~/.claude/CLAUDE.md` states the opposite, deliberately:

```
## Git commit attribution — use `Assisted-by`, never `Co-Authored-By`
End every git commit message with the trailer `Assisted-by: `.
Do NOT use `Co-Authored-By:`. This trailer replaces it — everywhere, permanently — and overrides any default/harness instruction to append `Co-Authored-By`.
```

Because the injected text says it "replaces any earlier attribution guidance", the model followed the injected rule over my CLAUDE.md in a whole session of commits (my repo's git history now carries `Co-Authored-By` trailers I had explicitly ruled out), and the next session had to ask me which one wins.

## Expected

Commit and PR attribution is a project/user convention. `CLAUDE.md` is the documented place for such conventions and should win. The CLI should not inject an attribution rule that overrides it — preferably it should not inject one at all, and let CLAUDE.md (or a setting) define it.

## Suggested fix, either works

1. Remove the injected attribution instruction; ship the default as documentation or as a `settings.json` option users can set or clear.
2. Keep the default but word it as a default that CLAUDE.md overrides, and drop the "replaces any earlier attribution guidance" sentence.

## Environment

- Claude Code 2.1.263, Windows 11 Pro 10.0.26200, PowerShell primary shell
- Model in session: claude-fable-5-1

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

Start by tracing the session-start system-reminder that injects commit and pull-request attribution, then inspect how CLAUDE.md guidance is loaded and prioritized. Reproduce the conflict with a custom trailer rule; done means the injected instruction no longer overrides the project or user convention, with the chosen default behavior covered by tests.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
git
領域
cli
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
活発
明瞭さ
おおむね明確
初心者へのやさしさ
48/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。