Anthropic API · api · fg-0001
Claude response is empty with stop_reason max_tokens and no error
stop_reason: max_tokens with zero text blocks
Verified 2026-08-02 · Confirmed by 0 builders · Trust 50/100
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 }Affects: Claude models with thinking, August 2026
Have your agent know this before it fails
claude mcp add --transport http footgun https://getfootgun.com/api/mcp