Claude Code: response exceeded the output token maximum. Continue or raise the cap
Claude Code cut the reply off at the output token maximum, so reply continue, and raise CLAUDE_CODE_MAX_OUTPUT_TOKENS only if the message says you can. Short answer: 5 steps. 1) Read which output-limit message you got; 2) Continue from the partial reply instead of resubmitting the whole task; 3) Raise CLAUDE_CODE_MAX_OUTPUT_TOKENS only when the message says you can; 4) Treat the 64000 non-streaming message as a hard ceiling; 5) Ask for smaller pieces so each reply stays under the cap.
Last updated: · This page is the decision checklist; the tools list for “Fix Claude Code response exceeded the output token maximum” is a separate URL.
How do I continue or raise the cap when Claude Code says the response exceeded the output token maximum?
Read which output-limit message you got
Match `API Error: Claude's response exceeded the ... output token maximum. To configure this behavior, set the CLAUDE_CODE_MAX_OUTPUT_TOKENS environment variable.` versus the non-streaming form that says the variable cannot raise a 64000 limit. Docs: https://code.claude.com/docs/en/errors
Continue from the partial reply instead of resubmitting the whole task
If Claude already wrote some text before the cut-off, that text stays in the conversation. In an interactive session reply `continue` so it finishes the rest instead of re-running the same long generation from scratch.
Raise CLAUDE_CODE_MAX_OUTPUT_TOKENS only when the message says you can
When the error names `CLAUDE_CODE_MAX_OUTPUT_TOKENS`, set that env var (see Claude Code env-var docs for where and how the value is capped): https://code.claude.com/docs/en/env-vars . Restart the shell/session so the new value is picked up.
Treat the 64000 non-streaming message as a hard ceiling
If the message says the reply hit the 64000 output token maximum for a request sent without streaming, a streaming attempt failed and Claude Code re-sent without streaming. `CLAUDE_CODE_MAX_OUTPUT_TOKENS` cannot raise that ceiling—split the work or fix the stream path instead of bumping the env var.
Ask for smaller pieces so each reply stays under the cap
Request one file, one section, or one patch per turn. Smaller outputs avoid both the configurable max and the 64000 non-streaming ceiling, and they leave room if thinking/tool blocks also consume the output budget (related: `max_tokens must be greater than thinking.budget_tokens` on the same errors page).
Which tools are best to fix Claude Code response exceeded the output token maximum?
Claude Code error reference
Maps both configurable and 64000 non-streaming output-token-maximum messages.
Claude Code environment variables
Where and how to set CLAUDE_CODE_MAX_OUTPUT_TOKENS and related caps.
Claude Code overview
Update/install guidance so you’re on a build with current cut-off messaging.
Anthropic API errors
Underlying API error shapes when a max_tokens / output limit maps to a provider 400.
Open: 1 spot per week
One labeled sponsor for this topic each week; this week's spot is open. See open weeks →
All tools for “Fix Claude Code response exceeded the output token maximum” →
Related fixes
- Stop a Cursor agent loopHow to fix a Cursor agent loop (same edit, or work after Stop)Fix →
- Claude Code vs Codex vs Cursor ~$20 plansClaude Code vs Codex vs Cursor $20 plan limits: how to pick without burning the weekFix →
- Scan a vibe-coded app for leaked API keysCheck a vibe-coded app for leaked API keys before you share itFix →
- Add an MCP server to Claude Code, Cursor, or CodexHow to add an MCP server to Claude Code, Cursor, or CodexFix →
See also AI tools launched today on the daily board.
NewAIToolsToday Daily
Top 3 AI launches, one model or news item that matters, and one simple fix. A 5-minute read, every weekday.