@devries-cameron20 / t3code Mirror · read-only / commits / 1d9060b9af
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 22, 20:45 UTC

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

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

Theo Browne committed Oct 21, 2026 at 06:17 UTC 1d9060b9afa0a1305cbe652cd5aadfc59dab59bc
2 files changed +40 -1
apps/server/src/git/GitManager.test.ts
+36
@@ -2557,6 +2557,42 @@ it.layer(layerGitManagerTest)("GitManager", (it) => {
2557 }),
2558 );
2559
2560 + it.effect("includes CLAUDE.md for Claude writers only when it differs from AGENTS.md", () =>
2561 + Effect.gen(function* () {
2562 + const repoDir = yield* makeTempDir("t3code-git-manager-");
2563 + yield* initRepo(repoDir);
2564 + NodeFS.writeFileSync(NodePath.join(repoDir, "AGENTS.md"), "Use imperative subjects.\n");
2565 + NodeFS.copyFileSync(NodePath.join(repoDir, "AGENTS.md"), NodePath.join(repoDir, "CLAUDE.md"));
2566 + NodeFS.writeFileSync(NodePath.join(repoDir, "README.md"), "hello\n");
2567 + const commitInstructions: Array<string | undefined> = [];
2568 +
2569 + const { manager } = yield* makeManager({
2570 + serverSettings: {
2571 + textGenerationModelSelection: {
2572 + instanceId: ProviderInstanceId.make("claudeAgent"),
2573 + model: "claude-sonnet-4-5",
2574 + },
2575 + },
2576 + textGeneration: {
2577 + generateCommitMessage: (input) => {
2578 + commitInstructions.push(input.policy?.commitInstructions);
2579 + return Effect.succeed({ subject: "Update readme", body: "" });
2580 + },
2581 + },
2582 + });
2583 +
2584 + yield* runStackedAction(manager, { cwd: repoDir, action: "commit" });
2585 +
2586 + NodeFS.writeFileSync(NodePath.join(repoDir, "CLAUDE.md"), "Mention the Claude provider.\n");
2587 + NodeFS.writeFileSync(NodePath.join(repoDir, "README.md"), "hello again\n");
2588 + yield* runStackedAction(manager, { cwd: repoDir, action: "commit" });
2589 +
2590 + expect(commitInstructions[0]).toContain("Local AGENTS.md:\nUse imperative subjects.");
2591 + expect(commitInstructions[0]).not.toContain("Local CLAUDE.md:");
2592 + expect(commitInstructions[1]).toContain("Local CLAUDE.md:\nMention the Claude provider.");
2593 + }),
2594 + );
2595 +
2596 it.effect("falls back when the dedicated source control writer is unavailable", () =>
2597 Effect.gen(function* () {
2598 const repoDir = yield* makeTempDir("t3code-git-manager-");
apps/server/src/git/GitManager.ts
+4 -1
@@ -863,7 +863,10 @@ export const make = Effect.gen(function* () {
863 ? [["Recent commit subjects from this repository:", ...subjects].join("\n")]
864 : []),
865 ...(agentInstructions ? [`Local AGENTS.md:\n${agentInstructions}`] : []),
866 - ...(claudeInstructions ? [`Local CLAUDE.md:\n${claudeInstructions}`] : []),
866 + // CLAUDE.md is often a symlink or copy of AGENTS.md; skip the duplicate.
867 + ...(claudeInstructions && claudeInstructions !== agentInstructions
868 + ? [`Local CLAUDE.md:\n${claudeInstructions}`]
869 + : []),
870 ].join("\n\n");
871 if (!examples) {
872 return repositoryConventionsTextGenerationPolicy;