[FEATURE] Let issue/PR "#123" links resolve against a chosen remote (e.g. upstream) instead of origin
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:
- A setting such as
issueUrlTemplate/issueRepository(mirroring the existingprUrlTemplate), e.g."issueRepository": "python/cpython"or"issueUrlTemplate": "https://github.com/python/cpython/issues/{number}". - Failing that, the
ghdefault repository (gh repo set-default), which already encodes "the repository I file issues against". - Failing that, the
upstreamremote if one exists, thenorigin.
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#Nor 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
originpoints at the canonical repository and the fork becomesfork. This changes the default push target for every branch trackingoriginand interferes withgh pr createfrom 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.