claude-code - 💡(How to fix) Fix [BUG] --teleport only checks the origin remote, fails when the GitHub remote has a different name [2 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#52099Fetched 2026-04-23 07:36:37
View on GitHub
Comments
2
Participants
2
Timeline
5
Reactions
0
Timeline (top)
labeled ×3commented ×2

Error Message

claude --teleport <session-id> fails with the error:

Error Messages/Logs

  1. The command fails with the "must run from a checkout of <user>/<repo>" error even though the current directory is exactly that checkout. Additionally, the error message could be improved to say something like:

Root Cause

This is disruptive because it invalidates existing branch tracking configuration that references origin/<branch>, and has to be repeated every time a session is teleported.

Fix Action

Workaround

Temporarily renaming remotes so the GitHub remote is called origin:

git remote rename origin origin-internal
git remote rename github origin
claude --teleport <session-id>
git remote rename origin github
git remote rename origin-internal origin

This is disruptive because it invalidates existing branch tracking configuration that references origin/<branch>, and has to be repeated every time a session is teleported.

Code Example

You must run claude --teleport <session-id> from a checkout of <user>/<repo>.

---

$ git remote show github
* remote github
  Fetch URL: git@github.com:<user>/<repo>.git
  Push  URL: git@github.com:<user>/<repo>.git
  HEAD branch: main

---

You must run claude --teleport <session-id> from a checkout of <user>/<repo>.

---

git remote rename origin github
   # or
   git remote add github git@github.com:<user>/<repo>.git

---

git remote rename origin origin-internal
git remote rename github origin
claude --teleport <session-id>
git remote rename origin github
git remote rename origin-internal origin
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?

claude --teleport <session-id> fails with the error:

You must run claude --teleport <session-id> from a checkout of <user>/<repo>.

This happens even when the current directory is a checkout of the correct repository, when the GitHub remote is configured under a name other than origin.

In my case, origin was already in use for a different (non-GitHub) remote, and the GitHub remote was named github:

$ git remote show github
* remote github
  Fetch URL: [email protected]:<user>/<repo>.git
  Push  URL: [email protected]:<user>/<repo>.git
  HEAD branch: main

--teleport appears to only inspect origin rather than scanning all configured remotes for one that matches the session's repository slug.

What Should Happen?

--teleport should succeed as long as any configured remote points at the expected <user>/<repo> on GitHub, regardless of the remote's local name. Using origin for non-GitHub remotes (internal mirrors, GitLab, Gitea, etc.) is a very common and legitimate workflow.

Error Messages/Logs

You must run claude --teleport <session-id> from a checkout of <user>/<repo>.

Steps to Reproduce

  1. Clone a GitHub repository and rename origin to something else, or configure the GitHub remote under a non-origin name from the start:
    git remote rename origin github
    # or
    git remote add github [email protected]:<user>/<repo>.git
  2. Optionally add a different remote under the name origin (e.g., an internal mirror).
  3. Create a Claude Code web session against the GitHub repo.
  4. Attempt to teleport: claude --teleport <session-id>.
  5. The command fails with the "must run from a checkout of <user>/<repo>" error even though the current directory is exactly that checkout.

Claude Model

None

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

2.1.117

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Other

Additional Information

Workaround

Temporarily renaming remotes so the GitHub remote is called origin:

git remote rename origin origin-internal
git remote rename github origin
claude --teleport <session-id>
git remote rename origin github
git remote rename origin-internal origin

This is disruptive because it invalidates existing branch tracking configuration that references origin/<branch>, and has to be repeated every time a session is teleported.

Suggested Fix

When verifying the repository, iterate over all remotes returned by git remote -v and accept the check if any of them resolves to the expected <user>/<repo> on GitHub, rather than only reading origin. This would also subsume the behavior requested in the (now closed) #11126, since SSH host aliases could be one of several resolvable remotes.

Additionally, the error message could be improved to say something like:

No configured git remote points at <user>/<repo>. Configured remotes: origin (<url>), github (<url>).

That would make the actual problem (remote name / URL mismatch) immediately diagnosable instead of suggesting the user is in the wrong directory.

extent analysis

TL;DR

The claude --teleport command can be made to work by ensuring the GitHub remote is named origin, or by modifying the command to check all remotes, not just origin.

Guidance

  • The issue arises because claude --teleport only checks the origin remote, so renaming the GitHub remote to origin (even temporarily) can resolve the issue.
  • To verify the problem, check the output of git remote -v to see the names and URLs of all configured remotes.
  • The suggested fix involves modifying the claude --teleport command to iterate over all remotes and check if any of them match the expected GitHub repository.
  • Improving the error message to list all configured remotes and their URLs can help diagnose the issue more easily.

Example

No code snippet is provided as the issue is more related to the configuration and behavior of the claude --teleport command rather than a specific code fix.

Notes

The provided workaround of renaming remotes is disruptive and not ideal, as it invalidates existing branch tracking configurations. A more permanent fix would involve modifying the claude --teleport command to handle remotes more flexibly.

Recommendation

Apply the suggested fix of modifying the claude --teleport command to check all remotes, as this would provide a more robust and user-friendly solution, allowing users to configure their remotes as needed without restrictions.

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] --teleport only checks the origin remote, fails when the GitHub remote has a different name [2 comments, 2 participants]