Claude Code requires ProxyCommand instead of ProxyJump for SSH connections through jump hosts
Description
When an SSH host in ~/.ssh/config uses ProxyJump, Claude Code fails to execute remote commands (e.g. rsync, ssh) through that host. Switching to the equivalent ProxyCommand fixes the issue. The same ProxyJump config works fine from the terminal.
SSH config (failing)
\\\\
Host target-host
HostName <internal-ip>
ProxyJump jump-host
\\
Error
\\\\
channel 0: open failed: connect failed: No route to host
stdio forwarding failed
Connection closed by UNKNOWN port 65535
rsync: error: unexpected end of file
\\
Workaround
Replacing ProxyJump with ProxyCommand resolves the issue:
\\\\
Host target-host
HostName <internal-ip>
ProxyCommand ssh -W %h:%p jump-host
\\
Expected behavior
Claude Code should handle ProxyJump the same way the system SSH client does.
Environment
- Platform: macOS
- Shell: zsh
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗