Skip to content

No way to interrupt a multi-step turn to /compact before context exhaustion #25815

Description

@syd-ppt

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

  1. 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)
  2. Observe context usage climbing in the status bar
  3. Attempt to type /compact while Claude is mid-turn
  4. Expected: User can interrupt/queue a /compact that executes before the next tool call
  5. 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

Impact

  • Complete loss of control during the most context-intensive operations (the exact moments when /compact is 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)

  1. 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.
  2. Hotkey interrupt — A dedicated key (e.g., Ctrl+Shift+C or similar) that signals "compact now" regardless of turn state.
  3. 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.
  4. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions