[Bug] Anthropic API Error: 400 Bad Request after auto-compact with insufficient context recovery
Resolved 💬 5 comments Opened Nov 17, 2025 by Yuozas Closed Jan 5, 2026
Bug Description
Claude Code runs out of context immediately after its own automated compaction.
After compaction completes, making just 1-2 simple file edits triggers "Context
low" again. When I try to /compact manually with instructions to keep context
minimal, it fails with "Conversation too long, press esc twice". When I try
/context to debug, I get a 400 error about thinking blocks.
This started happening on November 16-17, 2025 and makes Claude Code completely
unusable. The compaction process appears to create excessively verbose summaries
that immediately fill the context window again.
Environment Info
- Platform: linux
- Terminal: pycharm
- Version: 2.0.42
- Feedback ID: 2ef61533-9ebc-418d-b1dd-5ea4635c9aa9
Errors
[{"error":"Error: Could not find plugin directories for pycharm\n at nqQ (file:///home/yuozas/.nvm/versions/node/v25.0.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1652:8291)\n at Xy6 (file:///home/yuozas/.nvm/versions/node/v25.0.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1653:4096)\n at Zy6 (file:///home/yuozas/.nvm/versions/node/v25.0.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1653:1610)\n at file:///home/yuozas/.nvm/versions/node/v25.0.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1654:2849\n at process.processTicksAndRejections (node:internal/process/task_queues:103:5)","timestamp":"2025-11-17T11:31:03.160Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"max_tokens: Extra inputs are not permitted\"},\"request_id\":\"req_011CVDQ211AgezPxUUonMfLv\"}\n at J9.generate (file:///home/yuozas/.nvm/versions/node/v25.0.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:435:17956)\n at S_.makeStatusError (file:///home/yuozas/.nvm/versions/node/v25.0.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:715:2117)\n at S_.makeRequest (file:///home/yuozas/.nvm/versions/node/v25.0.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:715:5341)\n at process.processTicksAndRejections (node:internal/process/task_queues:103:5)\n at async RDA (file:///home/yuozas/.nvm/versions/node/v25.0.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1584:571)\n at async AHA (file:///home/yuozas/.nvm/versions/node/v25.0.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1964:97)\n at async j15 (file:///home/yuozas/.nvm/versions/node/v25.0.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1964:2297)\n at async Promise.all (index 6)\n at async UdQ (file:///home/yuozas/.nvm/versions/node/v25.0.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1964:2709)\n at async Object.call (file:///home/yuozas/.nvm/versions/node/v25.0.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:2494:469)","timestamp":"2025-11-17T11:39:47.406Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.9.content.0.type: Expected `thinking` or `redacted_thinking`, but found `text`. When `thinking` is enabled, a final `assistant` message must start with a thinking block. 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_011CVDQ22SjqwnYRt2zhku1J\"}\n at J9.generate (file:///home/yuozas/.nvm/versions/node/v25.0.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:435:17956)\n at S_.makeStatusError (file:///home/yuozas/.nvm/versions/node/v25.0.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:715:2117)\n at S_.makeRequest (file:///home/yuozas/.nvm/versions/node/v25.0.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:715:5341)\n at process.processTicksAndRejections (node:internal/process/task_queues:103:5)\n at async yUQ (file:///home/yuozas/.nvm/versions/node/v25.0.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1584:1228)\n at async AHA (file:///home/yuozas/.nvm/versions/node/v25.0.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1964:140)\n at async j15 (file:///home/yuozas/.nvm/versions/node/v25.0.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1964:2297)\n at async Promise.all (index 6)\n at async UdQ (file:///home/yuozas/.nvm/versions/node/v25.0.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1964:2709)\n at async Object.call (file:///home/yuozas/.nvm/versions/node/v25.0.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:2494:469)","timestamp":"2025-11-17T11:39:47.709Z"}]This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗