[BUG] Agents continue working after multiple interruptions and /clears

Resolved 💬 2 comments Opened Feb 16, 2026 by OG-Drizzles Closed Feb 16, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

Version: 2.1.42
Login method: Claude Max Account
Model: Default Opus 4.6 · Most capable for complex work
MCP servers: trello ✔
Memory: project (CLAUDE.md)
Setting sources: User settings, Project local settings

Background agents launched via Task tool with run_in_background: true survive multiple user interrupts (Escape), /clear commands, and manual kills via the task
manager UI (k key). The main agent resurrects and delivers output long after the user has explicitly stopped all work.

### Sequence of events:

  1. Claude (Opus 4.6) launched 3 background investigation agents via Task with run_in_background: true
  2. I interrupted the main agent (Escape) and ran /clear
  3. The 3 background agents were still visibly running in the task manager — I navigated to each (arrow down) and killed them with k
  4. Status bar confirmed no background processes remaining
  5. Despite this, the main agent resurrected and stopped responding to Escape — I had to type "Claude stop" and "stop" as text input to get it to acknowledge
  6. I ran /clear a second time
  7. ~30 seconds later, a full multi-page response appeared in the terminal as if Claude was actively responding — with zero indication anything was still running

### Key details:

  • The k kill in task manager did not actually terminate the agents (or something downstream survived)
  • The main agent became unresponsive to Escape after resurrecting
  • The status bar showed no background work, but execution was clearly still happening
  • Two /clear commands, multiple Escape presses, manual k kills, and typed "stop" commands were all insufficient to halt execution

What Should Happen?

What Should Happen?

  1. k in the task manager should hard-kill background agents — confirmed dead, no further output
  2. /clear should be a hard reset — kill all in-flight agents (foreground and background) and suppress any pending output
  3. Escape should always remain responsive — the main agent should never enter a state where Escape stops working
  4. No output should surface after /clear — if agents were killed or conversation was cleared, their results should be discarded, not queued for delivery
  5. The status bar should be accurate — if it shows no background processes, nothing should be running

Error Messages/Logs

Error Messages/Logs

  No error messages or stack traces. The issue is behavioral — agents silently continued
  executing and delivered output after being killed and after the conversation was cleared.
  No logs were captured as the output appeared unexpectedly after /clear with no prior
  indication of ongoing work.

Steps to Reproduce

Steps to Reproduce

  1. Start a Claude Code session with a codebase available for investigation
  2. Give Claude a task that causes it to launch multiple background agents

(e.g., "investigate these 12 findings in the codebase" — Claude will
typically parallelize with 3+ background Task agents using
run_in_background: true)

  1. Wait for background agents to appear in the task manager (visible via

arrow-down or status bar)

  1. Press Escape to interrupt the main agent
  2. Run /clear
  3. Navigate to each background agent in the task manager and press k to kill
  4. Confirm status bar shows no background processes
  5. Wait 30-60 seconds

Expected: Nothing happens. Session is clean.
Actual: The main agent resurrects and delivers a full response. Escape
may stop working. A second /clear may also fail to prevent output delivery.

Note: Reproduction may depend on timing — the agents need to be mid-execution
(not yet complete) when killed. Longer-running investigations (reading many
files) are more likely to trigger this.

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

Claude Code Version: 2.1.42

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

Other

Additional Information

---
Additional Information

  • MCP servers active at time of issue: trello
  • The background agents were Explore-type subagents performing codebase

searches (Glob, Grep, Read operations across multiple files)

  • The final output that surfaced after the second /clear was a complete,

well-formatted multi-page report — suggesting the agent ran to full
completion despite being "killed"

  • This suggests the kill signal either didn't propagate to the underlying

process, or the output was already buffered/queued and delivered regardless
of conversation state

View original on GitHub ↗

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