If a streaming reply dies after the model has already produced output (idle timeout, mid-stream server error, dropped connection, laptop sleep), a claude -p run now re-sends the turn with a note telling the model its response was cut off and to resume from where it stopped, up to a fixed number of attempts. Controlled by tengu_truncated_response_recovery, which defaults to on. Interactive sessions are unchanged and still show the partial reply plus the error line.
- The synthesized API-error message carries a new
truncatedAfterOutputflag, set when output had already been yielded and the stop reason was nottool_use. - The retry only fires for non-interactive sessions on the main thread, not in subagents or sidechains.
- The injected meta user message says "Your response above was cut off mid-stream." and asks the model to continue.
- Each retry is recorded under
query_truncated_response_recoveryasnudgedwith anattemptnumber, orexhaustedonce the cap is hit, after which the error message is yielded as before. - The re-issued turn is tagged
transition: { reason: "truncated_response_recovery" }.
tengu_truncated_response_recovery
Strings lifted out of the shipped bundle, so the claim above can be checked against them.
tengu_truncated_response_recovery Not enough to sayNothing here resolved what this flag was doing on this version, so nothing here should be read as on or off.
This account: no value returned · anonymous baseline: no value returned · compiled default in v2.1.246: on
Read once, for one account on one subscription tier, against v2.1.246. It isn't a statement about your account. What a flag value here can and cannot tell you
The entry above is what we published on the day. These lines were added later, as Anthropic's own pages caught up, and they sit beside the original rather than replacing it.
In `claude -p` runs, [Agent SDK](/docs/en/headless) sessions, and [cloud sessions](/docs/en/claude-code-on-the-web), Claude Code can't show that prompt: it loads project-scoped servers without asking. Claude Code also skips the prompt in a…mcp see the edit
4. The calling process runs `claude -p --resume <session-id>` with the same permission host. The same tool call fires `PreToolUse` again.hooks see the edit
Anthropic's documentation has since written up claude -p, on Hooks reference.
Fixed the UI stopping with a render error on the first tool call when a third-party Anthropic-compatible endpoint (ANTHROPIC_BASE_URL)…
New in this build: tengu_truncated_response_recovery