Model fills in anthropics as owner for `owner/repo#N` references instead of resolving the current repo

Resolved 💬 2 comments Opened Apr 8, 2026 by dobe Closed May 21, 2026

Summary

When following the system-prompt instruction to format GitHub references as
owner/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

  1. Open Claude Code in any repository whose owner is not anthropics.
  2. Fresh session, no compaction.
  3. Ask: "what are open PRs".
  4. 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:

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

  1. Have the harness resolve nameWithOwner once at session start and

surface it in the environment block, so the model has it without a tool
call.

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

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗