[BUG] TUI auto-links bare #number references to CWD repo instead of repo mentioned in context
Description
The Claude Code TUI auto-links any #<number> pattern (e.g., #1045, PR #1045) to the GitHub repo of the current working directory, even when the assistant is explicitly discussing a different repository. Full URLs work correctly, but bare references always resolve to the wrong repo.
Steps to Reproduce
- Clone and
cdinto any repo, e.g.anthropics/claude-code - Ask Claude to mention a PR from a different repo. For example:
> "Please mention PR #100 from anthropics/anthropic-cookbook with the full URL https://github.com/anthropics/anthropic-cookbook/pull/100 and also as a bare #100 reference"
- In the TUI output, hover over or click the links:
- The full URL (
https://github.com/anthropics/anthropic-cookbook/pull/100) → links correctly toanthropic-cookbook PR #100or bare#100→ links tohttps://github.com/anthropics/claude-code/issues/100(the CWD repo)
Expected Behavior
Bare #number references should either:
- Not be auto-linked at all (safest — the assistant can always use full URLs), or
- Be resolved using surrounding context (repo name mentioned nearby)
Actual Behavior
All #<number> patterns are auto-linked to https://github.com/<cwd-owner>/<cwd-repo>/issues/<number>, regardless of which repository the assistant is discussing. This creates misleading clickable links that point to the wrong repo.
Impact
- Confusing UX when Claude discusses cross-repo PRs/issues
- Users may click and land on unrelated or nonexistent issues
- Particularly problematic for workflows that involve multiple repositories (monorepo tooling, cross-repo reviews, etc.)
Workaround
Always use full GitHub URLs instead of bare #number references when discussing cross-repo PRs/issues.
Environment
- Claude Code TUI (terminal)
- macOS (likely affects all platforms)
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗