fix(server): commit prompts no longer repeat CLAUDE.md when it matches AGENTS.md#22848

merged1
main
fix/issue-12503-dedupe-claude-md
openedOct 21, 2026byTtheo
View on GitHubTwo-way sync enabledPR last imported Oct 21, 2026

With Repository conventions and a Claude source control writer, a repo whose CLAUDE.md is a symlink or copy of AGENTS.md sent the same instructions twice in every commit message and PR description prompt.

resolveStylePolicy now skips the Local CLAUDE.md block when its read content equals AGENTS.md. Content equality covers symlinks, hardlinks, and copies. A distinct CLAUDE.md is still included for Claude writers, and non-Claude writers still read only AGENTS.md. This is the one server path that builds these prompts, so commit, PR, and agent-triggered git actions all get the fix. No client, contract, or provider adapter change is needed.

Proof: the new GitManager.test.ts case "includes CLAUDE.md for Claude writers only when it differs from AGENTS.md" fails without the guard (the identical copy shows up as a second block) and passes with it. It uses a byte-identical copy rather than a symlink so it also runs on Windows. Ran vp test run apps/server/src/git/GitManager.test.ts (101 passed) and vp run check:changed (all pass). I did not run a real Claude writer end to end.

Scores: impact 3/10 · merge risk 1/10 · Theo-might-hate 1/10. Below the auto-merge bar (impact 6+, risk under 3, hate under 3).

Closes #12503

Made by Claude Opus 5.5 in Claude Code, running in T3 Code. 🤖 Generated with Claude Code

Checks

23 successful · 10 skipped
All checks passed
769e3fe

Added 1 commit

  • fix(server): commit prompts no longer repeat CLAUDE.md when it matches AGENTS.md769e3fe
Synced from GitHub

Approvability

Verdict: Approved at 769e3fe

Macroscope's review found this PR approvable — The server now omits a duplicate CLAUDE.md prompt block only when its contents match AGENTS.md, while preserving distinct Claude-specific guidance and adding regression coverage. The change is localized to prompt construction and tests, with no schema, deployment, or static-analysis suppression impact.

You can add or adjust custom eligibility rules. Learn more.

Synced from GitHub

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

ProviderMetricMain baselineThis PRImpactPR ceiling
CodexTotal thread wire5.0 KiB5.0 KiB+7 B (+0.1%)6.8 KiB✅
CodexThread snapshot wire3.8 KiB3.8 KiB0 B (0.0%)4.9 KiB✅
CodexLive turn WebSocket wire1.2 KiB1.2 KiB+7 B (+0.6%)2.0 KiB✅
CodexLive turn WebSocket decoded20.9 KiB20.9 KiB0 B (0.0%)29.3 KiB✅
CodexLive turn messages220 (0.0%)8✅
ClaudeTotal thread wire5.0 KiB5.0 KiB0 B (0.0%)6.8 KiB✅
ClaudeThread snapshot wire3.8 KiB3.8 KiB0 B (0.0%)4.9 KiB✅
ClaudeLive turn WebSocket wire1.2 KiB1.2 KiB0 B (0.0%)2.0 KiB✅
ClaudeLive turn WebSocket decoded21.2 KiB21.2 KiB0 B (0.0%)29.3 KiB✅
ClaudeLive turn messages220 (0.0%)8✅

Baseline: 066c8fc · PR result: 769e3fe · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 108.5 KiB
  • Claude decoded thread snapshot: 108.8 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

Synced from GitHub

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Path: .coderabbit.config.ts
  • Review profile: CHILL
  • Plan: Team
  • Run ID: 9b91e9b6-fa9e-47dd-8398-0d505094effa
📥 Commits

Reviewing files that changed from the base of the PR and between 066c8fc0cd04c97988ff8892e440189545ac6994 and 769e3fe5e9b99768b21136ea9c885f21f99c3c39.

📒 Files selected for processing: 2
  • apps/server/src/git/GitManager.test.ts
  • apps/server/src/git/GitManager.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.

📝 Walkthrough

The repository-conventions text generation now omits CLAUDE.md instructions when their content matches AGENTS.md. A regression test checks that differing CLAUDE.md content is included on the next commit.

Changes: Repository convention instructions

Layer / File(s)Summary
Deduplicate instructions and test behavior
apps/server/src/git/GitManager.ts, apps/server/src/git/GitManager.test.ts
The instruction builder adds CLAUDE.md content only when it is present and differs from AGENTS.md. A two-commit test checks behavior for identical and differing content.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~5 minutes

Change: Bug fix · Severity of issue fixed: Low

Suggested reviewers: juliusmarminge

Merge Risk: ⚪ Minimal · up to 769e3

No actionable merge-blocking risk remains for this change.

Pre-merge checks: 4
Check nameStatusExplanation
Title checkThe title clearly describes the primary server fix: avoiding duplicate CLAUDE.md instructions when they match AGENTS.md.
Linked Issues checkIssue [#12503] requires content-based deduplication of repository instructions for Claude writers. The supplied PR evidence shows that resolveStylePolicy omits the Local CLAUDE.md block when its c…
Out of Scope Changes checkThe reported changes are limited to apps/server/src/git/GitManager.ts and its regression test. The implementation guard and test directly support issue [#12503]. No unrelated client, contract, provi…
Description checkThe description clearly explains the problem, implementation, affected scope, linked issue, verification steps, observed test results, and untested real Claude writer path. The Scope and approval sect…
Full details: Linked Issues check

Explanation

Issue [#12503] requires content-based deduplication of repository instructions for Claude writers. The supplied PR evidence shows that resolveStylePolicy omits the Local CLAUDE.md block when its content equals AGENTS.md, while retaining distinct content. The evidence also shows a regression test for identical and changed files. The shared server path covers commit and change-request prompt generation. Non-Claude writers remain unchanged.

Full details: Out of Scope Changes check

Explanation

The reported changes are limited to apps/server/src/git/GitManager.ts and its regression test. The implementation guard and test directly support issue [#12503]. No unrelated client, contract, provider adapter, or other change is reported.

Full details: Description check

Explanation

The description clearly explains the problem, implementation, affected scope, linked issue, verification steps, observed test results, and untested real Claude writer path. The Scope and approval section does not include an explicit maintainer approval comment or clearly state why the fix qualifies for an approval exemption, but the overall description is complete enough to pass.

✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.