[Bug] Anthropic API Error: Exception thrown when running /context

Resolved 💬 2 comments Opened Dec 16, 2025 by tlewers01 Closed Dec 16, 2025

Bug Description
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.33.content.0.type: Expected thinking or redacted_thinking, but found tool_use. When thinking is enabled, a final assistant message must start with a thinking block (preceeding the lastmost set of tool_use and tool_result blocks). We recommend you include thinking blocks from previous turns. To avoid this requirement, disable thinking. Please consult our documentation at https://docs.claude.com/en/docs/build-with-claude/extended-thinking"},"request_id":"req_011CWAf5a1ppjAUPzbB4kV9n"}
at I9.generate (file:///C:/Users/39982/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:458:10379)

Environment Info

  • Platform: win32
  • Terminal: windows-terminal
  • Version: 2.0.69
  • Feedback ID: 47183747-6f5f-47b5-82b2-a2d74b34741a

Errors

[{"error":"Error: Failed to create shell snapshot: Command failed: C:\\Program Files\\Git\\bin\\bash.exe -c -l SNAPSHOT_FILE='C:\\Users\\39982\\.claude\\shell-snapshots\\snapshot-bash-1765900984291-05qfn7.sh'\n      # No user config file to source\n\n      # First, create/clear the snapshot file\n      echo \"# Snapshot file\" >| \"$SNAPSHOT_FILE\"\n\n      # When this file is sourced, we first unalias to avoid conflicts\n      # This is necessary because aliases get \"frozen\" inside function definitions at definition time,\n      # which can cause unexpected behavior when functions use commands that conflict with aliases\n      echo \"# Unset all aliases to avoid conflicts with functions\" >> \"$SNAPSHOT_FILE\"\n      echo \"unalias -a 2>/dev/null || true\" >> \"$SNAPSHOT_FILE\"\n\n      echo \"shopt -s expand_aliases\" >> \"$SNAPSHOT_FILE\"\n\n      \n      # Check for rg availability\n      echo \"# Check for rg availability\" >> \"$SNAPSHOT_FILE\"\n      echo \"if ! command -v rg >/dev/null 2>&1; then\" >> \"$SNAPSHOT_FILE\"\n      echo '  alias rg='\"''\\''C:\\Users\\39982\\AppData\\Roaming\\npm\\node_modules\\@anthropic-ai\\claude-code\\vendor\\ripgrep\\x64-win32\\rg.exe'\\'''\" >> \"$SNAPSHOT_FILE\"\n      echo \"fi\" >> \"$SNAPSHOT_FILE\"\n  \n\n      # Add PATH to the file\n      echo \"export PATH=\\$PATH\" >> \"$SNAPSHOT_FILE\"\n  \n\n      # Exit silently on success, only report errors\n      if [ ! -f \"$SNAPSHOT_FILE\" ]; then\n        echo \"Error: Snapshot file was not created at $SNAPSHOT_FILE\" >&2\n        exit 1\n      fi\n    \n\n    at file:///C:/Users/39982/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:2418:132\n    at ChildProcess.exithandler (node:child_process:430:5)\n    at ChildProcess.emit (node:events:524:28)\n    at ChildProcess.emit (node:domain:489:12)\n    at maybeClose (node:internal/child_process:1104:16)\n    at ChildProcess._handle.onexit (node:internal/child_process:304:5)","timestamp":"2025-12-16T16:03:14.931Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"max_tokens: Extra inputs are not permitted\"},\"request_id\":\"req_011CWAf5YEuueXCt6ebLeYxo\"}\n    at I9.generate (file:///C:/Users/39982/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:458:10379)\n    at pR.makeStatusError (file:///C:/Users/39982/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:795:2195)\n    at pR.makeRequest (file:///C:/Users/39982/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:795:5419)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n    at async file:///C:/Users/39982/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:945:3503\n    at async file:///C:/Users/39982/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:945:2262\n    at async pL3 (file:///C:/Users/39982/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:944:16943)\n    at async LWB (file:///C:/Users/39982/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:945:2195)\n    at async RMA (file:///C:/Users/39982/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:1764:52)\n    at async yH8 (file:///C:/Users/39982/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:1764:2358)","timestamp":"2025-12-16T16:09:58.384Z"}]

View original on GitHub ↗

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