Compaction hangs indefinitely — session completely frozen, requires terminal kill

Resolved 💬 3 comments Opened Apr 24, 2026 by nixpt Closed May 28, 2026

Version: 2.1.119 (Claude Code)
OS: Linux (CachyOS, kernel 7.0.0-1-cachyos)

Description

When context compaction triggers — either automatically (auto-compact) or manually via /compact — Claude Code freezes completely and never recovers. The UI shows no progress and accepts no input. Ctrl+C has no effect. The only recovery is to kill the terminal process and restart the session, losing all session state.

Frequency

Happened multiple times in a single day across different sessions, including shorter sessions (not just long/heavy ones).

Steps to reproduce

  1. Start a session (length does not need to be extreme)
  2. Either wait for auto-compaction to trigger, or run /compact manually
  3. Session freezes — spinner or blank state, no output, no response to any input
  4. Ctrl+C unresponsive — terminal must be killed externally

Expected behavior

Compaction completes (or times out with an error) and the session resumes.

Actual behavior

Indefinite hang. No timeout, no error, no recovery path short of killing the terminal.

Workaround

Set "autoCompact": false in ~/.claude/settings.json and avoid /compact.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗