claude-code - 💡(How to fix) Fix [BUG] Windows 11: visible terminal popup with 'claude --print --permission-...' showing stdin error during normal use [1 comments, 2 participants]

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…
GitHub stats
anthropics/claude-code#58773Fetched 2026-05-14 03:39:50
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Timeline (top)
labeled ×4commented ×1

Error Message

Error: Input must be provided either through stdin or as a prompt argument when using --print

Root Cause

Root Cause Hypothesis

Fix Action

Workaround

No known workaround. Settings like windowsHide, silentSubAgents, or noConsoleWindow do not appear to exist in settings.json. Attempts to patch via NODE_OPTIONS are sanitized by the harness. This is a harness-level fix.

Code Example

claude --print --permission-...

---

Error: Input must be provided either through stdin or as a prompt argument when using --print
RAW_BUFFERClick to expand / collapse

Environment

  • OS: Windows 11 Home 10.0.26200
  • Claude Code version: 2.1.105
  • Terminal: PowerShell (Windows Terminal)
  • Frequency: Intermittent, multiple times per session during normal use

Symptom

A visible console/terminal window appears unexpectedly with the title bar showing:

claude --print --permission-...

The window body shows:

Error: Input must be provided either through stdin or as a prompt argument when using --print

The window stays open until the user manually closes it. It appears during normal Claude Code sessions, including when the Agent tool dispatches sub-agents or when internal permission-mode subroutines run.

Steps to Reproduce

  1. Run Claude Code on Windows 11 (any terminal)
  2. Use Claude Code normally — trigger any workflow that causes the harness to spawn an internal claude subprocess (e.g. Agent tool sub-agent dispatch, or an internal permission-check subprocess)
  3. Observe: a new terminal window appears with the title claude --print --permission-... and the stdin error

Root Cause Hypothesis

The Claude Code harness spawns claude subprocesses (for sub-agent dispatch or permission-mode operations) using child_process.spawn() or equivalent without windowsHide: true. On Windows, this causes a visible console window to appear for any subprocess that allocates a console. The subprocess then fails to receive its prompt input via stdin (likely a stdin race or shell-shim issue on Windows), producing the error message.

What Has Been Ruled Out

User-defined hook scripts have been fully audited — a comprehensive grep across all .cjs, .js, .ts, .ps1, .sh, .bat files and package.json in both the project repo and ~/.claude/ confirms:

  • Zero hook scripts spawn claude as a subprocess
  • All spawn/exec calls in hook scripts invoke node, git, npm, tsx, or PowerShell — never claude
  • Two previously-suspected scripts (scripts/hooks/memory-precompact.cjs, scripts/hooks/memory-compiler.cjs) were already updated to use windowsHide: true and shell: false — the popup still appears after these fixes

This rules out user-defined hooks as the source. The spawning must originate inside the harness itself.

Related Issues

  • #19391 — Windows popup issue (closed as not planned)
  • #20814 — Windows console popup + zombie node.exe (closed as not planned)
  • #15572 — Console windows flash on Bash commands, missing windowsHide (closed as duplicate)
  • #19012 — Hook commands cause console window flash (closed as not planned)

None of the above covers this specific variant: the popup title includes claude --print --permission-... and the content is a stdin error — meaning it is specifically the harness spawning a claude subprocess that fails to receive its stdin prompt.

Requested Fix

When the harness spawns any internal claude subprocess on Windows, pass windowsHide: true (and shell: false) to suppress the console window allocation. This option is cross-platform safe — it is silently ignored on macOS/Linux.

Additionally, investigate the stdin delivery race: the subprocess is invoked with --print (non-interactive mode) but fails to receive its prompt input, suggesting the piped stdin is not being flushed/closed before the subprocess reads it.

Workaround

No known workaround. Settings like windowsHide, silentSubAgents, or noConsoleWindow do not appear to exist in settings.json. Attempts to patch via NODE_OPTIONS are sanitized by the harness. This is a harness-level fix.

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