[BUG] "invalid_request_error","message":"max_tokens: 128001 > 128000, which is the maximum allowed number of output tokens for claude-opus-4-6"}

Resolved 💬 3 comments Opened Feb 7, 2026 by PeakProductivity Closed Feb 7, 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?

In all new sessions, Claude Code is displaying this error message even with a new session and zero context:

<img width="2547" height="621" alt="Image" src="https://github.com/user-attachments/assets/ae040f13-2c0a-43be-88d7-fc38d6e4ade3" />

switching effort and model does not help.

Windows 11, Windows Terminal, Claude 2.1.34, Opus 4.6.

UPDATE: I tested with other models (Opus 4.5, Sonnet 4.5) and other projects - same error.

What Should Happen?

This error should not occur, since it is a critical show-stopper and prevents any work with Claude Code entirely.

Error Messages/Logs

⎿  API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"max_tokens: 128001 > 128000, which is the maximum allowed number of output tokens for
     claude-opus-4-6"},"request_id":"req_011CXtegwm1mF5ZQ6rwpSw6Y"}

Steps to Reproduce

Difficult to say, probably needs a project with a large codebase and a long history.

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

2.1.30

Claude Code Version

2.1.34

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Windows Terminal

Additional Information

<img width="2497" height="616" alt="Image" src="https://github.com/user-attachments/assets/bab4167f-82d0-405f-9ba4-e6ccbbf37b50" />

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗