Desktop: 'Clear' in background tasks panel can cancel a running task that arrives mid-click (click race)

Open 💬 0 comments Opened Jul 11, 2026 by kenmulford

What happened

In Claude Code Desktop, I clicked "Clear" on the background tasks side panel at the same moment the assistant spawned a new background task. The list mutated under my pointer mid-click and the click landed on the just-created RUNNING task, cancelling it. The agent had to be re-dispatched from scratch.

Why this matters

During active multi-agent orchestration the background tasks panel mutates frequently. Any destructive control whose click target can shift at arrival time will eventually eat a running task. The cost is not just the click: the cancelled agent loses all in-flight work and the session has to pay a full re-dispatch.

Expected behavior

Some combination of:

  1. "Clear" only removes completed/stopped items and never cancels a running task.
  2. If clearing would stop a running task, require an explicit confirmation.
  3. Stabilize the list against reflow while the pointer is down (or apply a short click-guard after a list mutation), so newly-arriving items cannot steal an in-flight click.

Environment

  • Claude Code Desktop, macOS (Darwin 25.5.0)
  • Repro is a race: spawn a background agent while the user is clicking Clear in the side panel. Intermittent by nature.

---

Filed from a live session; written up by Claude (Fable 5) on Ken's behalf, per his request.

View original on GitHub ↗