Auto-compact / compaction failed — page 2
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 101–200
Ranked by community engagement (reactions weighted over comments). Listing the top 300 of 379 matches; the statistics above cover all 379.
- BUG: /compact command always fails with 'Conversation too long' error
- [Bug] /compact fails intermittently with "context too long" error
- Auto-compaction stopped working - conversation fails when manually compacting
- [Bug] Compaction Failure: Conversation Length Exceeded Limit
- /context reports incorrect context window ceiling (200k) when actual session window is 1M
- [Bug] v2.1.121: Opus 4.7 (1M context) max-effort window silently self-downgrades to Sonnet 4.6 mid-session AND /compact does not fire at context limit
- CLI hooks: process CWD drifts away from project root mid-session, causing bare-relative hook commands to resolve against the wrong directory (Windows, 2.1.113)
- Feature Request: /compact --keep-recent — Compress beginning, keep end of conversation
- [SYS-002] Agent --resume ignores MEMORY.md: complete context loss on session resume, decision instability, destroyed live test
- [BUG] Context corruption: auto-memory/compaction causes previous conversation content to be mixed or truncated
- [BUG] Dropping image triggers compact error — double-ESC revert loses context and code
- [BUG] "Error compacting conversation" causes Session Freeze (cannot save work or context)
- [BUG] Compaction is failing due to API returning invalid content
- Cannot resume session when context exceeds limit - no way to compact before loading
- [Bug] Auto-Compact failed to trigger
- Compaction Failure: Conversation Length Exceeds Maximum Limit
- PostCompact hook silent-miss and forced compaction detection failure on Windows 11 / git BASH
- [Bug] TodoWrite reminders degrade context retrieval in long sessions; no disable option
- [Bug] Auto-compact fails mid-session during refactor operations
- Use compact output flags for common Bash commands to reduce token consumption
- [Bug] Compaction fails with multiple sub-agents
- [Bug] Compact command fails with "Conversation too long" error
- [Bug] Compaction Failure: Conversation Exceeds Token Limit
- [Bug] Context Window Compaction Fails Before Reaching 0% Remaining
- [Bug] Context Window Overflow Despite Reported Available Space
- Auto-Compact Summary Causing Infinite Context Consumption Loop
- After Compact Action, Fails all Modify Code, Performs Simulation Only
- [BUG] Compact failed even having 26% context.
- "Unexpected Compaction Prompt and Compaction Failure"
- [BUG] Image paste without text creates empty text block; API rejects every subsequent request with 400
- Compaction irreversibly discards context when summary API call fails
- [Bug] Auto-Compact loops continuously in v2.1.89
- [DOCS] Context window docs missing auto-compaction circuit breaker behavior (stops after 3 failures)
- Critical regression: v2.1.33+ premature compaction cascade makes Claude Code unusable on Windows
- [BUG] /compact command fails at 0% context remaining
- Context window blowouts started with v2.1.32 — sessions die mid-task with no recovery
- [Bug] Context limit exhaustion within ~10 minutes on Opus 4.6, /compact fails when triggered
- [BUG] Session files grow exponentially due to progress events including full normalizedMessages context
- Claude Code hangs indefinitely during context compaction
- [Bug] Auto-Compact fails with "Conversation too long" error repeatedly
- [Bug] Dialog compaction causes extended freeze with excessive token consumption
- [Bug] Context compaction fails with 4+ parallel agents due to low context blocking
- [Bug] Compaction fails with "Conversation too long" error instead of auto-compacting
- [Bug] Anthropic API Error: Duplicate tool names causing compaction failure
- [Bug] Auto-compact fails when conversation exceeds context limit, blocking manual compaction
- [Bug] Context compaction fails in infinite loop, forcing restart on backtrack
- [Bug] Compaction Failure: Conversation Exceeds Context Limit
- [Bug] /compact fails with "Conversation too long" error
- [Bug] Manual /compact fails with "Conversation too long" error
- Context Limit Exceeded: Compaction Failure Causing Data Loss
- Compact Command Execution Failure After Plan Cancellation
- Compaction Failure: Context Limit Exceeded During Retry
- Status line not refreshed after `/compact` slash command
- [BUG] Session becomes unrecoverable after interrupted tool call - /clear and /compact also fail
- [Bug] Compaction fails intermittently with extra usage requirement error
- Session corruption: highlight.js internals leak into session data on compaction crash
- Claude Code sometimes skips reading CLAUDE.md at session start
- PDF documents silently inflate context past long-context threshold, causing unrecoverable 'Rate limit reached' with no actionable error
- [BUG] SessionStart hook with 'compact' matcher: executes successfully but additionalContext not injected
- Compaction death spiral in Cowork: 6 compactions in 3.5min due to system context consuming 86.5% of window
- [BUG] Claude Does Not Follow Prompts Through Completion since 2.1.x update
- [BUG] Error: Error during compaction: Error: Failed to generate conversation summary - response did not contain valid text content
- [FEATURE] Add OnCompactFailed hook for graceful failure handling
- [BUG] Auto-compact not accounting for web search results
- [BUG] If model is globally configured to Opus and limit is hit, websearch and compaction will fail
- [BUG] /compact fails when context ~90% full due to max_tokens not being accounted for
- [Bug] Compact Command Fails with 413 Request Too Large Error
- Conversation Compaction Failure: Summary Generation Error
- [BUG] Gateway provider discards the refresh token and has no refresh-token grant, so every renewal is a full device-code re-grant
- Auto-compaction drops PreToolUse read-state, causing infinite re-read loop on multi-file edits
- [BUG] Preventive auto-compact and blocking-limit warning silently disabled for most recent models; desktop-app resume disarms all 1M-context sessions
- Context limit UX failure: No progressive warnings, misleading error messages, cascade failure in compaction
- Auto-compaction deletes main session JSONL before verifying summary completion, causing data loss
- 400 role 'system' is not supported — client builds malformed request after large, twice-compacted session (unrecoverable in-place)
- C:/Program Files/Git/compact leaves session in inconsistent state when it fails mid-execution (e.g. rate limit)
- [BUG] Image upload in cloud environment poisons session — all subsequent API calls return 400, /compact cannot recover
- Compaction fails: max_tokens must be greater than thinking.budget_tokens
- [BUG] Claude Compaction Completely Broken for Opus
- [BUG] Auto-compact fails when 200K standard context is exhausted — compaction API requires extended context
- [BUG] PreCompact hook exit code 2 does not block compaction
- [BUG] `/compact` fails with API 400 when session history contains unrecognized `server_tool_use` name
- /compact fails with 'Conversation too long' when context limit is reached during multi-agent workflow
- [Bug] Memory compaction fails with errors
- [Bug] Auto-Compact fails with multiple subagents at token limit
- [BUG] Context window freeze before auto-compaction triggers (Claude Sonnet 4.6, Cursor)
- Large paste in long-context session causes unrecoverable TUI freeze
- /compact fails with 'Conversation too long' at 25% context usage
- [BUG] Tool invocation failure for MCP tools post-compaction patch (Jan 27) — silent backend block on claude.ai
- Compaction fails on sessions with pasted screenshots (base64 images)
- [Bug] Anthropic API Error: Duplicate tool names in compaction request
- [Bug] Message Compaction Fails with Multiple Agents
- [Bug] Compact Operation Fails Due to Anthropic API Context Window Limit
- [BUG] Auto-compact not triggering with AWS Bedrock backend
- Compact Command Fails to Run With Instruction
- [BUG] semi-daily bug report
- [BUG] /compact Fails on Resumed Near-Full Context Conversations Regardless of History Depth
- /compact silently fails to apply on very large conversations: summary generated, boundary never written, context unchanged
- Transcript JSONL corruption; records spliced by unsynchronized writers
- Fable 5 proposes identity sed substitution inside re-verification step, preserving success string without changing pass condition
- 1M-context session becomes unrecoverable: ECONNRESET on large uncached requests, and /compact fails with the same error