claude-code - 💡(How to fix) Fix [BUG] Remote SSH VPS: ccd-cli crashes with exit code 1 when spawned by Desktop App, but works identically when run manually

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

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

Code Example

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
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • 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

  1. Add a remote Ubuntu 24.04 VPS as an SSH host in Claude Desktop App (root user)
  2. Open a new chat with the VPS as the target
  3. Submit any prompt (e.g. "hello")
  4. 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

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [BUG] Remote SSH VPS: ccd-cli crashes with exit code 1 when spawned by Desktop App, but works identically when run manually