SSH remote server fails with fish shell (empty PID from $! syntax)

Open 💬 2 comments Opened Feb 14, 2026 by schickling-assistant

Bug Description

The Claude Code Desktop SSH remote server feature fails to start when the remote machine's login shell is fish. The server binary is deployed and works correctly, but the PID capture fails because the startup command uses $! (POSIX/bash syntax), which fish does not support (fish uses $last_pid).

Steps to Reproduce

  1. Set up a remote Linux machine with fish as the login shell
  2. Configure an SSH connection in Claude Code Desktop
  3. Attempt to connect

Expected Behavior

Remote server starts and Claude Code connects successfully regardless of the remote user's login shell.

Actual Behavior

Connection fails with: "Timeout waiting for remote server socket"

The SSH log (~/Library/Logs/Claude/ssh.log) shows:

[BinaryDeployment] Starting remote server
[BinaryDeployment] Server PID:           
[RemoteServerController] Connection failed: Timeout waiting for remote server socket

The PID is always empty because $! is not valid fish syntax.

Investigation

  • The deployed binaries (~/.claude/remote/server and ~/.claude/remote/ccd-cli) work correctly when run manually on the remote
  • Manually starting the server and creating the socket allows Claude Desktop to connect successfully — the issue is isolated to the server startup/PID capture step
  • Confirmed via: ssh remote "bash -c 'sleep 1 & echo \$!'" works, but the same command through fish drops $!

Environment

  • Claude Code Desktop: latest (deploys CLI v2.1.41)
  • Local: macOS
  • Remote: NixOS, Linux 6.12.69, x86_64
  • Remote shell: fish (/run/current-system/sw/bin/fish)

Suggested Fix

The remote server startup command should either:

  1. Explicitly invoke via bash -c '...' (or sh -c '...') rather than relying on the login shell
  2. Detect the remote shell and use appropriate syntax

---

This issue was created on behalf of @schickling with assistance from Claude Code.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗