[BUG] Claude Desktop SSH: ccd-cli exits with code 1 immediately — stdin timing issue

Resolved 💬 5 comments Opened Apr 17, 2026 by MShoaib67 Closed Jun 4, 2026

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?

What's Wrong?

Claude Code Desktop SSH sessions immediately crash with "Claude Code process exited with code 1" or "Failed to spawn Claude Code process: Process not running" after connecting to a remote Linux server. The SSH connection itself succeeds — file listing, folder selection, and git worktree creation all work. The crash happens specifically when ccd-cli is spawned.

What Should Happen?

The SSH Code session should start normally and accept prompts, the same way it works when running claude directly on the remote server via terminal.

Environment

  • Claude Desktop: Latest version (macOS)
  • macOS: Sonnet on MacBook Pro
  • Remote server: Ubuntu 24.04.4 LTS, Hetzner VPS
  • Claude Code on server: 2.1.113 (installed via curl -fsSL https://claude.ai/install.sh | bash)
  • ccd-cli deployed by Desktop: 2.1.111 (at ~/.claude/remote/ccd-cli/2.1.111)
  • Node.js on server: v20.20.2
  • SSH auth: Key-based (RSA 4096), no passphrase, works perfectly from terminal
  • No missing shared libraries (ldd shows all resolved)

Steps to Reproduce

  1. Add SSH connection in Claude Desktop Code tab (root@server-ip, port 22, identity file ~/.ssh/id_rsa)
  2. Select a folder on the remote server (e.g. /opt/mstel)
  3. Send any prompt (e.g. "hello")
  4. Process spawns and immediately exits with code 1

Diagnostic Details

From ~/.claude/remote/remote-server.log:

[process.Manager] Process a598420c started, PID=609750, command=/root/.claude/remote/ccd-cli/2.1.111
[process.Manager] Starting stdout streaming for process a598420c
[process.Manager] Starting stderr streaming for process a598420c
[process.Manager] Process a598420c exited with code 1
[process.Manager] WriteStdin: process a598420c not running

The process exits immediately before stdin data arrives. This happens consistently across multiple attempts.

What works fine:

  • claude -p "hello" on the server via SSH terminal — works perfectly
  • /root/.claude/remote/ccd-cli/2.1.111 -p "hello" — works perfectly
  • ldd /root/.claude/remote/ccd-cli/2.1.111 — no missing libraries
  • SSH key auth from Mac to server — works perfectly
  • ssh -i ~/.ssh/id_rsa root@server "which claude && claude --version" — returns correctly

What fails:

  • /root/.claude/remote/ccd-cli/2.1.111 --output-format stream-json --input-format stream-json --verbose returns: Error: Input must be provided either through stdin or as a prompt argument when using --print

This suggests the ccd-cli binary exits before receiving stdin from the Desktop RPC, possibly a timing issue where the process expects stdin immediately but the Desktop sends it after the spawn response.

Workaround

Using claude directly via SSH terminal (Termius) works without issues. Only the Desktop GUI SSH integration is affected.

What Should Happen?

The SSH Code session should start normally and accept prompts, the same way claude works when run directly on the remote server via SSH terminal.

Error Messages/Logs

[process.Manager] Process a598420c started, PID=609750, command=/root/.claude/remote/ccd-cli/2.1.111
[process.Manager] Starting stdout streaming for process a598420c
[process.Manager] Starting stderr streaming for process a598420c
[process.Manager] Process a598420c exited with code 1
[process.Manager] WriteStdin: process a598420c not running

Steps to Reproduce

  1. Add SSH connection in Claude Desktop Code tab (root@remote-server, port 22, RSA key auth)
  2. Select folder /opt/mstel on the remote server
  3. Send any prompt (e.g. "hello")
  4. ccd-cli spawns and immediately exits with code 1

Claude Model

None

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.113 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

Remote server: Ubuntu 24.04.4 LTS on Hetzner VPS
ccd-cli binary deployed by Desktop: version 2.1.111 at ~/.claude/remote/ccd-cli/2.1.111
Running ccd-cli manually with -p "hello" works fine.
Running it with --output-format stream-json --input-format stream-json --verbose fails with: "Error: Input must be provided either through stdin or as a prompt argument when using --print"
This suggests a stdin timing issue between Desktop RPC and ccd-cli process.

View original on GitHub ↗

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