Ctrl-C silently kills background agents with no confirmation, and user-stopped agents cannot be resumed (accidental keystroke = unrecoverable token loss)

Status Open
Reported on v2.1.220
Maintainer reply None cached
Activity 0 comments · opened Jul 25, 2026

Summary

Ctrl-C pressed with the intent of clearing the input field instead killed a long-running background agent mid-task, and the stopped agent could not be resumed afterward — despite its transcript existing on disk. The accidental keystroke cost roughly $20 of tokens on a Max ($200/mo) plan with no confirmation and no undo.

What happened

  1. A background agent (spawned via the Agent tool) was ~mid-way through a long C++ integration task.
  2. User pressed Ctrl-C at the prompt, expecting the near-universal text-input behavior (clear the line / cancel the pending input).
  3. The interrupt stopped the background agent.
  4. An attempt to resume the agent (SendMessage to its agent id) was refused by the harness: "Agent was stopped by the user and was not resumed. Treat its work as cancelled; only start a new agent for it if the user explicitly asks."
  5. The only recovery was launching a new agent, instructed to inventory git status/git diff and continue from the killed agent's on-disk writes — its conversational context (a large fraction of the spend) was unrecoverable.

Expected

Some combination of:

  • Ctrl-C on a prompt with running background agents should not silently kill them — at minimum a confirmation ("N background agents running — press again to stop them"), consistent with how many CLIs guard destructive interrupts.
  • A stopped agent should be resumable. The transcript exists on disk, and completed agents already resume cleanly via a follow-up message — the asymmetry (completed = resumable, user-stopped = permanently dead) turns an accidental keystroke into an unrecoverable, billable loss.
  • Alternatively: an undo window after a stop, or a rebindable interrupt key.

Why it matters

The current behavior converts common terminal muscle memory into direct monetary loss with no guardrail and no recovery path. At Max-plan pricing the trust cost is larger than the token cost.

Environment

  • Claude Code CLI 2.1.220, macOS (darwin arm64)
  • Background agent spawned via the Agent tool, killed via Ctrl-C at the main prompt, resume refused via SendMessage

View original on GitHub ↗