[BUG] EPIPE when LSP crashes during startup

Resolved 💬 3 comments Opened Jan 16, 2026 by Janrupf Closed Jan 16, 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?

I had a broken rust-analyzer binary which exited upon startup without ever responding to LSP commands. Sometimes it seems to exit, sometimes it continues running.

What Should Happen?

The error should be caught and probably a warning be logged

Error Messages/Logs

This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
Error: write EPIPE
    at afterWriteDispatched (node:internal/stream_base_commons:159:15)
    at writeGeneric (node:internal/stream_base_commons:150:3)
    at Socket._writeGeneric (node:net:966:11)
    at Socket._write (node:net:978:8)
    at writeOrBuffer (node:internal/streams/writable:570:12)
    at _write (node:internal/streams/writable:499:10)
    at Writable.write (node:internal/streams/writable:508:10)
    at file:///home/janrupf/.npm/_npx/becf7b9e49303068/node_modules/@anthropic-ai/claude-code/cli.js:1699:14632
    at new Promise (<anonymous>)
    at p82.write (file:///home/janrupf/.npm/_npx/becf7b9e49303068/node_modules/@anthropic-ai/claude-code/cli.js:1699:14526)

Steps to Reproduce

(This is obviously not how the original bug came to be, but I think it should help with reproducing it)

  1. Create a file called rust-analyzer:

```sh
#!/bin/sh
echo "Not a valid rust analyzer..."
echo "Writes to stderror" > 2

exit 1
```

  1. Run claude code with it on the path: PATH=$(realpath .):$PATH npx @anthropic-ai/claude-code@2.1.9
  2. Observe claude log the error

Claude Model

None

Is this a regression?

No, this never worked

Last Working Version

_No response_

Claude Code Version

2.1.9

Platform

Google Vertex AI

Operating System

Other Linux

Terminal/Shell

Other

Additional Information

_No response_

View original on GitHub ↗

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