From e252d0d41acbc49e9081fd213244e2323f82f0dd Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 18 Sep 2026 05:51:10 +0000 Subject: [PATCH] docs(agents): give the claim pre-check its right delimiter, so a card number cannot prefix-match MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The documented one-command pre-check read `git ls-remote --heads origin | grep issue-N` with no right delimiter, so a card number that is a prefix of a longer card number matched that longer card's branch. Measured on `origin` at 2026-09-18T05:43Z: card 186 answered 3 heads (`claude/issue-18612-…`, `-18652-…`, `-18699-…`), none of them card 186, exit 0; card 1811 answered `claude/issue-18116-turso-begintransaction-radius`, card 18116. After: both answer 0 heads and exit 1, while a card that does have a head still answers it (positive control, card 18831: 1 head, exit 0). The delimited grep was chosen over the anchored refspec `refs/heads/claude/issue-N-*` because the refspec form is measurably blind to in-flight heads that do not carry the `claude/issue-` shape: `copilot/fix-issue-1172` (card 1172) and `claude/github-issue-2801-ee86eb` (card 2801) each read 0 heads under the refspec and 1 head under the delimited grep. A pre-check that hides real in-flight work trades a false positive for a false negative, which is the worse direction for a discovery probe. The `(-|$)` alternation, not a bare trailing dash, is what keeps the slug-less spelling (`copilot/fix-issue-1172`) discoverable. Still one command, no second read, net 0 lines: AGENTS.md 1099 / 1099 (ceiling 1099, headroom 0), widest table row 768 / 768 untouched, one line changed at 93 bytes. Claude-Session: https://claude.ai/code/session_01BTeBejoPUvRHN8WdAJC6oF Co-authored-by: Claude --- AGENTS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AGENTS.md b/AGENTS.md index 0dd75e3a6da..f781c23df02 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -459,7 +459,7 @@ Even inside your own worktree, operate defensively: 2. **One feature branch + one PR per task.** Branch off `main`. **Never commit task work straight to `main`.** Name the branch after the issue it fixes: `claude/issue--`. The issue number is what makes in-flight work *discoverable* — `git ls-remote --heads - origin | grep issue-` is a one-command pre-check, and the Duplicate Fix Guard + origin | grep -E 'issue-(-|$)'` is a one-command pre-check, and the Duplicate Fix Guard workflow warns on fix PRs whose branch names no declared issue. A hit is a hint, not a claim — most heads carry no PR: ⛔ never skip a card on one, the `Claim:` comment decides.