Make the Claude-Session commit and PR trailer opt-in or configurable
User Story
As a developer who commits agent-assisted work under my own name, I want to control whether Claude Code adds a Claude-Session trailer to my commits and PR descriptions, so that my commit history contains only what I chose to put there.
Background
Claude Code receives a system-level instruction to end every commit message with Claude-Session: https://claude.ai/code/session_<id> and to end every PR description with a session URL. In my session this arrived as a mid-conversation system reminder, and the agent applied it to every commit it made without asking me.
This is a problem for three reasons:
- Consent is assumed. Nothing asks whether I want the trailer, and nothing tells me it will be added until it is already in the history. I only learned about it by reading the commit log.
- I am accountable for the commit. My name and email are the author on these commits, and I answer for their content. The trailer adds third-party content to a record that carries my name. In practice it works as product advertising in my repository history, and as a link to a session that other contributors cannot open.
- It is hard to opt out of. The system reminder says the user's own instructions about these lines take precedence, but that depends on me anticipating the behavior and writing a rule in
CLAUDE.mdbefore the first commit. The default is applied, and removing it afterward meant rewriting history. In my case the branch had already been pushed, so it required a force push.
Agent-authored commits are useful, and a way to mark them as agent-assisted is a reasonable feature for people who want it. My request is that it be a choice made by the person whose name is on the commit.
Environment: Claude Code CLI 2.1.286, macOS.
Related issues
This overlaps with existing reports, which suggests the problem is not specific to my setup:
- https://github.com/anthropics/claude-code/issues/92893 (injected attribution instruction overrides a user's CLAUDE.md trailer rule)
- https://github.com/anthropics/claude-code/issues/94325 (attribution trailer emitted despite a CLAUDE.md rule against it)
- https://github.com/anthropics/claude-code/issues/96113 (
includeCoAuthoredBy: falseintermittently ignored mid-session) - https://github.com/anthropics/claude-code/issues/93237 (attribution setting ignored when set to an empty string)
My emphasis differs on the default: attribution should be opt-in, or chosen once by the user, rather than something users find and disable after the fact.
Acceptance Criteria
- [ ] Commit trailers and PR-description footers are off by default, or the user is asked once at first use whether to enable them
- [ ] A documented setting enables, disables, or customizes the commit trailer and the PR footer independently, and it is honored consistently for the whole session
- [ ] The setting can be applied at user level and overridden at project level
- [ ] When the setting is off, the agent adds no session URL, co-author line, or other attribution to commits or PRs
- [ ] The setting is described in the Claude Code settings documentation, including the exact text that is added when it is on
- [ ] If the trailer is enabled, the user can see the exact trailer text before the first commit that uses it
Technical Notes
- The behavior reaches the model as injected instruction text. A setting should control whether that text is injected at all, so that compliance does not depend on the model weighing it against user rules in
CLAUDE.md. - The related issues above report that existing settings (
includeCoAuthoredBy, the attribution setting) are ignored in some cases. Fixing those is a prerequisite for this to be reliable.
Out of Scope
- Removing the ability to attribute agent-assisted commits for users who want it
- Changing how Claude Code authors commits (author name and email)
- Retroactively rewriting existing commits
Open Questions
- Should the default be off, or should first use prompt the user to choose?
- Should organizations be able to require the trailer through managed settings, with the requirement visible to the user?