Regression in 2.1.158: claude -p hangs waiting for stdin EOF on Termux/arm64
Environment
- Platform: Termux / Android / arm64
- Node.js: v25.8.2 (via Termux)
- npm: 11.14.0
- Package:
@anthropic-ai/claude-code@2.1.158 - Last known good:
@anthropic-ai/claude-code@2.1.157
Bug Description
claude -p "hello" hangs indefinitely in 2.1.158. The process blocks waiting for stdin to close and never produces output. This is a regression from 2.1.157 where the same command works correctly.
Steps to Reproduce
npm install -g @anthropic-ai/claude-code@2.1.158
timeout 30s claude -p "hello"
echo "exit: $?"
Actual: exit code 124 (timeout), no stdout, no stderr
Expected: AI response printed, process exits with code 0
Evidence
Inspecting open file descriptors of the hung process:
fd[0] → pipe:[285512855] ← stdin remains open as a pipe
fd[1] → /tmp/cp.out
fd[2] → /tmp/cp.err
fd[17] → /dev/null
fd[18,19,22,37] → socket
fd[0] stays open as a pipe and the process never proceeds. There is no stderr output — the process starts normally but blocks on stdin.
Controls (all passing in 2.1.158)
| Command | Result |
|---------|--------|
| claude --version | ✅ 2.1.158 |
| claude --help | ✅ help displayed |
| claude auth status | ✅ authenticated |
| claude update --dry-run | ✅ no error |
| claude (interactive mode) | ✅ works normally |
Regression Confirmation
Rolling back to 2.1.157 resolves the issue immediately:
npm install -g @anthropic-ai/claude-code@2.1.157
claude -p "hello" # works correctly
Scope Caveat
Confirmed on Termux/arm64 (Node.js v25.8.2). Not yet confirmed on standard Linux x64. The stdin-blocking behavior may be specific to how Termux's Node.js handles pipe stdin in non-TTY environments, but the 2.1.157 → 2.1.158 regression is clear.
Additional Context
Entry JS diff between 2.1.157 and 2.1.158 shows ~698 bytes of changes described as variable renames only. No Bun.* property additions or removals detected. The hang appears to occur before any API call is made (no network activity observed during the 30s timeout window).
Related: #9026 (similar symptom on macOS, older version, closed as not planned)
This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗