[BUG] Error during compaction: Error: API Error: 400
Resolved 💬 20 comments Opened Nov 13, 2025 by pdvmovil Closed Nov 17, 2025
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Auto compacting conversation breaks and loses ability to continue. Must /clear and move on losing all previous context.
⎿ Context low · Run /compact to compact & continue
/compact
⎿ Error: Error during compaction: Error: API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"clear_thinking_20251015 strategy requires thinking to be
enabled"},"request_id":"req_011CV5GKqn5UXHegb6p6X3qh"}
What Should Happen?
Should compact conversation and continue with previous context.
Error Messages/Logs
> /compact
⎿ Error: Error during compaction: Error: API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"`clear_thinking_20251015` strategy requires `thinking` to be
enabled"},"request_id":"req_011CV5G9fEoAybGwoHK6PhxF"}
> /compact
⎿ Error: Error during compaction: Error: API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"`clear_thinking_20251015` strategy requires `thinking` to be
enabled"},"request_id":"req_011CV5GFKounnQkbjFncUVp3"}
> /compact
⎿ Error: Error during compaction: Error: API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"`clear_thinking_20251015` strategy requires `thinking` to be
enabled"},"request_id":"req_011CV5GFW73FdfX2fqFC3qei"}
> /compact
⎿ Error: Error during compaction: Error: API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"`clear_thinking_20251015` strategy requires `thinking` to be
enabled"},"request_id":"req_011CV5GFgV7kfHEhjNH1uAcw"}
> /compact
⎿ Error: Error during compaction: Error: API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"`clear_thinking_20251015` strategy requires `thinking` to be
enabled"},"request_id":"req_011CV5GG4m4p6kML4Msvh4oa"}
Steps to Reproduce
Use ClaudCode latest version long enough to auto compact conversation.
Claude Model
Sonnet (default)
Is this a regression?
Yes, this worked in a previous version
Last Working Version
2.0.31
Claude Code Version
2.0.36
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
20 Comments
for now write the word "ultrathink" before your command , that fixes the issue
before every command, or just at the time it fails?
Writing "ultrathink" did not fix it for me, I had to just use /clear. Updating: and that instance of Claude fails to autocompact again when the context hits 0% again. So rather than using /clear, it's better to just start a new Claude.
Had the same error, worked with ultrathink, but seemed weird, updated
claude-codevia Homebrew and now it works properly.I ran into a similar issue
/cleardid not work for meultrathink/quitthenclaudedid work for me❌️ /clear
❌️ /quit
❌️ reinstall claude
❌️ deleted $HOME/.claude
❌️ deleted all custom commands
/ultrathinkseems to work but wouldn't be wasting precious tokens?Claude is of the opinion that the problem is in the app and the API server.
I encountered this exact error on
2.0.36. The root cause is a conflict with theclear_thinking_20251015strategy in older versions.Solution
Update to the latest version (currently
2.0.42):After updating,
/compactworks as expected.WSL Users
If
claude --versionstill shows2.0.36after updating, you may have multiple installations. Check with:If it points to
/mnt/c/Users/[username]/AppData/Roaming/npm/claude, you have a stale Windows installation taking precedence. Remove it:Then reinstall on the Linux side:
Can confirm this resolves both the
/compacterror and theclear_thinkingstrategy issue.No longer an issue for me either after upgrading.
only this solution work
Closing as this is fixed as of
2.0.37— so sorry for the friction here, and thank you for reporting!I just click tab to turn on thinking and now it works
I am having this issue now. Claude version 2.0.46
Same issue and version as @Theshedman
⎿ API Error: 400 {"message":"context_management.edits.0: Input tag 'clear_thinking_20251015' found using 'type' does not match any of the expected tags:
'clear_tool_uses_20250919'"}
claude --version
2.0.47 (Claude Code)
Same here as @pankajvkulkarni wrote. It's getting very annoying.
Same here, super annoying:
clear_thinking_20251015strategy requiresthinkingto be enabled`Where is 2.0.37?
The issue with 'clear_thinking_20251015' still is here. I cannot get the latest with
npm install -g @anthropic-ai/claude-code@latest.Confirming this on v2.0.55, Linux (Ubuntu/Debian).
Impact on workflow:
This bug is causing serious workflow disruption. When compaction fails, Claude Code enters a death spiral of repeated errors until the session becomes completely unusable and
loses all context.
Current workaround:
I have to proactively monitor for compaction errors and
/clearthe session before total failure, timing it after documenting work-in-progress. This means:Configuration:
alwaysThinkingEnabled: truein~/.claude/settings.jsonNote on issue #11533:
This was marked as "fixed in v2.0.37" and closed on Nov 17, but the bug is clearly still present in v2.0.55 (latest version). This appears to be a regression that needs immediate
attention.
This needs to be prioritized - the current state makes Claude Code unreliable for long work sessions.
Update: Bug Isolated to Opus 4.5 (2025-11-29)
Finding: Successfully completed conversation compaction using Sonnet 4.5 without encountering hallucination issues. This confirms the bug is specific to Opus 4.5, not
Sonnet 4.5.
Workaround for Users:
If you encounter conversation compaction hallucinations, switch to Sonnet 4.5:
```bash
claude --model sonnet
Test Results:
This suggests the issue is model-specific and can be avoided by using Sonnet until Opus compaction is fixed.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.