🐞 Critical Bug Report: Claude Code Unusable Due to Compaction Lockups & tool_use 400 Crashes
Environment
❗ Summary
Claude Code is currently unusable for long-form or agent-based work due to two severe, session-breaking bugs:
🚫 1. Compaction Lockup (Unrecoverable Timeout)
-
When sessions exceed ~2,400 tokens, Claude triggers automatic compaction.
-
This process retries up to 10 times with:
API Error (Request timed out.) · Retrying in X seconds… (attempt 1/10 to 10/10)
-
After the 10th retry, the session completely freezes.
-
Manually clearing the session results in:
404: conversation not found
-
All progress is lost. The user must restart the conversation from scratch, breaking all continuity and flow.
❌ 2. tool_use → tool_result Desync (400 Error Crash)
-
In active coding sessions, Claude may invoke a tool:
tool_use: toolu_01RF5sCUUx9nbB3zCTHNqvCm
-
This fails with a 400 invalid_request_error:
"messages.135: `tool_use` ids were found without `tool_result` blocks immediately after"
-
Once this error occurs, the session is permanently broken. Claude cannot continue, and user interaction is blocked.
-
The only solution is to clear and restart the entire session, losing all context and history.
Steps to Reproduce
Compaction Issue:
- Start session and interact until token count ~2,400
- Wait for auto-compaction
- Observe retry loop (10 attempts)
- Session becomes unresponsive
- Clearing shows 404, session dead
tool_use Error:
- Claude triggers a tool (e.g., from UI interaction)
- Fails to follow with
tool_result
- CLI returns 400 error
- Session must be cleared and restarted
Expected Behavior
- Compaction should run smoothly or recover gracefully
- Every
tool_use must be immediately followed by a tool_result
- Session context must be preserved — crashes should never require wiping everything
Actual Behavior
- Compaction stalls → session freezes → unrecoverable 404
tool_use desyncs → 400 error → session permanently crashes
- Both require full restart, breaking continuity
- Makes Claude Code impossible to use for sustained or structured development
Severity
🔥 Critical — Full Session Loss
These bugs completely prevent serious usage. They:
- Break long sessions
- Block agent workflows
- Destroy continuity
- Force manual restarts multiple times per day
🐞 Critical Bug Report: Claude Code Unusable Due to Compaction Lockups &
tool_use400 CrashesEnvironment
Platform:
Claude CLI version:
OS: Windows 11 (via WSL)
Terminal: VS Code Integrated Terminal
❗ Summary
Claude Code is currently unusable for long-form or agent-based work due to two severe, session-breaking bugs:
🚫 1. Compaction Lockup (Unrecoverable Timeout)
When sessions exceed ~2,400 tokens, Claude triggers automatic compaction.
This process retries up to 10 times with:
After the 10th retry, the session completely freezes.
Manually clearing the session results in:
All progress is lost. The user must restart the conversation from scratch, breaking all continuity and flow.
❌ 2.
tool_use→tool_resultDesync (400 Error Crash)In active coding sessions, Claude may invoke a tool:
This fails with a 400 invalid_request_error:
Once this error occurs, the session is permanently broken. Claude cannot continue, and user interaction is blocked.
The only solution is to clear and restart the entire session, losing all context and history.
Steps to Reproduce
Compaction Issue:
tool_useError:tool_resultExpected Behavior
tool_usemust be immediately followed by atool_resultActual Behavior
tool_usedesyncs → 400 error → session permanently crashesSeverity
🔥 Critical — Full Session Loss
These bugs completely prevent serious usage. They: