[BUG] SSH Remote: RPC ping timeout too short for Azure Bastion tunnel connections
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?
The Claude Code desktop app's SSH remote feature fails to establish a stable connection when connecting through an Azure Bastion tunnel. The RPC server starts successfully and responds to pings, but the responses arrive after the 5-second ping timeout due to Bastion tunnel latency (~6-7 seconds round trip).
Environment
Claude Code Desktop App version: cee98937dc257e6af64e712d71dbe4497eb82452
Remote CLI deployed: v2.1.110
Local OS: macOS (Apple Silicon)
Remote OS: Ubuntu 22.04.5 LTS (Azure VM)
Connection method: Azure Bastion tunnel → SSH → RPC Unix socket
Remote filesystem: Lustre
The desktop app successfully:
✅ Connects via SSH
✅ Deploys the claude-ssh server binary
✅ Deploys the CLI (v2.1.110)
✅ Starts the remote server (gets PID)
✅ Opens exec channel to rpc.sock
✅ Reports "Connected to remote server"
Then 5 seconds later, the ping times out:
Client log (~/Library/Logs/Claude/ssh.log):
13:28:21 [info] [RemoteServerController] Connected to remote server (94813ms, trigger: send_message, reused: false)
13:28:26 [warn] [RemoteServerController] Ping failed, marking connection dead: RPC call to server.ping timed out
Server log (~/.claude/remote/remote-server.log):
2026/04/16 09:28:27 [Server] RPC request: method=server.ping, id=1
2026/04/16 09:28:27 [Server] RPC response sent: id=1, hasError=false
The server receives the ping at 09:28:27 UTC and responds successfully (hasError=false), but the client (at UTC+4 = 09:28:21 UTC send time) already timed out after 5 seconds. The Azure Bastion tunnel adds ~6-7 seconds of round-trip latency to RPC messages traversing the SSH exec channel.
This cycle repeats indefinitely — every reconnection attempt follows the same pattern.
Additional Issue: Lustre Filesystem
Initially, the server was rejecting pings as Unauthorized: invalid or missing auth token when the RPC socket lived on the Lustre distributed filesystem. Creating a symlink from ~/.claude/remote/ to /tmp/ (local ext4) resolved the auth issue, but the timeout remains.
Suggested Fix
Increase the RPC ping timeout from 5 seconds to 15-30 seconds, or
Make the timeout configurable (e.g., via a setting or SSH config directive), or
Detect high-latency connections and dynamically adjust the timeout
🤖 Generated with Claude Code
What Should Happen?
The desktop app should successfully connect to remote servers behind Azure Bastion tunnels (and similar high-latency proxy setups).
Error Messages/Logs
<details> <summary>Full ssh.log (client side)</summary>
[attach ssh.log contents]
</details><details> <summary>Full remote-server.log (server side)</summary>
Claude remote server listening on /lustrefs/shared/ali.filali/.claude/remote/rpc.sock
2026/04/16 09:28:27 [Server] New connection from: @
2026/04/16 09:28:27 [Server] RPC request: method=server.ping, id=1
2026/04/16 09:28:27 [Server] RPC response sent: id=1, hasError=false
2026/04/16 09:30:09 [Server] New connection from: @
2026/04/16 09:30:09 [Server] RPC request: method=server.ping, id=1
2026/04/16 09:30:09 [Server] RPC response sent: id=1, hasError=false
</details>
Steps to Reproduce
Set up an Azure Bastion tunnel to a remote VM:
az network bastion tunnel --name <bastion> --resource-group <rg> --target-ip-address <ip> --resource-port 22 --port 1170
Configure SSH connection in the desktop app to 127.0.0.1:1170
Attempt to connect — the app shows "Installing Claude Code" / "Connecting Claude" then fails
Claude Model
None
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.110
Platform
Other
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗