Bug: Intermittent "thinking is enabled but reasoning_content is missing in assistant tool call message" error crashes session

Resolved 💬 3 comments Opened Mar 22, 2026 by wuww007 Closed Mar 26, 2026

Bug Report

Problem

During normal Claude Code sessions (using official Claude models), an intermittent API 400 error occurs that immediately terminates the current operation:

API Error: 400 {"error":{"type":"invalid_request_error","message":"thinking is enabled but reasoning_content is missing in assistant tool call message at index 5"},"type":"error"}

The session stops completely and cannot be resumed without clearing context or restarting.

Environment

  • Platform: macOS (Darwin 23.4.0)
  • Model: claude-sonnet-4-6 (official Anthropic model)
  • Trigger: Intermittent — occurs probabilistically during any multi-step task involving tool calls

Root Cause (suspected)

When Claude Code maintains the conversation history and replays it to the API, it appears to strip thinking / reasoning_content blocks from prior assistant messages that included tool calls. The API now requires reasoning_content to be present in all assistant messages when extended thinking is enabled, so subsequent API calls fail with a 400 error.

Steps to Reproduce

  1. Start a Claude Code session with extended thinking enabled
  2. Perform a multi-step task that involves multiple tool calls (file reads, edits, bash commands, etc.)
  3. After several turns, the error occurs probabilistically — no deterministic repro steps known

Expected Behavior

Claude Code should preserve thinking/reasoning_content blocks in conversation history when extended thinking is active, ensuring all subsequent API requests remain valid.

Actual Behavior

The session crashes with a 400 error. The only recovery options are:

  • /clear to reset conversation context
  • Restart Claude Code entirely

Workaround

/clear

Then re-describe the task from scratch.

Related Issues

  • #32511 — similar error but specific to kimi-k2.5 model + WebSearch tool; this issue is broader (official Claude models, any tool call, intermittent)

View original on GitHub ↗

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