[BUG] --teleport only checks the origin remote, fails when the GitHub remote has a different name
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] 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: git@github.com:<user>/<repo>.git
Push URL: git@github.com:<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
- Clone a GitHub repository and rename
originto something else, or configure the GitHub remote under a non-originname from the start:
````
git remote rename origin github
# or
git remote add github git@github.com:<user>/<repo>.git
- Optionally add a different remote under the name
origin(e.g., an internal mirror). - Create a Claude Code web session against the GitHub repo.
- Attempt to teleport:
claude --teleport <session-id>. - 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.
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗