Auto-compact / compaction failed — page 3
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 201–300
Ranked by community engagement (reactions weighted over comments). Listing the top 300 of 379 matches; the statistics above cover all 379.
- [BUG] Opus 4.8 compaction fails with "context window" error at low context usage — Opus 4.7 works in the same conversation
- Feature Request: autoCompactThreshold setting — auto-trigger /compact before context window is full
- [Bug] advisor_tool_result orphaned when /goal (Stop-hook) notice is injected mid-advisor-roundtrip → permanent API 400
- /compact blocked by the same tier gate that caused the overflow, leaving sessions unrecoverable
- [BUG] Automatic Context Compaction Fails After Large Codebase Analysis, Causing Excessive Token Usage
- [Bug] Auto-compact triggered during commit skill causes context limit errors
- Regression: #12311 thinking-block compaction fix (v2.1.156) is incomplete — still reproduces on v2.1.158 with claude-opus-4-8
- [BUG] /model switch to standard context doesn't clear 1M context credits gate — /compact still fails after switching back
- [Bug] Context window exceeding 200k limit with Sonnet-4.6 causes unrecoverable session state
- [Bug] autocompact 调度路径在 v2.1.156 静默失败: 状态栏正确报告阈值但压缩动作不触发
- Auto-compact fails repeatedly, blocks long sessions with substantial in-context state
- [BUG] ECONNRESET on long-lived requests after upgrade to 2.1.139 — downgrade to 2.1.138 fixes it
- [BUG] Auto compact fails silently inside /goal — requires manual Ctrl+C interruption for compaction to trigger
- [BUG] skill-creator run_loop.py: --results-dir stays empty when parent session compacts (no per-iteration flush + lost task handle)
- [BUG] VSCode: Switching to a lighter model mid-session leaves session stuck — misleading error makes recovery non-obvious.
- [Bug] Agent reasoning quality degradation after recent changes and session compaction data loss
- [Bug] Image attachment causes unrecoverable "Could not process image" API 400 loop — context becomes unusable
- [BUG] Context limit blocks ALL operations - even after /clear and system restart
- Feature request: support additionalContext in PreCompact/PostCompact hook output
- PreCompact prompt hooks fail on manual /compact
- Compaction fails with 'Conversation too long' error when context is large
- Feature request: pre-emptive context rotation for long-running agent sessions
- [Bug] Conversation compaction fails silently
- [Feature] Proactive /compact at configurable context threshold to prevent hard "context full" crashes
- [Bug] Compacting failed with no error details
- [Bug] Subagents (Agent tool) hit context limit without auto-compact ever triggering
- Graceful handling when API returns 'Could not process image' - session becomes unrecoverable
- Context limit reached during plan mode causes orphaned work and wasted tokens
- Compaction fails with 400 when conversation contains thinking/redacted_thinking blocks
- [Bug] Context limit reached error triggers prematurely before auto-compact activates
- Adding image mid-turn triggers Context limit reached + compaction failure
- [Bug] Auto-Compact fails with error, requires session reset and context loss
- Claude should proactively warn users before context window fills up
- [BUG] Auto-compact is broken — feature is effectively useless
- Mac app stability regression (2.1.33-2.1.41): request abortions, stream failures, orphaned processes
- Mac App Stability Issues: Request Abortions, Stream Failures, Orphaned Processes (v2.1.33-2.1.41)
- [BUG] VS Code extension — context limit error (400) when auto-compaction fails to trigger
- [Bug] Manual compaction fails with "Conversation too long" error when auto-compact enabled
- [Bug] Compact command fails reliably on long conversations, breaks context management workflow
- [Bug] Auto-compact fails with "Conversation too long" error in CLI, loses context despite successful compaction command
- [BUG] Context limit reached · /compact or /clear — forced at ~85% with autoCompact: false (Opus 4.6, v2.1.39)
- Read tool can overflow context window, making autocompact unrecoverable
- Auto-compact errors when model overridden to claude-opus-4-6 on stable channel (2.1.25)
- Compaction fails when trying to modify thinking blocks in latest assistant message
- Deadlock: context limit reached but /compact and rewind both fail with 'Conversation too long'
- [Bug] Context compaction fails in fresh sessions despite available token budget
- Conversation resume fails after context compaction with extended thinking (Opus 4.5)
- [BUG] [claude.ai] Compaction fails silently on web/desktop/mobile — related to #16349
- [BUG] /compact Command Causes Session Corruption
- /compact fails with 500 Internal Server Error after reading large PDF
- [BUG] Failed to generate conversation summary - response did not contain valid text content
- Task tool subagents fail with 'Tool names must be unique' when MCP servers configured (v2.1.5)
- /compact and auto-compact fail with 500 Internal Server Error on Opus 4.5
- Feature Proposal: Agent Continuity - Persistent Agents Across Session Boundaries
- [BUG] Claude Code on Windows 10 via WSL --> Automatic compacting not functioning correctly. Manual compacting fails as well - user needs to manually restart Claude Code and then resume work.
- Context compaction race condition with multiple parallel async agents
- [Bug] Compaction fails with "Conversation too long" error
- Auto-compaction race condition on fast machines - context grows faster than compaction triggers
- [Bug] Conversation Compaction Failure Blocking Continuation
- [Bug] `/compact` command fails to compact conversation history
- [Bug] Auto-Compact fails with "go a few messages up" error instead of compacting
- [Bug] Compaction fails with "Conversation too long" error despite available context
- [Bug] Chat Compaction Fails with Error
- [BUG] "Tool names must be unique" error after MCP server reconnection via /mcp
- [Bug] Compacting fails with repeated errors on Windows
- [Bug] Compaction fails with unclear error state
- [Bug] Anthropic API Error: Duplicate tool names during compaction
- [BUG] Error: Error during compaction: Error: Failed to generate conversation summary - response did not contain valid text content
- [Bug] Auto-compact fails with "conversation too long" error in multi-agent workflows
- [FEATURE] Add programmatic context recovery for noninteractive mode when single tool call exceeds context limit
- [Bug] Auto-compact fails with parallel agents causing conversation overflow
- [Bug] Anthropic API Error 400: Compact Command Failed
- [Bug] Session compaction loses context priority and critical blockers
- [Bug] Auto-Compact loops indefinitely without processing tasks
- [Bug] Unclear compaction behavior or missing compaction functionality
- [Bug] Compact fails with "Conversation too long" error on large chat histories
- [Bug] Auto-Compact fails when context shared with sub-agents reaches 0%
- [Bug] Compact command fails to resolve context length errors, causing context loss
- Compaction triggers too late when calling multiple agents - causes context overflow
- [BUG] /compact command fails with empty summary from API
- [Bug] Compaction fails when conversation exceeds maximum length
- [Bug] Compact command fails with "Conversation too long" error despite sufficient context window available
- [Bug] Compaction fails with "Conversation too long" error
- [Bug] Compact Command Fails at 50% Memory Utilization
- [Bug] Context Management Failure: Auto-Compact Not Triggering Properly
- [Bug] Compaction Fails When Free Context Space Depleted Despite Autocompact Buffer
- [Bug] Compaction Fails with "Conversation Too Long" Error When Multiple Sessions Active
- [Bug] Context Compaction Fails: Conversation Length Limit Exceeded
- [Bug] Compact Command Fails with "Conversation Too Long" Error
- [Bug] Compaction Fails Despite Token Limit Being Below Maximum
- [Bug] Context Compaction Failure: Unable to Compact Conversation
- [Bug] Manual Compact Command Fails Due to Conversation Length Restrictions
- [Bug] /compact fails with "Conversation too long" error despite low context usage
- [Bug] Autocompact Fails to Trigger with Potential Model Name Parsing Issue
- [Bug] Compact Command Hangs or Fails to Initiate
- [Bug] Compaction Failure: Conversation Length Exceeded Limit
- [Bug] Compact Command Fails: Conversation Length Limit Exceeded
- [Bug] Context Compaction Fails When Conversation Exceeds Maximum Length
- [Bug] Conversation Compaction Fails: Unable to Trim Older Messages
- [Bug] Compaction Fails: Conversation Too Long Error