Skip to content

claude: stop bare #N point refs and commit/PR attribution#21579

Merged
awskii merged 2 commits into
mainfrom
taratorio/claude-github-conventions
Jun 2, 2026
Merged

claude: stop bare #N point refs and commit/PR attribution#21579
awskii merged 2 commits into
mainfrom
taratorio/claude-github-conventions

Conversation

@taratorio

Copy link
Copy Markdown
Member

Two tweaks to how Claude Code operates in this repo.

1. Bare #N references in GitHub text

Claude 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.md now instructs Claude to write "point 1" / "item 1" / "the first nit" and reserve #N for genuine issue/PR references.

2. Claude attribution in commits, PRs, and issues

Stop adding Co-Authored-By: Claude and 🤖 Generated with Claude Code lines.

Enforced deterministically in .claude/settings.json rather 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: attribution alone is insufficient today — the PR code path does a truthy check on attribution.pr, so an empty string is ignored and the "Generated with" footer still leaks into PR bodies. includeCoAuthoredBy: false is the reliable global off-switch. agents.md documents 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 #1 examples above are shown as code so they don't auto-link.

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.
@taratorio taratorio changed the title claude: stop Claude commit/PR attribution and bare #N point refs claude: stop claude commit/PR attribution and bare #N point refs Jun 2, 2026
@taratorio taratorio changed the title claude: stop claude commit/PR attribution and bare #N point refs claude: stop bare #N point refs and commit/PR attribution Jun 2, 2026
@yperbasis yperbasis requested a review from Copilot June 2, 2026 10:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 #N for list-item references in GitHub text (use “point 1”, “item 1”, etc.).
  • Disable Claude attribution repo-wide via .claude/settings.json (includeCoAuthoredBy: false plus empty attribution strings).

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.

Comment thread agents.md Outdated

### 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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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."

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
@awskii awskii added this pull request to the merge queue Jun 2, 2026
Merged via the queue into main with commit cd14dee Jun 2, 2026
92 checks passed
@awskii awskii deleted the taratorio/claude-github-conventions branch June 2, 2026 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants