返回
·5小时前
较热 · 42

Claude Session URL appended to commit messages and PR descriptions by default

Hhackernews·sparsesignal
查看原文
AI 摘要

Claude Code 自动将一个会话 URL(例如 "https://claude.ai/code/session _...")附加到每个提交消息和拉取请求描述中。此过程没有选择加入提示、警告,在入职培训期间也未提及,导致用户仅在它已经污染了他们的 Git 历史记录后才发现。尽管 commit-msg Git 钩子可以删除它,但此方法在远程或云环境中并非总是可靠。

Preflight Checklist

Problem Statement

Every commit message and PR description created by Claude Code automatically includes a session URL at the bottom (e.g. https://claude.ai/code/session _...). There is no opt-in prompt, no warning, and no mention of it during onboarding. Users only discover it after it's already polluting their git history.

Proposed Solution

Make the session URL attribution opt-in — don't include it unless the user explicitly enables it. A one-time prompt during onboarding ("Would you like to include a link back to this Claude session in commit messages?") would be the ideal UX.

Alternative Solutions

- Keep it opt-out but make the setting discoverable — show it during first commit with a "Don't add this again" option

- Remove it entirely and rely only on the existing Co-Authored-By: Claude trailer for attribution

Priority

Medium - Would be very helpful

Feature Category

Other

Use Case Example

A developer uses Claude Code to build a feature, commits the work, and opens a PR.

Their teammates and open source contributors see https://claude.ai/code/session _... at the bottom of every commit and PR description.

It looks unprofessional, clutters history, and the developer had no idea it was being added.

Additional Context

- The attribution.commit: "" setting in .claude/settings.json can suppress it, but it's completely undiscovered

- A commit-msg git hook can also strip it, but it doesn't always fire reliably in remote/cloud environments

Claude Session URL appended to commit messages and PR descriptions by default · BuzzRadr