Ctrl+C intended to clear the prompt input killed 6 running background agents (no confirmation)

Status Open
Reported on v2.1.257
Maintainer reply None cached
Activity 1 comment · opened Sep 17, 2026

Summary

With several background agents running (Agent tool, run_in_background / async subagents), pressing Ctrl+C once to clear text I had typed in the prompt did not clear the input — it stopped all six background agents immediately, with no confirmation. The session then reported: "6 background agents were stopped by the user".

Ctrl+C is normally the clear-input key when the prompt has text, so this is a destructive key-binding collision: the same keystroke is "clear my typo" in one state and "kill every agent I have working" in another, and the difference is not visible to the user at the moment they press it.

Impact

Six long-running agents (a P0 incident fix: database migrations, GraphQL resolvers, web UI, CI, observability, connection pooling) were killed mid-work after roughly 40 minutes of parallel effort. Their worktrees survived, but each had to be relaunched with salvage instructions, and unpushed in-flight work had to be recovered by hand. The interruption happened during an active production incident.

Environment

  • Claude Code CLI 2.1.257 (Claude Code) on macOS (Darwin 25.6.0), zsh, interactive terminal
  • Background agents launched via the Agent tool with worktree isolation; one foreground turn in progress (the assistant had just answered a question)
  • Auto mode / permission classifier active

Steps to reproduce

  1. Launch 3+ background agents (e.g. Agent tool, background) so they are running.
  2. While they run, type some text into the prompt input (do not submit).
  3. Press Ctrl+C once, intending to clear the typed text.

Expected

Ctrl+C clears the input buffer (its normal behaviour when the prompt has text). Stopping background agents should require an explicit, discoverable action — a dedicated command, a double Ctrl+C with a visible "press again to stop N agents" prompt, or a confirmation — and should never share a single keystroke with clear-input.

Actual

All running background agents were stopped on the first Ctrl+C. No confirmation, no undo.

Suggested fixes

  • Never bind agent termination to single Ctrl+C while the input buffer is non-empty; clear input first.
  • When background agents are running, require a second Ctrl+C within a short window (with an on-screen warning naming the agent count) or a /stop-agents style command.
  • Offer "resume the stopped agents" after an accidental stop, since their transcripts/worktrees still exist.

Filed on behalf of the account owner at their request.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗