Require the result to reach its consumer
Use when
A
macOS
or
Linux
harness
captures
claude
-p
through
a
pipe,
and
rendering,
logging,
or
grading
can
stall
the
reader.
A
successful
producer
exit
does
not
prove
complete
delivery.
Action
During
authorized
maintenance,
require
2.1.333
or
a
reviewed
equivalent.
Preserve
existing
permissions;
use
--output-format
stream-json
--verbose
for
event
capture.
Drain
stdout
and
stderr
concurrently
into
bounded,
protected
per-run
files
before
expensive
processing.
Accept
completion
only
after
successful
producer
termination,
stream
closure,
successful
capture
finalization,
and
valid
successful
results
for
the
expected
session/turns.
Find
result
records
by
type,
not
last-line
position:
later
task
notifications
can
start
another
turn.
Missing
results,
malformed
JSON,
storage
errors,
or
exhausted
drain
budgets
mean
incomplete
capture.
Block
dependent
actions;
reconcile
existing
state
rather
than
automatically
replaying
work.
Acceptance check
First, replay a frozen large NDJSON fixture through the actual collector. Normal and bounded slow-reader cases must preserve every byte and the expected result sentinel. Truncated final JSON, an omitted result, storage failure, and an over-budget stall must never pass—even with exit zero.
Include a result followed by a notification and another turn; the first result must not terminate capture or conceal a missing later result. Then, under separate authorization, exercise the repaired CLI with an owned large-output task and controlled backpressure. Retain version, invocation, reader-pause timing, raw streams, process status, and artifact checks.
Evidence
The dated release names lost piped-output tails and adds a drain wait capped at 30 seconds, with an unread-output warning. October’s inspectable 2.1.296 reproduction varies reader pauses: longer stalls lose the result despite exit zero and a complete saved transcript. Current documentation confirms the bounded drain and result-ordering contracts.
Caveat
Thirty seconds is a maximum, not a guaranteed grace period or durable-delivery acknowledgment. Receiving a successful result still does not prove the requested application outcome or remote background effects. No vendor implementation/regression suite or independent post-fix runtime result was inspected; no upgrade, model call, or fixture ran here.