claude-code - 💡(How to fix) Fix [BUG] `/ultrareview <PR#>` fails when origin remote uses an SSH host alias for multi-account setups [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#55064Fetched 2026-05-01 05:47:10
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Author
Timeline (top)
labeled ×4commented ×1

Error Message

Error Messages/Logs

  1. Improve the error message. The current message tells the user to add a remote, but the remote exists — it just

Root Cause

/ultrareview appears to detect GitHub by string-matching github.com against the remote URL. With the multi-account SSH-alias pattern, the URL stored in .git/config is the alias form (git@github-work:myorg/myrepo.git) — either because the insteadOf rule rewrote it at clone time, or because the user set it directly. The hostname github-work doesn't contain github.com, so the check fails.

Fix Action

Fix / Workaround

  1. Fall back to gh CLI. gh repo view --json nameWithOwner already returns the correct repo in this configuration — gh resolves the host via ~/.ssh/config (or its own auth state) and finds myorg/myrepo. If remote-URL parsing fails, try gh before giving up.
  2. Resolve SSH host aliases. Parse ~/.ssh/config and map Host github-work → HostName github.com before the GitHub check. This is what gh does internally.
  3. Improve the error message. The current message tells the user to add a remote, but the remote exists — it just isn't recognized. Mentioning SSH aliases / insteadOf as a known cause, and suggesting gh repo set-default as a workaround, would save debugging time.

Code Example

/ultrareview  123
/ultrareview <PR#> needs a GitHub remote so it knows which repository the PR is in. If this project is not on
     GitHub yet, run "gh repo create --source=. --push" to create one; if a GitHub repo already exists, run "git remote
     add origin REPO_URL". Or run /ultrareview with no argument to review your current branch instead.
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

/ultrareview <PR#> rejects repositories whose origin URL uses a custom SSH host alias (a common pattern for managing multiple GitHub accounts on one machine), even when the repo is unambiguously a GitHub repo and gh CLI resolves it correctly.

What Should Happen?

/ultrareview recognizes the repo as GitHub myorg/myrepo and reviews PR #123.

Error Messages/Logs

❯ /ultrareview  123
  ⎿  /ultrareview <PR#> needs a GitHub remote so it knows which repository the PR is in. If this project is not on
     GitHub yet, run "gh repo create --source=. --push" to create one; if a GitHub repo already exists, run "git remote
     add origin REPO_URL". Or run /ultrareview with no argument to review your current branch instead.

Steps to Reproduce

Configure git for the multi-account-via-SSH-alias pattern:

# ~/.ssh/config has a Host alias entry:
#   Host github-work
#     HostName github.com
#     User git
#     IdentityFile ~/.ssh/id_ed25519_work

# Global insteadOf rewrites GitHub URLs to the alias so the right key is used:
git config --global url.git@github-work:myorg/.insteadof https://github.com/myorg/

# Clone via the canonical URL — git rewrites it at clone time and persists the
# rewritten URL in .git/config:
git clone https://github.com/myorg/myrepo.git
cd myrepo

git remote -v
# origin  git@github-work:myorg/myrepo.git (fetch)
# origin  git@github-work:myorg/myrepo.git (push)

git config --get remote.origin.url
# git@github-work:myorg/myrepo.git

In Claude Code, run:

/ultrareview 123

Expected

/ultrareview recognizes the repo as GitHub myorg/myrepo and reviews PR #123.

Actual

/ultrareview <PR#> needs a GitHub remote so it knows which repository the PR is in.
If this project is not on GitHub yet, run "gh repo create --source=. --push" to create one;
if a GitHub repo already exists, run "git remote add origin REPO_URL".
Or run /ultrareview with no argument to review your current branch instead.

Passing the full URL form fails with a similarly misleading message:

/ultrareview https://github.com/myorg/myrepo/pull/123
> "https://github.com/myorg/myrepo/pull/123" is not a branch in this repo.


### Claude Model

None

### Is this a regression?

No, this never worked

### Last Working Version

_No response_

### Claude Code Version

2.1.123

### Platform

Anthropic API

### Operating System

Windows

### Terminal/Shell

Windows Terminal

### Additional Information

/ultrareview appears to detect GitHub by string-matching github.com against the remote URL. With the multi-account
SSH-alias pattern, the URL stored in .git/config is the alias form (git@github-work:myorg/myrepo.git) — either because
 the insteadOf rule rewrote it at clone time, or because the user set it directly. The hostname github-work doesn't
contain github.com, so the check fails.

This affects any developer using the documented multi-account pattern from GitHub's docs (separate SSH key per
account, host alias + insteadOf to keep canonical clone URLs working).

Suggested fixes (any of these would resolve it)

1. Fall back to gh CLI. gh repo view --json nameWithOwner already returns the correct repo in this configuration — gh
resolves the host via ~/.ssh/config (or its own auth state) and finds myorg/myrepo. If remote-URL parsing fails, try
gh before giving up.
2. Resolve SSH host aliases. Parse ~/.ssh/config and map Host github-work → HostName github.com before the GitHub
check. This is what gh does internally.
3. Improve the error message. The current message tells the user to add a remote, but the remote exists — it just
isn't recognized. Mentioning SSH aliases / insteadOf as a known cause, and suggesting gh repo set-default as a
workaround, would save debugging time.

extent analysis

TL;DR

The issue can be resolved by modifying the /ultrareview command to handle custom SSH host aliases in the repository's origin URL.

Guidance

  • The root cause of the issue is the /ultrareview command's inability to recognize GitHub repositories with custom SSH host aliases in their origin URL.
  • To verify the issue, clone a repository using the multi-account-via-SSH-alias pattern and run the /ultrareview command with a PR number.
  • Possible solutions include:
    • Falling back to the gh CLI to resolve the repository name.
    • Resolving SSH host aliases by parsing ~/.ssh/config and mapping the alias to the actual hostname.
    • Improving the error message to mention SSH aliases and suggesting a workaround using gh repo set-default.
  • To mitigate the issue, users can try running gh repo view --json nameWithOwner to verify that the gh CLI can resolve the repository correctly.

Example

No code snippet is provided as the issue is related to the /ultrareview command's behavior and not a specific code block.

Notes

The issue affects developers using the multi-account pattern with separate SSH keys per account and host aliases. The suggested fixes aim to improve the /ultrareview command's handling of custom SSH host aliases.

Recommendation

Apply a workaround by using the gh CLI to resolve the repository name, as it correctly handles SSH host aliases. This approach can be used until a permanent fix is implemented in the /ultrareview command.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [BUG] `/ultrareview <PR#>` fails when origin remote uses an SSH host alias for multi-account setups [1 comments, 2 participants]