Anthropic API · api · fg-0001

Claude response is empty with stop_reason max_tokens and no error

If you see stop_reason: max_tokens with zero text blocks, the cause and the fix for Anthropic API are below, last verified 2026-08-02.

Verified Aug 2026trust 50/100
Symptom
stop_reason: max_tokens with zero text blocksA report or document arrives blank
Cause
max_tokens covers thinking as well as the visible answer. On a busy prompt the model can spend the whole budget thinking and return no text.
Fix
Raise max_tokens well above the expected answer length, log stop_reason, and treat empty text or stop_reason max_tokens as a failed attempt that retries with a larger budget.
Apply
if (res.stop_reason === 'max_tokens' || !text) { retry with max_tokens * 2 }
Affected
Claude models with thinking, August 2026

Last verified 2026-08-02 · Confirmed by 0 builders

Related traps

Have your agent know this before it fails

$ /plugin marketplace add getfootgun/footgun
$ /plugin install footgun@footgun