[BUG] --teleport fails with custom SSH host aliases in git remote URLs
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?
When using a custom SSH host alias in git remote URLs (e.g., github-personal:user/repo), the --teleport command fails with a misleading error message.
What Should Happen?
Teleport should work regardless of the SSH host alias used in the git remote URL.
Error Messages/Logs
You must run claude --teleport session_[xxx] from a checkout of [user]/[repo].
Parts with square brackets were are generic strings because I wished to redact the real versions.
Steps to Reproduce
- Configure SSH config with a custom GitHub alias:
Host github-personal
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa
IdentitiesOnly yes
- Clone a repo using this alias: git clone github-personal:user/repo
- Have claude code web work on an issue in the same repository and use the "Open in CLI" button
- Attempt to use teleport: claude --teleport session_xxx
Current Workaround:
Add a standard github.com remote alongside the custom alias.
Suggested Fix:
- Parse SSH config to resolve aliases to their actual HostName
- Or provide a configuration option to specify accepted remote patterns
- Improve error message to indicate the issue is with remote URL format, not repository location
Why This Matters:
Custom SSH host aliases are a common practice for:
- Managing multiple GitHub accounts (work/personal)
- Ensuring commits use the correct user identity
- Other SSH configuration needs
The current behavior blocks legitimate use cases with an unhelpful error message that suggests the user isn't in the correct directory when they actually are.
Claude Model
Irrelevant as it is a command issue
Is this a regression?
I don't know
Last Working Version
Unknown. I suspect this has never worked
Claude Code Version
2.0.34 (Claude Code)
Platform
Anthropic API
Operating System
Likely Irrelevant: Ubuntu/Debian Linux
Terminal/Shell
Likely Irrelevant: Gnome Terminal
This issue has 12 comments on GitHub. Read the full discussion on GitHub ↗