Completed subagent shows as "running" in UI indefinitely — stale agent status not cleared

Resolved 💬 2 comments Opened Mar 10, 2026 by palonsorodriguez Closed Mar 10, 2026

Describe the bug

When a subagent (spawned via the Agent tool) completes successfully, the Claude Code UI continues to display it as "running" indefinitely. The agent has genuinely finished — its output is fully written and git commits from its work are confirmed — but the UI status is never updated.

To reproduce

  1. Invoke a workflow that spawns a background subagent via the Agent tool
  2. The subagent completes its work successfully (output file written, task finalized)
  3. Observe: Claude Code UI still shows the agent as "running"
  4. Call TaskList tool — returns empty (no active tasks registered)
  5. There is no way to dismiss or kill the ghost entry from within the UI

Expected behavior

Once a subagent completes (success or failure), the UI status indicator should update to reflect the completed state and eventually be dismissed.

Actual behavior

The "running" indicator persists indefinitely after completion. It only disappears when the next task is started or the UI is refreshed.

Evidence that the agent actually completed

  • Output file for the agent was fully written with a successful result
  • Git commits from the agent's work were confirmed in the repository
  • TaskList returned empty — system-level confirmation no active tasks exist
  • All files modified by the agent were present and correct

Environment

  • Claude Code version: 2.1.71
  • Platform: macOS (Darwin 25.2.0)
  • Shell: zsh

Severity

Low — no functional impact (the agent did complete successfully), but causes confusion about whether work is still in progress and whether it is safe to proceed with follow-up tasks.

View original on GitHub ↗

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