[BUG] [BUG] API Error 400: "The content[].thinking in the thinking mode must be passed back to the API" - frequent interruptions during conversation

Resolved 💬 10 comments Opened May 27, 2026 by dmfans Closed Jul 15, 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?

Environment

  • Claude Code version: 2.1.152
  • OS: Windows 10 Home China 10.0.19045
  • Shell: bash (Git Bash)
  • Running inside: VSCode extension (native)

This happens intermittently throughout sessions. When it occurs, the conversation hangs and the assistant is forced to retry. The error seems to originate from the Anthropic API server rejecting thinking blocks (possibly empty or malformed) that the client sends back.

Steps to Reproduce

  1. Run Claude Code (VS Code extension) with thinking mode enabled
  2. Have a multi-turn conversation involving tool calls
  3. Error appears randomly, sometimes multiple times per session

Impact

  • Conversation frequently interrupted
  • Requires manual retries or prompts to continue
  • Makes long sessions frustrating and unreliable

Notes

The issue does NOT appear related to:

  • Local network/proxy (happens regardless)
  • Authentication (API key works fine otherwise)
  • Specific prompts or inputs (appears across different tasks)

What Should Happen?

希望我的Claude code能正常执行任务 中间不要因为API Error: 400 The content[].thinking in the thinking mode must be passed back to the API. 这个原因卡住

Error Messages/Logs

API Error: 400 The content[].thinking in the thinking mode must be passed back to the API.

Steps to Reproduce

  1. 在 VS Code 终端 (Git Bash) 中打开 Claude Code
  2. 启用 thinking mode(默认就是开启的)
  3. 进行一次多轮对话,包含若干工具调用(如读写文件、执行命令等)
  4. 在对话进行到中后期(约 10+ 轮交互后),随机出现以下错误:

API Error: 400 The content[].thinking in the thinking mode must be passed back to the API.

  1. 对话卡住,无法继续,需要手动发送消息(如 "1" 或 "继续")来恢复

注:该错误不是每次都出现,但在长对话中频率明显增高。

Claude Model

Other

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.152

Platform

Other

Operating System

Windows

Terminal/Shell

VS Code integrated terminal

Additional Information

_No response_

View original on GitHub ↗

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