API 400 error: thinking blocks modified in /plan mode conversation history

Resolved 💬 2 comments Opened May 29, 2026 by berrico8 Closed Jun 1, 2026

Description

Using /plan mode causes a persistent 400 API error that breaks the session. Once triggered, every subsequent message in the session fails with the same error.

Error message

API Error: 400 messages.7.content.22: `thinking` or `redacted_thinking` blocks in the latest assistant message cannot be modified. These blocks must remain as they were in the original response.

Steps to reproduce

  1. Start a session and invoke /plan
  2. Claude asks clarifying questions (using extended thinking internally)
  3. Answer the questions
  4. The session errors — every subsequent message (including /plan continue) returns the 400 error

Expected behavior

The harness should preserve thinking and redacted_thinking content blocks exactly as returned by the API when building subsequent conversation history. The API requires these blocks to be passed back unmodified.

Actual behavior

The harness appears to strip or modify thinking blocks from the assistant message before the next API call, causing a 400 rejection.

Environment

  • Claude Code CLI
  • Model: claude-sonnet-4-6
  • Platform: macOS (Darwin 23.6.0)

View original on GitHub ↗

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