[Bug] Anthropic API Error: Cannot modify thinking blocks in assistant messages
Resolved 💬 3 comments Opened Dec 3, 2025 by pierreTklein Closed Dec 6, 2025
Bug Description
Could not compact due "API Error: Cannot modify thinking blocks in assistant messages"
Environment Info
- Platform: darwin
- Terminal: vscode
- Version: 2.0.56
- Feedback ID: 3ca3bde4-4d8b-4104-9dff-9746c869258d
Errors
[{"error":"AxiosError: Request failed with status code 404\n at Sj (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:24:1137)\n at Unzip.<anonymous> (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:29:9864)\n at Unzip.emit (node:events:536:35)\n at Unzip.emit (node:domain:489:12)\n at endReadableNT (node:internal/streams/readable:1698:12)\n at process.processTicksAndRejections (node:internal/process/task_queues:82:21)\n at zVA.request (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:31:2130)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n at async Fg2 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2561:1057)\n at async Vg2 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2561:2094)\n at async Object.call (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2561:8584)\n at async Yd5 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2292:16383)","timestamp":"2025-12-02T20:43:29.414Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.7.content.12: `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_011CVj1mAd176r8FFfiDvFAN\"}\n at s2.generate (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:459:9381)\n at NT.makeStatusError (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1317:2195)\n at NT.makeRequest (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1317:5419)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n at async PK9.V61.model (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:3961:10432)\n at async V61 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2145:1872)\n at async PK9 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:3961:10586)\n at async file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:3961:3873\n at async do1 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1469:2037)\n at async AYA (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:3961:3843)","timestamp":"2025-12-03T03:05:46.367Z"},{"error":"Error: API Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.7.content.12: `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_011CVj1mAd176r8FFfiDvFAN\"}\n at j21 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1919:1576)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n at async GZ2 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1919:9764)\n at async G$ (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2292:2134)\n at async file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2840:1932\n at async file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2840:2870\n at async a99 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2825:2836)\n at async SJ0 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2825:1407)\n at async file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2840:3024\n at async file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2822:5335","timestamp":"2025-12-03T03:05:46.385Z"},{"error":"Error: Request was aborted.\n at NT.makeRequest (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1317:3939)\n at processTicksAndRejections (node:internal/process/task_queues:95:5)\n at runNextTicks (node:internal/process/task_queues:64:3)\n at process.processTimers (node:internal/timers:516:9)","timestamp":"2025-12-03T03:05:47.188Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.7.content.12: `thinking` or `redacted_thinking` blocks in the latest assista
Note: Error logs were truncated.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗