[BUG] CLAUDE_CODE_MAX_OUTPUT_TOKENS: Capped from 64000 to 32000 on v2.0.14

Status Closed — not planned
Maintainer reply None cached
Activity 8 comments · opened Oct 11, 2025 · closed Jan 29, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

CLAUDE_CODE_MAX_OUTPUT_TOKENS was set to 64K to match Sonnet 4.5 output limit, but as soon as I go over 32K, I get:

<img width="808" height="24" alt="Image" src="https://github.com/user-attachments/assets/8854b025-59fd-4b8a-bc50-ffe9a7ac6eac" />

And when I run doctor, it actually shows that it is capping the env variable from the 64K set to 32K output token.

<img width="325" height="248" alt="Image" src="https://github.com/user-attachments/assets/1f8373a6-aeff-4bbd-8c37-4af25ffa4aad" />

While on Claude official docs it states 64K:

<img width="201" height="305" alt="Image" src="https://github.com/user-attachments/assets/3e72204c-c1cd-4d26-b2f9-2aa22c7de707" />

What Should Happen?

The value of the env variable should be set to 64K, not capped to 32K.

export CLAUDE_CODE_MAX_OUTPUT_TOKENS = 64000

Error Messages/Logs

Steps to Reproduce

Set the variable:

export CLAUDE_CODE_MAX_OUTPUT_TOKENS = 64000

Run /doctor on Claude Code:

/doctor

Claude Model

Sonnet (default)

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.0.14

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

_No response_

View original on GitHub ↗

8 Comments

github-actions[bot] · 10 months ago

Found 2 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/4510
  2. https://github.com/anthropics/claude-code/issues/4255

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

LorenzoNava99 · 10 months ago

On the bugs filed, there's nothing stating value capped on /doctor, also that's an older version with a different model. Also the patching quick fix is completely different from the other bugs.

mariusatstarlims · 10 months ago

I can reproduce this too. Using Sonnet 4.5, getting this message (CLAUDE_CODE_MAX_OUTPUT_TOKENS Capped from 64000 to 32000) when I set

"env": {
    "CLAUDE_CODE_MAX_OUTPUT_TOKENS": "64000"
  }

Claude version 2.0.25

antonlvovych · 10 months ago

Version 2.0.29 - still there

github-actions[bot] · 8 months ago

This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

iamkingsleyf · 8 months ago

Still here in Windows claude app Claude 1.0.2339 (1782e2) 2025-12-16T19:35:52.000Z

github-actions[bot] · 7 months ago

This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.

github-actions[bot] · 6 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.