[FEATURE] Let issue/PR "#123" links resolve against a chosen remote (e.g. upstream) instead of origin

Status Open
Reported on v2.1.272
Maintainer reply None cached
Activity 0 comments · opened Sep 15, 2026

Preflight Checklist

  • [x] I have searched existing requests and this feature hasn't been requested yet
  • [x] This is a single feature request (not multiple features)

Problem Statement

In a fork-based workflow the repository has two remotes: origin is my personal fork (serhiy-storchaka/cpython) and upstream is the canonical repository (python/cpython), where all issues and PRs live. gh repo set-default is also set to python/cpython.

When Claude writes #140335 in a reply, the terminal and Remote Control UI turn it into a link, but the link is built from the origin remote: https://github.com/serhiy-storchaka/cpython/issues/140335. That page does not exist — the fork has no issues. So every issue and PR number Claude mentions in a review or triage summary is a dead link, and the only way to reach the right page is to retype the number into the canonical repository by hand.

I checked the settings docs and the settings reference: there is no key for the repository used for link resolution (prUrlTemplate only affects the links Claude puts in the PRs it creates).

Proposed Solution

Resolve bare #N references against a configurable repository, in this order of preference:

  1. A setting such as issueUrlTemplate / issueRepository (mirroring the existing prUrlTemplate), e.g. "issueRepository": "python/cpython" or "issueUrlTemplate": "https://github.com/python/cpython/issues/{number}".
  2. Failing that, the gh default repository (gh repo set-default), which already encodes "the repository I file issues against".
  3. Failing that, the upstream remote if one exists, then origin.

Even just honoring gh repo set-default would fix the common fork setup without any new configuration.

Alternative Solutions

  • Asking Claude to always write python/cpython#N or full URLs. That works for text Claude writes, but not for numbers quoted from tool output, and it has to be re-taught per project.
  • Renaming remotes so origin points at the canonical repository and the fork becomes fork. This changes the default push target for every branch tracking origin and interferes with gh pr create from the fork, so it is not a clean workaround.

Priority

Medium — the links are used constantly in review/triage work, but there is a manual workaround.

Environment

Claude Code 2.1.272, Linux, terminal + Remote Control; repository with origin = fork, upstream = canonical.

View original on GitHub ↗