[BUG][Windows] claude.exe silently exits (code 0) during startup in OpenSSH (sshd) sessions - breaks VS Code Remote-SSH (Query closed before response received)

Open 💬 2 comments Opened Jun 11, 2026 by yutonakazatoa2-hub

Environment

  • Windows 11 Home build 10.0.26200 (host), user is local Administrator
  • Claude Code native binary 2.1.170 and 2.1.172 (both reproduce)
  • Auth: claude.ai OAuth (Max), credentials in ~/.claude/.credentials.json (plain file, readable in all contexts)
  • VS Code Remote-SSH connecting over Tailscale to Windows OpenSSH server (sshd)

Symptom

In any process descended from Windows OpenSSH (sshd) session:

  • claude.exe -p "hi"exits code 0 in ~0.8 s, zero stdout, zero stderr (even with --debug)
  • claude.exe --version → works
  • claude.exe auth status → works (prints full auth JSON)
  • claude.exe (interactive, no args) → process stays alive, opens TCP to Anthropic API and holds it (ESTABLISHED)
  • VS Code Remote-SSH extension: every spawn fails with Error: Query closed before response received (the SDK-mode child dies the same way)

Same machine, same binary, same user, desktop session: everything works.
VS Code Tunnel (server runs in interactive session) also works — only sshd-descended processes fail.

Diagnostics performed

  1. ~/.claude/debug/<id>.txt for the dying run always ends after

[DEBUG] No git remote URL found (file is exactly 2500 bytes = unflushed buffer cut).

  1. Process Monitor capture containing BOTH a successful desktop -p run and a dying sshd -p run (same binary, same minute):
  • Both perform identical init: MDM/policy reg queries, CA cert loads, settings reads, git remote check, PATH scans for yarn/deno/pnpm/node, cwd realpath, 2× credentials.json read, /sys/hypervisor/uuid + .dockerenv probes.
  • Both open ONE TLS connection to 160.79.104.10:443 with byte-identical traffic (send 517 + 64 + 169, receive 1460+~190, then 949; close-notify 24).
  • Success path then continues: C:\Program Files\ClaudeCode\managed-mcp.json probe → .mcp.json directory-hierarchy probes → etc/ssl/cert.pem probe → second TCP connection → normal completion.
  • sshd path: after the .dockerenv probe it only checks 2 skills dirs, then ~31 ms with NO syscalls, then clean Process Exit, Exit Status: 0. No failing operation, no WER crash event, no Windows Application log entry.
  1. Conclusion: the async continuation that should follow the first API response never gets scheduled in sshd sessions; the event loop drains and Bun exits 0.

Ruled out (all reproduce the silent exit)

  • Versions 2.1.170 and 2.1.172
  • --safe-mode, --no-chrome, --strict-mcp-config
  • CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1
  • Clearing all CLAUDE* env vars
  • Elevated (High, default for admin over sshd) AND de-elevated (runas /trustlevel:0x20000) tokens
  • ssh password auth AND publickey auth
  • stdin: console, < NUL, pipe redirects
  • cwd on local drive vs Google Drive mount
  • Windows Defender exclusions not involved (no blocked operations in ProcMon)

Impact

Claude Code is unusable in VS Code Remote-SSH on Windows hosts (a common "thin client at home → workstation at office" setup). Tunnel/RDP-style access works but is less reliable than plain sshd.

Possibly related

  • #50616 (same debug-log death point No git remote URL found, corporate-proxy machine)
  • #51732 (same Windows build, terminal works / extension dies, closed as duplicate)

View original on GitHub ↗

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