claude-code - 💡(How to fix) Fix Terminated agents persist in UI agent list until session end [2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#46284Fetched 2026-04-11 06:24:22
View on GitHub
Comments
2
Participants
2
Timeline
10
Reactions
0
Author
Timeline (top)
labeled ×5commented ×2mentioned ×1subscribed ×1

When agents are created via TeamCreate + Agent tool and later terminated (via /kill, shutdown_request, or TeamDelete), they continue to appear in the UI agent picker list above the input field. This persists for the entire session duration.

Root Cause

When agents are created via TeamCreate + Agent tool and later terminated (via /kill, shutdown_request, or TeamDelete), they continue to appear in the UI agent picker list above the input field. This persists for the entire session duration.

Code Example

* Idle
├─ team-lead · shift +/↓ to select
├─ @admin-recipes-fix: Cooked for 23h 51m 54s · 26 tool uses · 38.6k tokens
├─ @architect-ai: Cooked for 2d 3h 53m · 4 tool uses · 50.1k tokens
├─ @architect-update: Cooked for 2d 1h 38m · 16 tool uses · 76.8k tokens
├─ @executor-mobile: Worked for 3d 1h 4m · 23 tool uses · 47.1k tokens
├─ @executor-worker: Baked for 1d 9h 24m · 18 tool uses · 37.8k tokens
... (80+ more entries)
RAW_BUFFERClick to expand / collapse

Description

When agents are created via TeamCreate + Agent tool and later terminated (via /kill, shutdown_request, or TeamDelete), they continue to appear in the UI agent picker list above the input field. This persists for the entire session duration.

Steps to Reproduce

  1. Create a team with TeamCreate
  2. Spawn multiple agents with the Agent tool (across multiple sessions)
  3. Terminate agents via shutdown_request or /kill
  4. Observe: terminated agents still appear in the UI list above the input field

Expected Behavior

Terminated/killed agents should be removed from the UI agent list.

Actual Behavior

80+ terminated agents remain in the UI list, obscuring the input area and making it difficult to see current work progress. The list shows entries like:

* Idle
├─ team-lead · shift + ↓/↓ to select
├─ @admin-recipes-fix: Cooked for 23h 51m 54s · 26 tool uses · 38.6k tokens
├─ @architect-ai: Cooked for 2d 3h 53m · 4 tool uses · 50.1k tokens
├─ @architect-update: Cooked for 2d 1h 38m · 16 tool uses · 76.8k tokens
├─ @executor-mobile: Worked for 3d 1h 4m · 23 tool uses · 47.1k tokens
├─ @executor-worker: Baked for 1d 9h 24m · 18 tool uses · 37.8k tokens
... (80+ more entries)

All agents show "Idle" status with accumulated stats even though they were terminated.

Environment

  • Claude Code CLI v2.1.88
  • macOS 26.3.1 (Darwin 25.3.0)
  • Terminal: Ghostty
  • Apple Silicon (Mac16,7)

Impact

  • Input area is pushed down by 80+ idle agent entries
  • Active work progress is hard to see (only visible at very top of terminal)
  • /kill removes agent processes but not UI entries
  • TeamDelete cleans up team files but not UI entries
  • Must end entire session to clear the list

extent analysis

TL;DR

The most likely fix is to implement a mechanism to update the UI agent list when agents are terminated, ensuring that terminated agents are removed from the list.

Guidance

  • Investigate the TeamCreate and Agent tool code to determine how the UI agent list is populated and updated.
  • Verify that the termination signals (shutdown_request, /kill, and TeamDelete) are properly handled and trigger an update to the UI agent list.
  • Consider implementing a periodic cleanup mechanism to remove terminated agents from the UI list, in case the termination signals are not reliably triggering an update.
  • Check the Claude Code CLI v2.1.88 documentation to see if there are any known issues or configuration options related to agent list management.

Example

No code snippet is provided as the issue does not contain sufficient information about the implementation details.

Notes

The issue may be related to a caching or synchronization problem between the agent management system and the UI. Further investigation is needed to determine the root cause.

Recommendation

Apply a workaround, such as implementing a periodic cleanup mechanism, until a permanent fix can be developed and deployed. This will help mitigate the issue and improve the user experience.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix Terminated agents persist in UI agent list until session end [2 comments, 2 participants]