[BUG] --print mode silent hang on Windows — recurring across v2.1.51, v2.1.78, v2.1.81

Resolved 💬 2 comments Opened Mar 25, 2026 by mcderms2-droid Closed Apr 23, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet (similar: #37660, #37154, #33949 — but this documents cross-version recurrence)
  • [x] This is a single bug report
  • [x] I am using the latest version of Claude Code

Environment

  • Claude Code version: 2.1.81 (latest as of 2026-03-24)
  • OS: Windows 11 Pro (10.0.26200, x64)
  • Node.js: v25.5.0
  • Shell: PowerShell 7 (pwsh)
  • Auth: API key (Anthropic), active billing

What's Wrong?

claude --print --permission-mode bypassPermissions silently hangs with zero output on medium-to-long prompts. No stdout, no stderr, no error message, no timeout. Process stays alive indefinitely until manually killed.

Short prompts (~15 words) occasionally work. Anything beyond a paragraph reliably hangs.

Reproduction Steps

  1. cd to a project directory with source files
  2. Run: claude --permission-mode bypassPermissions --print "Read CLAUDE.md then build the fixes listed in docs/handoffs/BUG-FIX-BATCH-1-PHASE1-REVIEW.md. Version 0.12.0. Commit."
  3. Process starts, produces zero output
  4. Wait 2+ minutes — still zero output
  5. Check stderr redirect — empty
  6. Kill process

Also hangs on minimal prompts:
claude --permission-mode bypassPermissions --print "Read CLAUDE.md then docs/handoffs/BUG-FIX-BATCH-1-PHASE1-REVIEW.md. Build all fixes. Version 0.12.0. Commit."

Evidence (3 attempts, same session, 2026-03-24 ~10:15 PM ET)

| Attempt | Prompt Length | Wait Time | Output | Stderr |
|---------|-------------|-----------|--------|--------|
| 1 | ~2000 chars (detailed task) | 3+ min | Zero | Empty |
| 2 | ~500 chars (shortened) | 2+ min | Zero | Empty |
| 3 | ~120 chars (minimal) | 90 sec | Zero | Empty |

All three killed manually. No crash, no error, no partial output.

Recurrence History (same machine, same setup)

| Version | Date | Behavior | Resolution |
|---------|------|----------|------------|
| 2.1.51 | Feb 2026 | Silent hang on --print mode under moderate workload | Updated to later patch — fixed. Lost 2 days. |
| 2.1.78 | Mar 20, 2026 | Same pattern returned. Short prompts worked, medium/long died silently. | Updated to 2.1.80 — fixed. |
| 2.1.80 | Mar 20-23 | Working. Multiple successful builds across 4 days. | N/A |
| 2.1.81 | Mar 24, 2026 | Broken again. Three attempts, zero output, all prompt lengths. | No newer version available. |

Workaround

None for --print mode. We switched to manual file editing via a separate tool pipeline. Interactive mode (with PTY) was not tested this session but has been unreliable on Windows in the past.

Impact

This is a production blocker for CI/CD and agent orchestration pipelines that depend on --print mode for non-interactive execution. We use Claude Code as a build agent spawned from an orchestrator — when it hangs, the entire build pipeline stalls silently with no feedback.

Expected Behavior

claude --print should either:

  1. Produce output and complete, OR
  2. Fail with an error message and non-zero exit code

Silent infinite hang with zero output is the worst possible failure mode — no way to distinguish "thinking" from "dead."

View original on GitHub ↗

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