Submit a toolSubmit

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.

The problem: 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.

How do I continue or raise the cap when Claude Code says the response exceeded the output token maximum?

  1. 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

  2. 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.

  3. 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.

  4. 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.

  5. 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.

All tools for “Fix Claude Code response exceeded the output token maximum” →

Related fixes

See also AI tools launched today on the daily board.