This guide addresses issues with Claude Code getting stuck during the "Compacting conversation" phase, particularly in unattended or cron job environments. It explains that compaction can fail due to large contexts, API timeouts, or retry watchdog settings. The article suggests implementing wall-clock timeouts and using pre/post-compact hooks to manage these long-running tasks, recommending a fresh session with a short handoff if compaction stalls. It also details common causes for compaction failures, such as summaries not fitting, lengthy retries, or thrashing loops, and advises on updating the tool version if using older releases. AI
IMPACT Provides technical guidance for users of Claude Code to manage and troubleshoot a specific operational issue.
RANK_REASON The article provides a technical guide and troubleshooting steps for a specific feature of the Claude Code tool.
Read on dev.to — Claude Code tag →
- API_TIMEOUT_MS
- Claude Code
- CLAUDE_CODE_RETRY_WATCHDOG
- CLAUDE_CODE_RETRY_WATCHDOG_MAX_WAIT_MS
- GitHub issue #6004
- Issue #23751
AI-generated summary · Google Gemini · from 1 sources. How we write summaries →