No way to interrupt a multi-step turn to /compact before context exhaustion
Problem
During a lengthy multi-step turn — where Claude is chaining multiple tool calls (agents, file reads, edits, bash commands) — the user has no way to intervene. The TUI does not accept input until Claude finishes its entire turn. If the user can see context usage climbing toward the limit, they cannot type /compact or any other command to prevent context exhaustion.
By the time the turn completes (if it completes at all), the context is already at or past the limit, triggering the forced "Context limit reached" message. The entire flow is ruined: task state, reasoning chain, and progress are lost or degraded by an emergency auto-compact that happens at the worst possible moment.
Steps to Reproduce
- Start a task that requires many sequential tool calls in a single turn (e.g., exploring a large codebase, running multiple agents, multi-file refactor)
- Observe context usage climbing in the status bar
- Attempt to type
/compactwhile Claude is mid-turn - Expected: User can interrupt/queue a
/compactthat executes before the next tool call - Actual: Input is completely blocked. No intervention is possible. Context hits the limit and the session degrades or halts
Why This Is Distinct From Existing Issues
- #24220 — Specific to background task polling ignoring
/compactafter user types it. The user can type but it gets ignored. - #19877 — Requests Claude-invocable
/compactfor automated workflows. Solves the programmatic case but not the interactive one. - This issue — The user cannot type anything during a multi-step turn. The input mechanism itself is blocked. This is the most fundamental version of the problem.
Impact
- Complete loss of control during the most context-intensive operations (the exact moments when
/compactis most needed) - Wasted cost — the session burns through context with no escape valve
- Broken workflows — complex multi-step tasks are the primary use case for Claude Code, yet these are the exact scenarios where context management is impossible
- Forces defensive behavior — users learn to break work into artificially small requests to maintain control, defeating the purpose of an agentic tool
Proposed Solutions (non-exclusive)
- Interrupt queue — Allow the user to type
/compact(or press a hotkey) at any time. The command queues and executes between tool calls within the current turn, before the next tool invocation. - Hotkey interrupt — A dedicated key (e.g.,
Ctrl+Shift+Cor similar) that signals "compact now" regardless of turn state. - Pre-emptive auto-compact at turn boundaries — When context usage exceeds a threshold (e.g., 80%), automatically compact between tool calls within a turn, not just between turns.
- Visible context meter with interrupt affordance — The status bar already shows context usage. Add an actionable element: when context is high, offer a one-key interrupt to compact.
Environment
- Platform: Windows 11, also reproducible on macOS (based on related reports)
- Claude Code: latest
- Model: Opus 4.6
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗