[BUG] claude -p can return no stdout/stderr for a multi-file Read-only task while simple Read tasks succeed
Status Open
Reported on v2.1.235
Maintainer reply None cached
Activity 0 comments · opened Aug 22, 2026
Preflight
- Claude Code version: 2.1.235
- macOS, Claude Code CLI with ChatGPT-style interactive login
- Latest available release checked on 2026-08-22
- Existing related closed issues #28601 and #33757 were reviewed; neither covers this CLI print-mode reproduction.
What is wrong
A non-interactive claude -p task that performs a multi-file Read-only audit can finish with no final output and no error. Redirecting both stdout and stderr to a temporary file produces a zero-byte file.
This is not a general CLI connectivity failure:
- A tools-disabled
claude -pprompt returning exactlyPONGsucceeds. - A single
Readfollowed by exactlyPONGsucceeds in normal text output and in stream-json. - The same runtime, when asked for a concise audit after reading several local non-secret files, returns no text and no error.
Minimal reproduction shape
claude -p --no-session-persistence --permission-mode dontAsk \
--tools Read --output-format text \
"Read several local non-secret source files, then return a concise audit report." \
> /tmp/claude-audit.txt 2>&1
wc -c /tmp/claude-audit.txt
# observed: 0
The single-file control is:
claude -p --no-session-persistence --permission-mode dontAsk \
--tools Read --output-format text \
"Read lines 1 through 20 of a local source file, then reply with exactly: PONG."
# observed: PONG
Expected
The multi-file task should either print the final audit report or print a structured error. A silent zero-byte result makes CLI automation unable to distinguish completion from lost output.
Additional notes
Using --verbose --output-format stream-json exposes tool events for simple controls, so this may be in the non-streaming final-output delivery path. No project content, credentials, or private paths are included in this report.