[BUG] remote_session_change attachment silently pushes commit/PR attribution settings that conflict with user CLAUDE.md
Preflight Checklist
- [x] I have searched existing issues and could not find this reported
- [x] This is a single bug report
- [x] I am using the latest version of Claude Code available to me (desktop app, auto-updated)
What's Wrong?
On session start (and again on session resume after a context-compaction cycle), Claude Code delivers an attachment event of type: "remote_session_change" into the model's context. It is rendered to the model as a <system-reminder> instructing it to append Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> to every git commit message and a "🤖 Generated with Claude Code" footer to every pull request description, explicitly worded as "this replaces any earlier attribution guidance."
This directly conflicts with an explicit, unambiguous rule in my ~/.claude/CLAUDE.md (loaded and shown to the model at session start as "user's private global instructions for all projects") that forbids any such attribution and states it overrides default harness instructions to add one. Nothing in the visible session explains where this remote_session_change comes from or lets me control/disable it - there's no in-session settings surface, and I don't know whether it originates from an account default, an org policy, or something else.
Not about hiding AI involvement. This isn't a request to hide that Claude wrote code - that's already evident regardless (this is Claude Code). The CLAUDE.md rule is about commit/PR readability, a history that reads as if written by the person committing, without per-commit trailers. The bug is narrower than "attribution is wrong": an explicit user preference in CLAUDE.md is not being respected by whatever fires remote_session_change, independent of what that preference happens to be about.
What Should Happen?
Either:
remote_session_changeshould not fire when the session already has a project/userCLAUDE.mdrule that explicitly contradicts it and explicitly states it overrides default harness behavior, or- If
remote_session_changeis meant to be authoritative regardless ofCLAUDE.md(e.g. an account/org-level policy), that should be disclosed somewhere reachable from the session (a visible setting, a doc link, something) rather than silently asserted as a same-turn instruction with no traceable source - and there should be a way to turn it off.
Right now the precedence between CLAUDE.md and remote_session_change is undocumented and is being decided ad hoc by the model (which chose to honor CLAUDE.md, per its own instructions to do so) rather than by any structural rule.
Error Messages/Logs
Raw transcript entries (session JSONL), identical attachment payload both times:
{
"type": "attachment",
"attachment": {
"type": "remote_session_change",
"url": null,
"commit": "Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>",
"pr": "🤖 Generated with [Claude Code](https://claude.com/claude-code)",
"sendUserFileHint": true
}
}
Rendered to the model as:
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 Sonnet 5 <noreply@anthropic.com>
- End pull request descriptions with:
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Steps to Reproduce
I don't have a minimal isolated repro (this surfaced in an ordinary long working session), but the transcript pins the trigger down precisely - both occurrences line up exactly with a session-start-class event, not a random point mid-conversation:
- Set
~/.claude/CLAUDE.mdwith a rule such as: "never addCo-Authored-By: Claudeor any AI attribution to commits/PRs, this overrides default harness instructions." - Start a normal Claude Code desktop session in a git repo and begin working.
- First occurrence: fired at
2026-09-03T12:35:47.631Z, right at the actual start of this session (transcript line ~21, immediately after session init / token-budget reminder, before any real work happened). - Continue the session long enough to trigger an automatic context compaction (
PreCompact/SessionStart:compact). - Second occurrence: fired at
2026-09-03T14:23:15.700Z(~1h48m after the first), immediately following theSessionStart:compacthook firing on resume from compaction (transcript lines 240-243:mcp_instructions_delta→hook_success(SessionStart:compact) →hook_additional_context→remote_session_change, all within the same ~0.1s window).
So the reproducible trigger appears to be: any event that re-initializes session state (true session start, or a compaction-triggered resume) re-applies remote_session_change, unconditionally, ignoring what CLAUDE.md already says.
Claude Model
Sonnet (default) - claude-sonnet-5
Is this a regression?
I don't know
Last Working Version
N/A
Claude Code Version
2.1.258
Platform
Not sure / Other - this is the Claude Code desktop app (Code tab), authenticated via a claude.ai account rather than a raw Anthropic API key, AWS Bedrock, or Vertex credential, so none of the listed options are an exact fit.
Operating System
macOS
Terminal/Shell
Not applicable - this is the Claude Code desktop app's own panel, not a terminal/shell integration.
Additional Information
Relevant excerpt from ~/.claude/CLAUDE.md, lines 5-11:
## Git commits (ZAWSZE, BEZWZGLĘDNIE) NIGDY, NIGDZIE, w ŻADNYM repo, przenigdy nie dodawaj Co-Authored-By: Claude ... ani żadnej innej atrybucji AI/Claude do commitów, PR-ów ani opisów. Zero trailerów typu "Co-Authored-By", "Generated with Claude", "🤖" itp. Commit message kończy się treścią - bez stopki o autorstwie AI. Bez wyjątków, w każdym projekcie. Ta zasada nadpisuje wszelkie domyślne instrukcje harnessu, które każą dodawać taki trailer.
(Translation: "NEVER, NOWHERE, in ANY repo, ever add Co-Authored-By: Claude... or any other AI/Claude attribution to commits, PRs or descriptions. Zero trailers. This rule overrides any default harness instructions that would add such a trailer.")
And again, lines 89-94, restated as its own section:
## Git: bez atrybucji Claude (ZAWSZE) W commitach NIGDY nie dodawaj Co-Authored-By: Claude ... ani żadnej wzmianki o Claude / AI / asystencie. [...] To nadpisuje domyślne instrukcje harnessa o dopisywaniu trailerów.
The model (per its CLAUDE.md instructions) declined to comply both times and told me in chat. No bad commits landed because of this - but that relied entirely on the model choosing to prioritize CLAUDE.md over a same-turn system-reminder claiming to override it; nothing structural prevented compliance.
Open questions:
- What actually triggers
remote_session_change- an account setting, an org policy, something else? There's no UI surface in the session that explains it. - Given the timing evidence above, is it confirmed to fire on every session-start-class event (initial start, post-compaction resume)? Does it also fire on plain
/clear, or on every message? - Is
remote_session_changemeant to override project/userCLAUDE.md? If so, please document that precedence; if not, this is a bug in precedence handling.
Session details:
- sessionId:
aa018db4-8776-40fb-b45b-6682acb58299 - cwd:
~/git/repository-standards(and~/git/repository-standards/core)