Auto-compact / compaction failed
The conversation-compaction step errored or looped instead of shrinking context.
379 issues · 31 open · 348 resolved (92%) · first seen Mar 6, 2025
First response · account
What to do now
Most likely: Authentication, usage state or session size blocked the request.
- Check the exact account, organization and usage window currently selected.
- Try a new short session before deleting credentials or local history.
- If the state is inconsistent across machines, preserve diagnostics and re-authenticate once.
These are conservative triage steps, not an official Anthropic fix. Use the issue and workaround evidence below before making a destructive configuration change.
Is this getting better or worse?
This class of problem is converging. 52 new reports in the last 90 days vs 75 in the 90 before — -31%. The open backlog peaked at 49 in 2025-10 and sits at 31 today.
Derived by counting each matching issue from its creation date until it closed. First-party
computation over the anthropics/claude-code tracker — the trend is not published
anywhere upstream.
Which builds report this
150 of these reports name the Claude Code build they were running, spanning 83 releases. Heaviest reporters:
- Claude Code v2.0.76
- Claude Code v2.1.42
- Claude Code v2.1.39
- Claude Code v2.1.220
- Claude Code v2.1.7
- Claude Code v2.1.158
- Claude Code v2.1.156
- Claude Code v2.1.29
Report volume, not a defect count: an issue can mention a build without that build having caused the failure. Versions come from the version string in the bug-report template, matched against real published tags.
Do these get fixed?
Median time to close is 18 days across 348 closures. Of the 348 closures with a recorded reason, 18% were closed as completed and 285 as not-planned or duplicate. The most recent completed fix landed in 2026-08.
Workarounds reported by the community
98 of these issues post a workaround someone says worked. The highest-engagement ones:
- [BUG] Error during compaction
- +1 a workaround is to copy the conversation and remove all the pasted user messages manually, then paste it into a new session
Found in the thread of #7530 · resolved - [BUG] Conversation compaction intermittently corrupts conversation state: “Compaction failed unexpectedly” and silent prompt submission failures
- …h still persists at the time of writing this. One temporary workaround is to create a new chat within the same project, and to tell Claude to reference the other chat, while continuing in the new one. Of course, the new…
Found in the thread of #18482 · resolved - [BUG] Error: Error during compaction: API Error: Usage credits required for 1M context · turn on usage credits at claude.ai/settings/usage, or use --model to switch to standard context
- …runs /clear. This is a new behavior as of a day or so ago. Workaround Running /clear restores the session. The error message suggests using --model to switch to standard context, but this requires hardcoding a model nam…
Found in the description of #63896 · still open - /compact fails with 'Conversation too long' when context limit is reached
- …is full, but it fails precisely in that situation. The only workaround is , which destroys all session context including task progress. This happens consistently across sessions and projects. Additional Context The "Pres…
Found in the description of #23047 · resolved - Both /compact command and auto-compaction broken - 'conversation too long' error
- …firms auto-compaction is also broken , making the suggested workaround ineffective. Impact Without working compaction (manual or automatic), users must manually manage sessions by starting new ones, losing conversation c…
Found in the description of #18211 · resolved
Excerpts are quoted from the linked issue so you can judge relevance before opening it. Threads that only ask for a workaround, or report that there is none, are excluded. These are community suggestions, not official guidance from Anthropic — read the full thread before applying one.
Matching issues 1–100
Ranked by community engagement (reactions weighted over comments). Listing the top 300 of 379 matches; the statistics above cover all 379.
- [BUG] Error during compaction
- [BUG] Conversation compaction intermittently corrupts conversation state: “Compaction failed unexpectedly” and silent prompt submission failures
- [BUG] Error: Error during compaction: API Error: Usage credits required for 1M context · turn on usage credits at claude.ai/settings/usage, or use --model to switch to standard context
- /compact fails with 'Conversation too long' when context limit is reached
- Both /compact command and auto-compaction broken - 'conversation too long' error
- [BUG] Conversation compaction intermittently fails or deadlocks chats (claude.ai web/mobile, post–Jan 15 regression)
- [BUG] Compact Conversation Infinite Loop
- [Bug] /compact and auto-compact fail with 'Tool names must be unique' when MCP servers are configured
- Context low warning and /compact failure despite having 86% free context space
- Compaction fails with 'Conversation too long' at 48% context usage (Opus 4.6)
- Compaction Failure: Conversation Length Exceeds Limit
- Auto-compact fails with Opus 4.5 extended thinking blocks
- Session permanently stuck on 'Rate limit reached' after transient rate limit
- [Bug] Manual Compaction Fails with "Conversation Too Long" Error
- [Bug] Compaction Fails Unexpectedly with "Conversation Too Long" Error
- [Bug] /compact fails with "Tool names must be unique" even after disabling all MCP servers (v2.0.70)
- "Infinite Auto-Compact Loop Causing Performance Degradation"
- [BUG] Session becomes completely unrecoverable due to thinking block API error
- [BUG] /compact fails with cyber safeguards false positive during legitimate defensive security session
- /compact command fails with 'Conversation too long' error at 82% token capacity
- [BUG] /compact always fails with "Conversation too long" since v2.1.23 (regression)
- [Bug] Compact Fails When Context Window Nearly Full, Requires Restart
- Compaction Failure: Conversation Length Exceeds Processing Limit
- Image processing failure silently passes oversized images into context, bricking sessions
- Context compaction fails with 'Conversation too long' when context limit is reached
- Cascading failure: auto-compaction, /compact, and rewind all fail at context limit — requires Ctrl+C to escape
- [Bug] /compact fails with "Usage credits required for 1M context" even after /model set to Sonnet 4.6
- /login shows "Login successful" but immediately reverts to "Not logged in"
- [Bug] Auto-Compact Fails Due to Conversation Length Limit
- [BUG] [`Critical`] Compact issue block the normal use of Claude code
- /compact fails, only auto-compact works.
- Compaction fails with 400 error when thinking blocks present in assistant message
- Conversation Compaction Failure: Unexpected Error When Attempting to Reduce Context Length
- [Bug] Compaction fails with "Conversation too long" error, leaving session unrecoverable
- Auto-compact should trigger earlier / threshold should be configurable
- /compact fails with 'tools: Tool names must be unique' error
- [BUG] Autocompacting Loop Causing Massive Token Usage Spikes OCT 15 2025
- Context hit 1M token limit with no auto-compaction and no recovery path
- [BUG] High Token Burn Due to Redundant Context Resubmission & Compaction Loops
- Premature "Context limit reached" at ~51% when submitting image during active processing
- [BUG] CRITICAL: Account-Specific Auto-Compact Corruption - Complete Service Loss for Max Plan Subscribers
- Compact Summary Generation Failure in Conversation Summarization
- TaskOutput burst polling causes unrecoverable 'Prompt is too long' when multiple background agents complete simultaneously
- Auto Compaction Failure in SDK Mode with JSON Streaming Conversation Continuation
- [BUG] Compact failed meaning that there was no way to continue the current session
- [BUG] Compacting throws an error
- [BUG] API issue: `thinking` or `redacted_thinking` blocks in the latest assistant message cannot be modified. These blocks must remain as they were in the original response."
- [Bug] Compacting Fails Repeatedly with Incorrect "Conversation Too Long" Error
- CRITICAL BUG: Claude Code Infinite Auto-Compact Loop - Service Non-Functional
- Prompt too long error persists when compact command fails despite CLAUDE_AUTOCOMPACT_PCT_OVERRIDE=60
- [BUG] VSCode extension stores user messages as per-character content blocks, causing premature 'Prompt is too long'
- [Bug] Context limit reached at 21% usage after 11-minute extended thinking — /compact also fails
- Context Limit Reached error should auto-compact and queue user message instead of failing
- /compact fails with 'Conversation too long' error
- [Bug] Compaction fails with "Conversation too long" error when context limit reached
- [Bug] Thinking mode toggle state not persisted between sessions
- Auto-compact fails to trigger on Sonnet 4.6, session grows past 200K limit and becomes unrecoverable
- Critical: Conversation compaction fails for conversations started under previous Claude Code versions
- [PROPOSAL] Golang Rewrite to Address Critical Memory Usage (1.5-2GB per session)
- [BUG] 'Update' tool on a large file loads the entire file into context exceeding the compactable amount causing the chat to become irrecoverable.
- Auto-compaction plateaus near ~75% context usage on Sonnet 5 (v2.1.201), causing repeated compact/work loop
- Context compaction recovery loses critical behavioral rules (session status block, memory writes, no-stop policy)
- Auto-compact fails on Opus 4.6 [1m]: session dies at 100% context (regression since ~2.1.172)
- Regression in 2.1.150-2.1.158: malformed tool_use blocks not parseable, retry-resistant
- /compact fails with 'Conversation too long' when context is nearly full
- InboxPoller delivers queued messages without context budget check, causing unrecoverable context overflow
- [Bug] Compaction fails with "Conversation too long" error repeatedly
- Compaction fails with 'Conversation too long' due to identical warning/error thresholds
- [Bug] Context limit reached: Cannot compact, operation fails
- [Bug] Compact Command Fails with "Conversation Too Long" Error
- [BUG] `tool_use` ids were found without `tool_result` blocks after failed cancel
- [BUG] System prompt consumes ~9.3M tokens on every session after installing Claude Desktop on Windows (WSL setup)
- Session resume loads blank — 4.5 MB JSONL file intact, no error, no content
- auto-compaction stopped working = conversation fails when manually compacting
- [BUG] Code tab writes UI render metadata (start_timestamp/stop_timestamp/flags) into transcript JSONL, causing unrecoverable API 400 that recurs after full sanitization
- [BUG] Compaction fails with "context window limit" error even when context usage is low (e.g., 20%) — regression in v2.1.153
- [Bug] Auto-Compact enters infinite loop causing excessive token consumption
- [BUG] Bash tool stdout containing data:image URLs is intercepted as image block, causing unrecoverable API 400 "Could not process image" session corruption
- [BUG] Reaching context limit is not allowing to manual /compact at all
- [Bug] Auto-Compact Failure Leaves Instance in Unrecoverable Context Limit State
- [Bug] Context compaction fails with multiple subagents
- [BUG] Memory leak: Claude process consuming 23GB RAM and 143% CPU after 14 hours of runtime
- [Bug] Compact command fails with "Conversation too long" error
- Explore subagent always fails with "Prompt is too long" when many MCP servers are registered
- /compact and auto-compaction both broken — fails across sessions/models/subscriptions; auto-compact sometimes fires at 30% context; /feedback also fails
- [Bug] Context Compaction fails when agent reaches context limit
- [BUG] Context limit reached - Autocompact spiral background agents return results simultaneously
- Uncontrolled background agent parallelization causes context overflow, session death, and wasted tokens
- /compact fails with "tools: Tool names must be unique" error when using multiple MCP servers (v2.0.70)
- [BUG] Compaction is broken in the CC SDK
- [BUG] Persistent Hook Warning Messages in UI After Issue Resolution
- Oversized image in history permanently blocks session with no client-side recovery
- [Bug] Conversation compactor fails to reduce token usage for extended context
- [BUG] Context limit lockout — @mention agent also fails, session completely unrecoverable
- Auto-compaction can leave zero usable context in long sessions
- Compaction race condition: rate limit during compaction destroys entire conversation transcript
- Proactive context management: topic-aware fork prompts and graceful overflow-to-file recovery
- Autocompact fails to free sufficient space, leaves session stuck at context limit
- [BUG] Session becomes permanently unrecoverable after empty text content block during streaming
- [Feature Request] Enhance /compact with structured context preservation sections