Skip to content

Commit b5a226e

Browse files
MarcoDotIOclaude
andauthored
fix(source-control): merge messages drop Claude Code's current claude.com footer (#23133)
Co-authored-by: Claude Opus 5.5 <[email protected]>
1 parent a12d6ed commit b5a226e

2 files changed

Lines changed: 15 additions & 1 deletion

File tree

‎packages/source-control-core/src/server/mergeMessage.test.ts‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,20 @@ describe("removeAgentCredits", () => {
2121
).toBe("Details about Claude support.\n\n\nCo-authored-by: Alice <[email protected]>");
2222
});
2323

24+
it("removes the footer Claude Code writes today, which links to claude.com", () => {
25+
expect(
26+
removeAgentCredits(
27+
[
28+
"Details",
29+
"",
30+
"🤖 Generated with [Claude Code](https://claude.com/claude-code)",
31+
"",
32+
"Co-Authored-By: Claude <[email protected]>",
33+
].join("\n"),
34+
),
35+
).toBe("Details");
36+
});
37+
2438
it("preserves unknown identities, humans named after agents, and ordinary prose", () => {
2539
const message = [
2640
"Co-authored-by: Claude <[email protected]>",

‎packages/source-control-core/src/server/mergeMessage.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export function removeAgentCredits(message: string): string {
4242
AGENT_EMAILS.has(email) &&
4343
(email !== "[email protected]" || /^github copilot$|^copilot$/i.test(author![1]!));
4444
const footer = text.replace(
45-
/\[([^\]]+)\]\(https:\/\/(?:claude\.ai|www\.anthropic\.com|chatgpt\.com|openai\.com|cursor\.com|github\.com|opencode\.ai|x\.ai|antigravity\.google)(?:\/[^\s)]*)?\)/gi,
45+
/\[([^\]]+)\]\(https:\/\/(?:claude\.ai|claude\.com|www\.anthropic\.com|chatgpt\.com|openai\.com|cursor\.com|github\.com|opencode\.ai|x\.ai|antigravity\.google)(?:\/[^\s)]*)?\)/gi,
4646
"$1",
4747
);
4848
if (!agentAuthor && !GENERATED_BY_AGENT.test(footer)) return true;

0 commit comments

Comments
 (0)