[BUG] Remote SSH VPS: ccd-cli crashes with exit code 1 when spawned by Desktop App, but works identically when run manually
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 connecting to a remote VPS via SSH in the Claude Desktop App and submitting any prompt, ccd-cli crashes immediately with exit code 1. The UI shows "Claude crashed". This happens 100% of the time.
What Should Happen?
The prompt should be processed and a response returned, as it does when the exact same binary, payload, and environment are simulated manually over SSH.
Error Messages/Logs
From ~/Library/Logs/Claude/main.log:
Session query error: Claude Code process exited with code 1
From /root/.claude/remote/remote-server.log on VPS:
[process.Manager] Process ... started, command=/root/.claude/remote/ccd-cli/2.1.128
[process.Manager] drainStdin ...: 1091 bytes, preview {"request_id":...,"type":"control_request","request":{"subtype":"initialize"...
[process.Manager] stdout read error for process ...: read |0: file already closed
[process.Manager] Process ... exited with code 1
Steps to Reproduce
- Add a remote Ubuntu 24.04 VPS as an SSH host in Claude Desktop App (root user)
- Open a new chat with the VPS as the target
- Submit any prompt (e.g. "hello")
- Observe "Claude crashed" error with exit code 1
To confirm the binary itself is not the issue, run this manually on the VPS after capturing a real payload:
cat captured_payload.log | /root/.claude/remote/ccd-cli/2.1.128
This returns a valid response — proving the crash is in the Desktop App's spawning mechanism, not the binary or payload.
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.128 (ccd-cli), 2.1.133 (system claude CLI)
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
Terminal.app (macOS)
Additional Information
Extensive debugging confirmed:
- ccd-cli binary works correctly when run manually with identical payload
- Environment variables passed by Desktop App work correctly when set manually
- Auth credentials are present and valid
- The "stdout read error: file already closed" in remote-server.log suggests the Desktop App closes the stdout pipe prematurely before ccd-cli finishes initializing — likely a race condition in the spawning mechanism
- Removing all user-configured MCP servers from claude_desktop_config.json did not resolve the issue
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗