Model fills in anthropics as owner for `owner/repo#N` references instead of resolving the current repo
Summary
When following the system-prompt instruction to format GitHub references asowner/repo#123 (introduced for the v2.1.84 linkification change, see #39114),
the model frequently emits a guessed owner instead of resolving the actual
owner of the current repo. The result is broken / non-clickable links.
This is distinct from the compaction-related context-loss bugs (e.g. #15169
→ #10960, #14968, #13678): no compaction is required to reproduce.
Reproduction
- Open Claude Code in any repository whose owner is not
anthropics. - Fresh session, no compaction.
- Ask: "what are open PRs".
- The model lists PRs and may format them as
anthropics/<repo>#<N>(or
another guessed owner) instead of <actual-owner>/<repo>#<N>.
In my session the repo was owned by a non-anthropics org and the model
emitted anthropics/<repo>#<N> for every PR.
Root cause (hypothesis)
The instruction tells the model what format to use but does not require it
to resolve the owner first. The example in the instruction text uses a real
owner (anthropics/claude-code#100), which may further anchor the guess —
but the underlying issue is the missing verification step, not the example
itself.
Suggested fix
Any of:
- Add an explicit verification step to the instruction, e.g. "Before
formatting a GitHub reference, resolve the current repo owner via
gh repo view --json nameWithOwner or the git remote."
- Have the harness resolve
nameWithOwneronce at session start and
surface it in the environment block, so the model has it without a tool
call.
- Change the example to a neutral placeholder (
owner/repo#123) to remove
any anchoring effect.
(1) or (2) addresses the root cause; (3) is cosmetic and only helps if
the anchoring hypothesis is real.
Environment
- Claude Code (Opus 4.6)
- Fresh session, no compaction
- Repo owner !=
anthropics
🤖 90% Claude
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗