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

Resolved 💬 3 comments Opened Dec 4, 2025 by cancelei Closed Dec 8, 2025

Bug Description
Claude conversation stopped and can't be compacted. Have to start new conversation from scratch. > continue
⎿  Context low · Run /compact to compact & continue

/compact

⎿ Error: Error during compaction: Error: API Error: 400
{"type":"error","error":{"type":"invalid_request_error","message":"messages.1.content.70:
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_011CVn8bs8cK3drWZu1WSED2"}

/compact

⎿ Error: Error during compaction: Error: API Error: 400
{"type":"error","error":{"type":"invalid_request_error","message":"messages.1.content.70:
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_011CVn8czSRU4ggf2KZBU3rK"}

/exit

⎿  Bye!

/compact

⎿ Error: Error during compaction: Error: API Error: 400
{"type":"error","error":{"type":"invalid_request_error","message":"messages.1.content.70:
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_011CVn8rxTkcSmYemXaq4F49"}

Environment Info

  • Platform: linux
  • Terminal: vte-based
  • Version: 2.0.58
  • Feedback ID: 91212356-421c-4cb5-8cec-c0aaba6a69d2

Errors

[{"error":"AggregateError\n    at J2A.from (file:///home/cancelei/.asdf/installs/nodejs/24.8.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:11:14602)\n    at hz.<anonymous> (file:///home/cancelei/.asdf/installs/nodejs/24.8.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:29:10022)\n    at hz.emit (node:events:520:35)\n    at hz.emit (node:domain:489:12)\n    at UF1.<computed> (file:///home/cancelei/.asdf/installs/nodejs/24.8.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:28:1117)\n    at ClientRequest.emit (node:events:520:35)\n    at ClientRequest.emit (node:domain:489:12)\n    at emitErrorEvent (node:_http_client:107:11)\n    at TLSSocket.socketErrorListener (node:_http_client:574:5)\n    at TLSSocket.emit (node:events:508:28)\n    at xVA.request (file:///home/cancelei/.asdf/installs/nodejs/24.8.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:31:2130)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async $K0 (file:///home/cancelei/.asdf/installs/nodejs/24.8.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:4275:8674)","timestamp":"2025-12-04T18:38:25.674Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.1.content.70: `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_011CVn8rxTkcSmYemXaq4F49\"}\n    at o2.generate (file:///home/cancelei/.asdf/installs/nodejs/24.8.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:459:9381)\n    at RT.makeStatusError (file:///home/cancelei/.asdf/installs/nodejs/24.8.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1319:2195)\n    at RT.makeRequest (file:///home/cancelei/.asdf/installs/nodejs/24.8.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1319:5419)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async a61.model (file:///home/cancelei/.asdf/installs/nodejs/24.8.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:3966:10439)\n    at async a61 (file:///home/cancelei/.asdf/installs/nodejs/24.8.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:2149:1872)\n    at async yH9 (file:///home/cancelei/.asdf/installs/nodejs/24.8.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:3966:10593)\n    at async file:///home/cancelei/.asdf/installs/nodejs/24.8.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:3966:3869\n    at async jt1 (file:///home/cancelei/.asdf/installs/nodejs/24.8.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1471:2037)\n    at async CYA (file:///home/cancelei/.asdf/installs/nodejs/24.8.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:3966:3839)","timestamp":"2025-12-04T18:40:39.522Z"},{"error":"Error: API Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.1.content.70: `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_011CVn8rxTkcSmYemXaq4F49\"}\n    at F91 (file:///home/cancelei/.asdf/installs/nodejs/24.8.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1921:1566)\n    at process.processTicksAndRejections (node:internal/process/task_

Note: Error logs were truncated.

View original on GitHub ↗

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