[Bug] Anthropic API Error: Cannot modify thinking blocks during compaction

Resolved 💬 3 comments Opened Nov 25, 2025 by fazxes Closed Nov 29, 2025

Bug Description
Error: Error during compaction: Error: API Error: 400
{"type":"error","error":{"type":"invalid_request_error","message":"messages.15.content.5: 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_011CVUju3CKgSWJMFLt7EfAd"}

Environment Info

  • Platform: darwin
  • Terminal: cursor
  • Version: 2.0.53
  • Feedback ID: aa7d73d8-5d8a-467c-9247-f20b313f786f

Errors

[{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.15.content.5: `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_011CVUj6vAcrYmoZ276WF9Yf\"}\n    at I9.generate (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:459:9423)\n    at XT.makeStatusError (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1312:2195)\n    at XT.makeRequest (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1312:5419)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async l41.model (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:3934:14345)\n    at async l41 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2081:1872)\n    at async tX9 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:3934:14497)\n    at async file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:3934:7845\n    at async Nr1 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1464:1971)\n    at async MIA (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:3934:7815)","timestamp":"2025-11-25T13:58:58.784Z"},{"error":"Error: API Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.15.content.5: `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_011CVUj6vAcrYmoZ276WF9Yf\"}\n    at NB1 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1885:1542)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async MG2 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1885:9562)\n    at async rM (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2219:6527)\n    at async rM (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2219:11737)\n    at async rM (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2219:11737)\n    at async rM (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2219:11737)\n    at async rM (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2219:11737)\n    at async rM (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2219:11737)\n    at async rM (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2219:11737)","timestamp":"2025-11-25T13:58:58.791Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.15.content.5: `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_011CVUj7R2wiwaE1TRbrgCXf\"}\n    at I9.generate (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:459:9423)\n    at XT.makeStatusError (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1312:2195)\n    at XT.makeRequest (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1312:5419)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async l41.model (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:3934:14345)\n    at async l41 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2081:1872)\n    at async tX9 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:3934:14497)\n    at async file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:3934:7845\n    at async Nr1 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1464:1971)\n    at async MIA (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:3934:7815)","timestamp":"2025-11-25T13:59:06.309Z"},{"error":"Error: API Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.15.content.5: `thinking` or `redacted_thinking` blocks in the latest assistant message 

Note: Error logs were truncated.

View original on GitHub ↗

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