All symptoms日本語

T14

claude -p --allowedTools swallows the prompt after it

Symptom

claude -p --allowedTools Read "summarize this" stops with "Input must be provided either through stdin or as a prompt argument", although the prompt is right there.

Check it in 30 seconds

Paste into Windows PowerShell 5.1. It only creates files under your %TEMP% folder. If the last line says REPRODUCED, it happens on your machine. It calls claude once, so it takes about a minute.

$d = Join-Path $env:TEMP ('cc-trap-' + (Get-Date -Format 'yyyyMMddHHmmss')); New-Item -ItemType Directory $d -Force | Out-Null
$o = claude -p --allowedTools Read 'say hi' 2>&1 | Out-String
($o.Trim() -split "`n")[0]
if ($o -match 'Input must be provided') { 'REPRODUCED' } else { 'NOT REPRODUCED' }

Why it happens

--allowedTools and --add-dir take any number of values. The prompt placed after them is taken as one more tool name.

Fix

Send the prompt on stdin instead of as a positional argument.

'Summarize README.md' | claude -p --allowedTools Read

On the author's machine

stopped with Input must be provided ...

Author's machine: Windows 11 / Windows PowerShell 5.1.26100 / Python 3.13.7 / Claude Code 2.1.304, Japanese Windows (code page 932). Checked 2026-10-20 to 22.

If you searched for

Related

cc-win-kit bundles the parts that avoid these traps from the start: a write guard (with onFailure: block), an unattended runner, a doctor that scans your files and hook settings, CLAUDE.md templates and the full test suite.

cc-win-kit ($19 on Payhip)

Other symptoms