Unhandled Promise Rejection: Shell Communication Failure

Resolved 💬 5 comments Opened Mar 29, 2025 by sbostk Closed Oct 21, 2025

Bug Description
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: Cannot write to shell: Shell is not alive.
at Y6.sendToShell (file:///Users/sbostick/.nvm/versions/node/v22.13.1/lib/node_modules/@anthropic-ai/claude-code/cli.js:523:15)
at file:///Users/sbostick/.nvm/versions/node/v22.13.1/lib/node_modules/@anthropic-ai/claude-code/cli.js:522:396
at new Promise (<anonymous>)
at Y6.exec_ (file:///Users/sbostick/.nvm/versions/node/v22.13.1/lib/node_modules/@anthropic-ai/claude-code/cli.js:522:312)
at Y6.processQueue (file:///Users/sbostick/.nvm/versions/node/v22.13.1/lib/node_modules/@anthropic-ai/claude-code/cli.js:519:748)
at Y6.processQueue (file:///Users/sbostick/.nvm/versions/node/v22.13.1/lib/node_modules/@anthropic-ai/claude-code/cli.js:519:1335)

Environment Info

  • Platform: macos
  • Terminal: tmux
  • Version: 0.2.56
  • Feedback ID: e6e65b62-d522-4d24-959d-2d730bd19549
  • User note: reproducible outside of tmux, in both iterm and terminal, on mac, using zsh shell
  • User repro steps: claude in my project directory immediately emits this error, and others like it

Errors

[{"error":"Error: Shell exited unexpectedly with code 1 and signal null\n    at Y6.onExit (file:///Users/sbostick/.nvm/versions/node/v22.13.1/lib/node_modules/@anthropic-ai/claude-code/cli.js:518:5155)\n    at ChildProcess.<anonymous> (file:///Users/sbostick/.nvm/versions/node/v22.13.1/lib/node_modules/@anthropic-ai/claude-code/cli.js:518:4584)\n    at ChildProcess.emit (node:events:524:28)\n    at ChildProcess.emit (node:domain:489:12)\n    at ChildProcess._handle.onexit (node:internal/child_process:293:12)","timestamp":"2025-03-29T02:48:45.225Z"},{"error":"Error: Cannot write to shell: Shell is not alive.\n    at Y6.sendToShell (file:///Users/sbostick/.nvm/versions/node/v22.13.1/lib/node_modules/@anthropic-ai/claude-code/cli.js:523:15)\n    at file:///Users/sbostick/.nvm/versions/node/v22.13.1/lib/node_modules/@anthropic-ai/claude-code/cli.js:522:396\n    at new Promise (<anonymous>)\n    at Y6.exec_ (file:///Users/sbostick/.nvm/versions/node/v22.13.1/lib/node_modules/@anthropic-ai/claude-code/cli.js:522:312)\n    at Y6.processQueue (file:///Users/sbostick/.nvm/versions/node/v22.13.1/lib/node_modules/@anthropic-ai/claude-code/cli.js:519:748)\n    at Y6.processQueue (file:///Users/sbostick/.nvm/versions/node/v22.13.1/lib/node_modules/@anthropic-ai/claude-code/cli.js:519:1335)","timestamp":"2025-03-29T02:48:46.186Z"},{"error":"Error: Shell error: Cannot write to shell: Shell is not alive.. isAlive=false\n    at Y6.sendToShell (file:///Users/sbostick/.nvm/versions/node/v22.13.1/lib/node_modules/@anthropic-ai/claude-code/cli.js:523:227)\n    at file:///Users/sbostick/.nvm/versions/node/v22.13.1/lib/node_modules/@anthropic-ai/claude-code/cli.js:522:396\n    at new Promise (<anonymous>)\n    at Y6.exec_ (file:///Users/sbostick/.nvm/versions/node/v22.13.1/lib/node_modules/@anthropic-ai/claude-code/cli.js:522:312)\n    at Y6.processQueue (file:///Users/sbostick/.nvm/versions/node/v22.13.1/lib/node_modules/@anthropic-ai/claude-code/cli.js:519:748)\n    at Y6.processQueue (file:///Users/sbostick/.nvm/versions/node/v22.13.1/lib/node_modules/@anthropic-ai/claude-code/cli.js:519:1335)","timestamp":"2025-03-29T02:48:46.187Z"}]

View original on GitHub ↗

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