[BUG] Session becomes completely unrecoverable due to thinking block API error
Resolved 💬 10 comments Opened Nov 30, 2025 by rmaher001 Closed Mar 16, 2026
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report
- [x] I am using the latest version of Claude Code
Bug Description
During an extended Claude Code session, an API error occurs that makes the session completely unrecoverable. The error is related to thinking blocks being modified. Once this error occurs:
- Cannot continue the conversation (any input triggers the error)
/compactfails with the same error/clear- untested but context loss is unacceptable- The only option is to abandon the session and lose all context
This is a critical bug because it causes complete loss of work-in-progress with no recovery path.
Error Message
API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.49.content.1: `thinking` or `redacted_thinking` blocks in the latest assistant message cannot be modified. These blocks must remain as they were in the original response."},"request_id":"req_011CVeW1YWWvLQ7fem8ut3YA"}
Environment
- Claude Code Version: 2.0.55
- Platform: macOS (Mac Mini M4 Pro, 64GB RAM)
- macOS Version: 15.6.1 (Build 24G90)
- Terminal: VS Code integrated terminal
- Node Version: v22.16.0
Steps to Reproduce
- Use Claude Code for an extended session (in this case, 49+ messages based on error)
- At some point during normal usage, the error occurs
- Any subsequent input (including
/compact) triggers the same error - Session is completely stuck with no way to recover context
Expected Behavior
- Thinking blocks should be managed internally without corruption
- If corruption occurs,
/compactshould be able to recover by summarizing and starting fresh - At minimum, there should be a way to export/save context before being forced to abandon the session
Actual Behavior
Session becomes completely unusable. User is forced to lose all conversation context and start over.
Impact
- Severity: High
- Complete loss of conversation context
- Loss of work-in-progress
- No recovery mechanism available
- Forces user to restart and manually reconstruct context
Related Issues
This appears related to #11323 which describes a similar thinking block error after Ctrl+C interruption, though in this case no interruption was involved.
Additional Context
- Error occurred during normal usage, no Ctrl+C or interruption
- The session was working normally until this error appeared
- Multiple installation paths detected (npm-local and npm-global) but this is likely unrelated
Suggested Fix
- Ensure thinking blocks are never corrupted during normal session flow
- Add a recovery mechanism (e.g.,
/compact --forceor/recover) that can salvage context even when message structure is invalid - Add ability to export conversation context before clearing
This issue has 10 comments on GitHub. Read the full discussion on GitHub ↗