claude-code - 💡(How to fix) Fix Regression in 2.1.158: claude -p hangs waiting for stdin EOF on Termux/arm64

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

| claude update --dry-run | ✅ no error |

Code Example

npm install -g @anthropic-ai/claude-code@2.1.158
timeout 30s claude -p "hello"
echo "exit: $?"

---

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

---

npm install -g @anthropic-ai/claude-code@2.1.157
claude -p "hello"   # works correctly
RAW_BUFFERClick to expand / collapse

Environment

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/[email protected]
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)

CommandResult
claude --version2.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/[email protected]
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.1572.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)

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix Regression in 2.1.158: claude -p hangs waiting for stdin EOF on Termux/arm64