/bin/sh ENOENT: Bash tool silently breaks mid-session

Resolved 💬 3 comments Opened Feb 16, 2026 by rrmadmin Closed Feb 19, 2026

Bug Description

The Bash tool silently stops working mid-session with exit code 1 and no output. The error is ENOENT: no such file or directory, posix_spawn '/bin/sh'. All other tools (Read, Write, Edit, Glob, Grep) continue to work normally.

Reproduction

  • Platform: macOS 15.3 (Darwin 25.3.0), Apple Silicon (MacBook Pro)
  • Shell: zsh
  • Observed: 2+ times (Feb 2026)

Steps

  1. Start a Claude Code session
  2. Perform a burst of file operations (mv, rm -rf, directory restructuring)
  3. At some point, the Bash tool starts failing — one command works, the very next returns exit 1 with empty output
  4. File tools (Read, Write, Edit) continue working fine
  5. Stop hooks also fail with the same ENOENT error

Key observations

  • It's not gradual — one Bash call succeeds, the next is dead
  • Happens after heavy file operations (moving directories, deleting large trees)
  • /bin/sh definitely exists on the filesystem — this appears to be an internal process spawning issue
  • Only fix is restarting Claude Code

Expected Behavior

Bash tool should continue working throughout the session regardless of file operations performed.

Actual Behavior

posix_spawn '/bin/sh' fails with ENOENT. All subsequent Bash calls fail silently (exit 1, no output). Stop hooks also fail with the same error.

Error from stop hook

Stop hook error: Failed with non-blocking status code: Error occurred while executing hook command: ENOENT: no such file or directory, posix_spawn '/bin/sh'

View original on GitHub ↗

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