claude: stop bare #N point refs and commit/PR attribution#21579
Conversation
Two tweaks to how Claude Code operates in this repo: 1. Numbered-point refs: Claude has written a bare #N (where N is a list-item number, meaning "point 1", "nit 1", etc.) in PR/issue/comment text, which GitHub auto-links to the unrelated PR/issue of that number. agents.md now tells it to write "point 1"/"item 1"/"the first nit" and reserve #N for genuine issue or PR references. 2. Attribution: stop adding "Co-Authored-By: Claude" and "Generated with Claude Code" lines to commits, PRs, and issues. Enforced via .claude/settings.json (includeCoAuthoredBy: false plus empty attribution) rather than prose, so it does not depend on the model remembering; also documented in agents.md.
There was a problem hiding this comment.
Pull request overview
Updates repo guidance and Claude Code configuration to prevent accidental GitHub auto-linking from bare #N “point” references, and to disable Claude attribution footers/trailers in commits, PRs, and issues.
Changes:
- Document a rule to avoid using bare
#Nfor list-item references in GitHub text (use “point 1”, “item 1”, etc.). - Disable Claude attribution repo-wide via
.claude/settings.json(includeCoAuthoredBy: falseplus emptyattributionstrings).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
agents.md |
Adds guidance on avoiding bare #N references and clarifies attribution is disabled via settings. |
.claude/settings.json |
Configures Claude Code to omit co-author and “Generated with” attribution content. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| ### Referring to numbered points in GitHub text | ||
|
|
||
| Never use a bare `#N` to refer to a numbered list item, point, step, or nit in PR descriptions, issue descriptions, or comments — GitHub auto-links `#N` to issue/PR number N (e.g. `#1` links to the unrelated PR #1). Write "point 1", "item 1", or "the first nit" instead, and reserve `#N` for genuine references to that issue or PR. |
There was a problem hiding this comment.
from my exp, "never" or "do not" works worse than direct command, like
"To refer a numbered item, point, step, use and #Num should be used only as a reference to PR/Issue within github."
There was a problem hiding this comment.
Good call, applied in 5027e34. Reworded to lead with the imperative and dropped the "never". I kept a one-line rationale (the auto-link reason) so the rule generalizes past the literal examples and matches the explain-the-why convention used elsewhere in agents.md. It now reads: "To refer to a numbered list item, point, step, or nit ..., write it in words (point 1, item 1, the first nit). Use #N only as a reference to a GitHub issue or PR number; GitHub auto-links it, so a bare #1 would point at an unrelated PR."
Lead with the desired behavior instead of "Never use ...", per review feedback that direct commands steer the model better than prohibitions. Keeps the one-line auto-link rationale.
Two tweaks to how Claude Code operates in this repo.
1. Bare
#Nreferences in GitHub textClaude has used a bare
#+number to mean "point N" — e.g. writing "#1" for "the nit from point 1" — in PR descriptions, issue descriptions, and comments. GitHub auto-links that to the issue/PR with that number, so "#1" turns into a link to the repo's first-ever PR. This came up in PR 21510 and has happened on other occasions.agents.mdnow instructs Claude to write "point 1" / "item 1" / "the first nit" and reserve#Nfor genuine issue/PR references.2. Claude attribution in commits, PRs, and issues
Stop adding
Co-Authored-By: Claudeand🤖 Generated with Claude Codelines.Enforced deterministically in
.claude/settings.jsonrather than as a prose instruction, so it does not depend on the model remembering:includeCoAuthoredBy: false— the one switch the installed Claude Code (v2.1.160) honors across both the commit and PR code paths; it returns empty attribution for each.attribution: { commit: "", pr: "" }— the newer, forward-looking mechanism; empties the footer text.Why both:
attributionalone is insufficient today — the PR code path does a truthy check onattribution.pr, so an empty string is ignored and the "Generated with" footer still leaks into PR bodies.includeCoAuthoredBy: falseis the reliable global off-switch.agents.mddocuments the rule for human readers too.Docs/config only — no Go changes, so build/lint are unaffected. This PR follows both rules itself: no attribution trailers on the commit, and the
#1examples above are shown as code so they don't auto-link.