``` [Bug] Anthropic API Error: Cannot modify thinking blocks in assistant messages ```

Resolved 💬 3 comments Opened Jan 13, 2026 by jvanderberg Closed Feb 28, 2026

Bug Description
generate a PR description as a single MD code block that I can copy
⎿  API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.1.content.547: 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_011CX5a2j8YCTQGdbug3LQLJ"}

Environment Info

  • Platform: darwin
  • Terminal: WarpTerminal
  • Version: 2.1.6
  • Feedback ID: 8f2783f8-0bae-467a-a3f4-22c857f9a3e4

Errors

[{"error":"AxiosError: Request failed with status code 401\n    at yy (file:///Users/joshv/.nvm/versions/node/v22.21.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:55:1138)\n    at IncomingMessage.<anonymous> (file:///Users/joshv/.nvm/versions/node/v22.21.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:56:9861)\n    at IncomingMessage.emit (node:events:531:35)\n    at IncomingMessage.emit (node:domain:489:12)\n    at endReadableNT (node:internal/streams/readable:1698:12)\n    at process.processTicksAndRejections (node:internal/process/task_queues:90:21)\n    at NUA.request (file:///Users/joshv/.nvm/versions/node/v22.21.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:58:2132)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async go5 (file:///Users/joshv/.nvm/versions/node/v22.21.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:2859:8550)\n    at async file:///Users/joshv/.nvm/versions/node/v22.21.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:2859:9468","timestamp":"2026-01-13T14:54:29.685Z"},{"error":"Error: LSP server plugin:rust-analyzer-lsp:rust-analyzer crashed with exit code 1\n    at ChildProcess.<anonymous> (file:///Users/joshv/.nvm/versions/node/v22.21.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:2324:21508)\n    at ChildProcess.emit (node:events:519:28)\n    at ChildProcess.emit (node:domain:489:12)\n    at ChildProcess._handle.onexit (node:internal/child_process:293:12)","timestamp":"2026-01-13T14:54:30.136Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.1.content.547: `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_011CX5a1LykgwVTwA7Cns5Qc\"}\n    at H9.generate (file:///Users/joshv/.nvm/versions/node/v22.21.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:490:33583)\n    at RP.makeStatusError (file:///Users/joshv/.nvm/versions/node/v22.21.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:928:2195)\n    at RP.makeRequest (file:///Users/joshv/.nvm/versions/node/v22.21.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:928:5420)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async $51.model (file:///Users/joshv/.nvm/versions/node/v22.21.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:4404:6290)\n    at async $51 (file:///Users/joshv/.nvm/versions/node/v22.21.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1078:97707)\n    at async zz9 (file:///Users/joshv/.nvm/versions/node/v22.21.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:4404:6444)\n    at async file:///Users/joshv/.nvm/versions/node/v22.21.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:4402:3799\n    at async aG0 (file:///Users/joshv/.nvm/versions/node/v22.21.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1079:1998)\n    at async fEA (file:///Users/joshv/.nvm/versions/node/v22.21.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:4402:3769)","timestamp":"2026-01-13T14:54:58.124Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.1.content.547: `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_011CX5a2j8YCTQGdbug3LQLJ\"}\n    at H9.generate (file:///Users/joshv/.nvm/versions/node/v22.21.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:490:33583)\n    at RP.makeStatusError (file:///Users/joshv/.nvm/versions/node/v22.21.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:928:2195)\n    at RP.makeRequest (file:///Users/joshv/.nvm/versions/node/v22.21.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:928:5420)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async $51.model (file:///Users/joshv/.nvm/versions/node/v22.21.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:4404:6290)\n    at async $51 (file:///Users/joshv/.nvm/versions/node/v22.21.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1078:97707)\n    at async zz9 (file:///Users/joshv/.nvm/versions/node/v22.21.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:4404:6444)\n    at async file:///Users/joshv/.nvm

Note: Error logs were truncated.

View original on GitHub ↗

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