[BUG] API Error 400: Thinking Block Modification Error (Not a Duplicate)
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?
When viewing the TODO list using the ultrathink command, the following API error occurs, and thereafter the session is unrecoverable due to repeated 400 errors:
API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.5.content.20: thinking or redacted_thinking blocks in the latest assistant message cannot be modified. These blocks must remain as they were in the original response."}}
This error is not reported as a duplicate and the issue occurs even after reviewing and searching all existing closed and open issues for similar errors. Please review as a unique bug.
What Should Happen?
Claude should handle long conversations or ultrathink/todo list queries without entering an unrecoverable error state. If thinking/redacted_thinking blocks cannot be modified (API constraint), Claude Code should detect this before submitting the request and fail gracefully or allow the session to recover.
Error Messages/Logs
API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.5.content.20: `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
- Run 'ultrathink whats next on our todo list' or similar prompt in a long-running session
- Trigger a response that would modify or replay an older assistant message containing a thinking or redacted_thinking block
- Observe repeated 400 error
- Session is unrecoverable until restarted
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.0.50 (Claude Code)
Platform
Other
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
Please confirm this is not marked as a duplicate; prior similar errors do not match the triggering conditions of the ultrathink/todo list pathway for this API error. This is filed to ensure the root cause is distinctly tracked.
24 Comments
I'm getting the same API error. Not triggered by ULTRATHINK specifically.
API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.3.content.20:
thinkingorredacted_thinkingblocks in the latest assistantmessage cannot be modified. These blocks must remain as they were in the original response."},"request_id":"req_011CVTRieUTEKMiQ1C6jnx8t"}
Using VS Code, on macos. Claude code terminal.
Unable to recover the conversation with: Tried close and /resume. Tried re-authenticating API key. Tried restarting VS Code.
I asked a new claude code conversation to debug the corrupted conversation and here is it's assessment:
What happened:
This appears to be a Claude Code client bug related to how the conversation history is reconstructed after a user interrupt, specifically involving thinking/extended thinking
blocks.
Recovered the conversation by using "Rewind" to go back a couple prompts before the error appeared.
Breaks everything and neither manual nor automatic compaction works.
bump, as I ran into the same issue. I interrupted a conversation shortly before doing the compact, perhaps this is relevant.
Bump, ran into this issue. No compaction works.
I don't think I interrupted anything, at least not immediately before this issue (maybe I did further back in my session, since prior compaction).
Persists across
^C+claude -c, not sure what to do.I even gave it a normal prompt to write some state so I could start a new session, and got the same error (so it's not specific to
/compact, it gave me this error in response to a "normal" prompt; whole session was broken).Bump, same here
same here
Same here
Let's see if we can identify a specific version where the error was introduced.
Same here
this just happened to me as well, rewinding back to before the interrupt fixed it for me, but same, when i went to compact a little bit after the interrupt is when it gave me the api error. bumping for more eyes.
up
edit: workaround I currently found is to: 1. type
/modeland selectsonnet 4.5(instead of Opus 4.5); 2./compactnot working guys
I'm seeing this too - Sonnet 4.5, continuing a conversation from a couple of weeks ago. No interruption, it had completed my changes. In my case I was able to /compact and clear the error.
Confirming this on v2.0.55, Linux (Ubuntu/Debian).
Impact on workflow:
This bug is causing serious workflow disruption. When compaction fails, Claude Code enters a death spiral of repeated errors until the session becomes completely unusable and
loses all context.
Current workaround:
I have to proactively monitor for compaction errors and
/clearthe session before total failure, timing it after documenting work-in-progress. This means:Configuration:
alwaysThinkingEnabled: truein~/.claude/settings.jsonNote on issue #11533:
This was marked as "fixed in v2.0.37" and closed on Nov 17, but the bug is clearly still present in v2.0.55 (latest version). This appears to be a regression that needs immediate
attention.
This needs to be prioritized - the current state makes Claude Code unreliable for long work sessions.
Update: Bug Isolated to Opus 4.5 (2025-11-29)
Finding: Successfully completed conversation compaction using Sonnet 4.5 without encountering hallucination issues. This confirms the bug is specific to Opus 4.5, not
Sonnet 4.5.
Workaround for Users:
If you encounter conversation compaction hallucinations, switch to Sonnet 4.5:
```bash
claude --model sonnet
Test Results:
This suggests the issue is model-specific and can be avoided by using Sonnet until Opus compaction is fixed.
Happened to me just then, v2.0.56. After changing to Sonnet I was able to compact again.
I'm suprised to find out that Opus 4.5 is now the recommended/default model again, after they only recently made the Opus model almost unusuable due to the high token usage and told everyone to please use Sonnet for daily tasks. That was when they also introduced them new weekly limits.
I had a case where even Sonnet 4.5 failed to compact - switched down to Haiku to compact and then back up to Opus to continue working ...
but FWIW, as a heavy CC user who was affected by the limitations @StayMeaty mentioned - in my experience, as of 4.5, Opus uses comparatively fewer tokens to get tasks done. Overall the 4.5 Opus launch + switch to default been a great experience and a very successful launch IMHO, this bug notwithstanding.
I’m in agreement with Itamar.
On Wed, Dec 3, 2025 at 8:53 AM Itamar Rogel @.***>
wrote:
I got the same error when I tried to click /compact, with the Sonnet 4.5 model. When all the context is used up, the agent gets stuck on "prompt is too long" and becomes completely unresponsive. Hard failure.
+1 running constantly into it when the a chat gets accidentally interrupted.
I sporadically get the same error message on Sonnet 4.5 without even running /compact, just in the middle of a conversation. Claude says that a task is done and asks me what to do next, and when I write a prompt I get this error about not modifying thinking blocks.
+1 ran into this for the first time today _while using Sonnet 4.5_ - otherwise CC is my go-to AI choice these days
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.