[Bug] Anthropic API Error: Cannot modify thinking blocks in compact operation
Resolved 💬 4 comments Opened Nov 25, 2025 by dontriskit Closed Dec 9, 2025
Bug Description
/compact
⎿ Error: Error during compaction: Error: API Error: 400
{"type":"error","error":{"type":"invalid_request_error","message":"messages.5.content.65: 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_011CVTmhFXd8QZuuJcuY3xE1"}
Environment Info
- Platform: linux
- Terminal: vscode
- Version: 2.0.51
- Feedback ID: a3e9dffe-901b-4713-8da0-ddc57bcc3ad8
Errors
[{"error":"Error: spawn /home/mhm/.nvm/versions/node/v22.8.0/lib/node_modules/@anthropic-ai/claude-code/vendor/ripgrep/x64-linux/rg ENOENT\n at ChildProcess._handle.onexit (node:internal/child_process:286:19)\n at onErrorNT (node:internal/child_process:484:16)\n at process.processTicksAndRejections (node:internal/process/task_queues:90:21)","timestamp":"2025-11-25T00:27:16.708Z"},{"error":"MaxFileReadTokenExceededError: File content (51756 tokens) exceeds maximum allowed tokens (25000). Please use offset and limit parameters to read specific portions of the file, or use the GrepTool to search for specific content.\n at CQ2 (file:///home/mhm/.nvm/versions/node/v22.8.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1509:41089)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n at async Object.call (file:///home/mhm/.nvm/versions/node/v22.8.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1518:963)\n at async file:///home/mhm/.nvm/versions/node/v22.8.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1648:1464","timestamp":"2025-11-25T00:28:14.830Z"},{"error":"MaxFileReadTokenExceededError: File content (51756 tokens) exceeds maximum allowed tokens (25000). Please use offset and limit parameters to read specific portions of the file, or use the GrepTool to search for specific content.\n at CQ2 (file:///home/mhm/.nvm/versions/node/v22.8.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1509:41089)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n at async Object.call (file:///home/mhm/.nvm/versions/node/v22.8.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1518:963)\n at async file:///home/mhm/.nvm/versions/node/v22.8.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1648:1464","timestamp":"2025-11-25T00:28:15.170Z"},{"error":"ZodError: [\n {\n \"code\": \"unrecognized_keys\",\n \"keys\": [\n \"plan\"\n ],\n \"path\": [],\n \"message\": \"Unrecognized key(s) in object: 'plan'\"\n }\n]\n at get error (file:///home/mhm/.nvm/versions/node/v22.8.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:74:18431)\n at UY.parse (file:///home/mhm/.nvm/versions/node/v22.8.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:74:11700)\n at MR3 (file:///home/mhm/.nvm/versions/node/v22.8.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:3992:4662)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n at async B$ (file:///home/mhm/.nvm/versions/node/v22.8.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:3992:6174)","timestamp":"2025-11-25T00:33:28.791Z"},{"error":"Error: Request was aborted.\n at Mo._createMessage (file:///home/mhm/.nvm/versions/node/v22.8.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:401:3151)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)","timestamp":"2025-11-25T00:58:47.483Z"},{"error":"X51: Another process is currently installing an update\n at XRA (file:///home/mhm/.nvm/versions/node/v22.8.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:2684:1830)\n at file:///home/mhm/.nvm/versions/node/v22.8.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:2696:9759\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)","timestamp":"2025-11-25T01:00:28.679Z"},{"error":"MaxFileReadTokenExceededError: File content (51756 tokens) exceeds maximum allowed tokens (25000). Please use offset and limit parameters to read specific portions of the file, or use the GrepTool to search for specific content.\n at CQ2 (file:///home/mhm/.nvm/versions/node/v22.8.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1509:41089)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n at async Object.call (file:///home/mhm/.nvm/versions/node/v22.8.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1518:963)\n at async file:///home/mhm/.nvm/versions/node/v22.8.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1648:1464","timestamp":"2025-11-25T01:13:21.759Z"},{"error":"MaxFileReadTokenExceededError: File content (51756 tokens) exceeds maximum allowed tokens (25000). Please use offset and limit parameters to read specific portions of the file, or use the GrepTool to search for specific content.\n at CQ2 (file:///home/mhm/.nvm/versions/node/v22.8.0/lib/node_modul
Note: Error logs were truncated.
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗