Skip to content

[BUG] Error during compaction: Error: API Error: 400 #11533

Closed

Description

@puravidapos-admin

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • 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

Activity

  1. homains-ou commented on Nov 13, 2025

    @homains-ou

    for now write the word "ultrathink" before your command , that fixes the issue

  2. puravidapos-admin commented on Nov 13, 2025

    @puravidapos-admin
    Author

    for now write the word "ultrathink" before your command , that fixes the issue

    before every command, or just at the time it fails?

  3. mbinde commented on Nov 15, 2025

    @mbinde

    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.

  4. hsellik commented on Nov 15, 2025

    @hsellik

    Had the same error, worked with ultrathink, but seemed weird, updated claude-code via Homebrew and now it works properly.

  5. ngregorich commented on Nov 15, 2025

    @ngregorich

    I ran into a similar issue

    • claude 2.0.42
    • macOS 15.7.1
    • WezTerm 20240203-110809-5046fc22
    1. /clear did not work for me
    2. I didn't try ultrathink
    3. /quit then claude did work for me
  6. Physics-of-Data commented on Nov 16, 2025

    @Physics-of-Data

    ❌️ /clear
    ❌️ /quit
    ❌️ reinstall claude
    ❌️ deleted $HOME/.claude
    ❌️ deleted all custom commands

    /ultrathink seems 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.

  7. 8erya commented on Nov 16, 2025

    @8erya

    I encountered this exact error on 2.0.36. The root cause is a conflict with the clear_thinking_20251015 strategy in older versions.

    Solution

    Update to the latest version (currently 2.0.42):

    npm install -g @anthropic-ai/claude-code@latest

    After updating, /compact works as expected.

    WSL Users

    If claude --version still shows 2.0.36 after updating, you may have multiple installations. Check with:

    which claude

    If it points to /mnt/c/Users/[username]/AppData/Roaming/npm/claude, you have a stale Windows installation taking precedence. Remove it:

    rm /mnt/c/Users/[username]/AppData/Roaming/npm/claude*
    rm -rf /mnt/c/Users/[username]/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code

    Then reinstall on the Linux side:

    npm install -g @anthropic-ai/claude-code@latest

    Can confirm this resolves both the /compact error and the clear_thinking strategy issue.

  8. puravidapos-admin commented on Nov 16, 2025

    @puravidapos-admin
    Author

    I encountered this exact error on 2.0.36. The root cause is a conflict with the clear_thinking_20251015 strategy in older versions.

    Solution

    Update to the latest version (currently 2.0.42):

    npm install -g @anthropic-ai/claude-code@latest
    After updating, /compact works as expected.

    WSL Users

    If claude --version still shows 2.0.36 after updating, you may have multiple installations. Check with:

    which claude
    If it points to /mnt/c/Users/[username]/AppData/Roaming/npm/claude, you have a stale Windows installation taking precedence. Remove it:

    rm /mnt/c/Users/[username]/AppData/Roaming/npm/claude*
    rm -rf /mnt/c/Users/[username]/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code
    Then reinstall on the Linux side:

    npm install -g @anthropic-ai/claude-code@latest
    Can confirm this resolves both the /compact error and the clear_thinking strategy issue.

    No longer an issue for me either after upgrading.

  9. devbeno commented on Nov 17, 2025

    @devbeno

    I ran into a similar issue

    • claude 2.0.42
    • macOS 15.7.1
    • WezTerm 20240203-110809-5046fc22
    1. /clear did not work for me
    2. I didn't try ultrathink
    3. /quit then claude did work for me

    only this solution work

  10. szwang commented on Nov 17, 2025

    @szwang

    Closing as this is fixed as of 2.0.37 — so sorry for the friction here, and thank you for reporting!

  11. grzegorzdrozda-lab commented on Nov 18, 2025

    @grzegorzdrozda-lab

    I just click tab to turn on thinking and now it works

  12. Theshedman commented on Nov 19, 2025

    @Theshedman

    I am having this issue now. Claude version 2.0.46

  13. ericdfields commented on Nov 19, 2025

    @ericdfields

    Same issue and version as @Theshedman

  14. pankajvkulkarni commented on Nov 20, 2025

    @pankajvkulkarni

    ⎿  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)

  15. zeenix commented on Nov 20, 2025

    @zeenix

    Same here as @pankajvkulkarni wrote. It's getting very annoying.

  16. juliankrispel commented on Nov 27, 2025

    @juliankrispel

    Same here, super annoying: clear_thinking_20251015 strategy requires thinking to be enabled`

  17. Physics-of-Data commented on Nov 27, 2025

    @Physics-of-Data

    Closing as this is fixed as of 2.0.37 — so sorry for the friction here, and thank you for reporting!

    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.

  18. cozwoodiov commented on Nov 29, 2025

    @cozwoodiov

    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 /clear the session before total failure, timing it after documenting work-in-progress. This means:

    • Losing conversation context every few hours
    • Interrupting work to document before clearing
    • Restarting conversations from scratch repeatedly
    • Significant productivity loss

    Configuration:

    • alwaysThinkingEnabled: true in ~/.claude/settings.json
    • Extended thinking enabled globally
    • Still experiencing compaction failures

    Note 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.

  19. cozwoodiov commented on Nov 29, 2025

    @cozwoodiov

    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:

    claude --model sonnet
    
    Test Results:
    - ✅ Sonnet 4.5: Conversation context preserved correctly, no fabricated content
    - ❌ Opus 4.5: Hallucinations during compaction (original bug reports)
    
    This suggests the issue is model-specific and can be avoided by using Sonnet until Opus compaction is fixed.
  20. github-actions commented on Dec 7, 2025

    @github-actions

    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.

  21. locked as resolved and limited conversation to collaborators on Dec 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:apiarea:corebugSomething isn't workingduplicateThis issue or pull request already existshas reproHas detailed reproduction stepsmemoryplatform:macosIssue specifically occurs on macOS

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions