[BUG] Windows 11 + WSL2 + Debian: can no longer run 'bash' commands with output (?)

Resolved 💬 5 comments Opened Mar 13, 2025 by ladyada Closed Jul 21, 2025

Environment

  • Platform (select one):
  • [X] Anthropic API
  • [ ] AWS Bedrock
  • [ ] Google Vertex AI
  • [ ] Other: <!-- specify -->
  • Claude CLI version: 0.2.39 (Claude Code), this used to work in 0.2.35 (if i revert the npm package it works again)
  • Operating System: Debian under WSL2 under windows 11
  • Terminal: WSL2

Bug Description

Not sure what changed but a about week ago i was able to have Claude run 'arduino-cli' and other Bash commands that had stdout within WSL2/debian but now when I do so, get an EPIPE write failure. tried this on two different windows 11 computers (one laptop, one desktop) and getting the same.
here's the proof it used to work :D
https://www.youtube.com/live/Yt8mc5v7MYA?si=Wnwq71JdouU12kdE&t=565
now i get...

> Great, now lets try running the test sketch, we have arduino-cli installed, use it with

  ~/bin/arduino-cli compile --library . --fqbn arduino:avr:uno examples/testsketch/testsketch.ino

  where the directory and name of the ino is the same as the file we just created. we can add more verbosity with
  -v -vv or -vvv if neccessary.

  for now, just check that this code compiles under the uno, and if it does not suggest changes to fix the
  compilation so it compiles cleanly!

● Let me check if the test sketch compiles correctly under the Arduino Uno.

● List(path: "examples")…
  ⎿  - /mnt/c/Users/ladyada/Dropbox (Personal)/ClaurduinoSketches/libraries/Adafruit_OPT4048/
       - examples/
         - test_opt4048/
           - test_opt4048.ino
     ... (+1 items)

● I see the test sketch is in test_opt4048 directory, not testsketch. Let me compile it:

● Bash(~/bin/arduino-cli compile --library . --fqbn arduino:avr:uno examples/test_opt4048/test_opt4048.ino)…

· Finagling… (7s · esc to interrupt)

╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ >                                                                                                                    │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
  ! for bash mode · / for commands                                                                      \⏎ for newline


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:971:11)
    at Socket._write (node:net:983:8)
    at writeOrBuffer (node:internal/streams/writable:572:12)
    at _write (node:internal/streams/writable:501:10)
    at Writable.write (node:internal/streams/writable:510:10)
    at Y6.sendToShell (file:///home/ladyada/.nvm/versions/node/v22.14.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:430:630)
    at file:///home/ladyada/.nvm/versions/node/v22.14.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:430:396
    at new Promise (<anonymous>) {
  errno: -32,
  code: 'EPIPE',
  syscall: 'write'
}

Steps to Reproduce

  1. Run claude
  2. ask it to 'ls' in the bash shell
  3. it will crash!
> can you run 'ls' in the shell?

  Bash(ls)…

╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ Bash command                                                                                                         │
│                                                                                                                      │
│   ls                                                                                                                 │
│   Lists files and directories in current location                                                                    │
│                                                                                                                      │
│ Do you want to proceed?                                                                                              │
│ ❯ Yes ✔                                                                                                              │
│   Yes, and don't ask again for ls commands in /mnt/c/Users/ladyada/Dropbox                                           │
│   (Personal)/ClaurduinoSketches/libraries/Adafruit_OPT4048                                                           │
│   No, and tell Claude what to do differently (esc)                                                                   │
│                                                                                                                      │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

● Bash(ls)…

✢ Moseying… (0s · esc to interrupt)

╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ >                                                                                                                    │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
  ! for bash mode · / for commands                                                                      \⏎ for newline



Total cost:            $0.0330
Total duration (API):  7.3s
Total duration (wall): 12.4s
Total code changes:    0 lines added, 0 lines removed

Expected Behavior

It used to run commands quite well within WSL/bash/debian

Actual Behavior

EPIPE faults

View original on GitHub ↗

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