Idle team agents cannot be cleaned up and accumulate over time

Status Fixed / completed
Reported on v2.1.50
Maintainer reply None cached
Activity 4 comments · opened Feb 22, 2026 · closed Feb 23, 2026

Description:
When using team agent mode in Claude Code, idle team members cannot be cleaned up. They remain hanging and accumulate over time, causing clutter in the interface.

Environment:

  • Claude Code version: 2.1.50
  • OS: Windows 10
  • Terminal: Windows Terminal

Steps to reproduce:

  1. Start Claude Code with team agents
  2. Work with multiple agents over a session
  3. Observe that agents become idle after completing their tasks
  4. Try to clean up or dismiss idle agents

Expected behavior:
Idle team agents should be cleanable/dismissable, either automatically or through a user action.

Actual behavior:

  • Idle agents remain visible in the team list
  • No apparent way to clean them up
  • They accumulate over time, making the interface cluttered

Impact:

  • Clutters the team agent view
  • Makes it difficult to track active agents
  • Potentially impacts performance with many idle agents

View original on GitHub ↗

4 Comments

github-actions[bot] · 7 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/26955
  2. https://github.com/anthropics/claude-code/issues/27610
  3. https://github.com/anthropics/claude-code/issues/25131

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

jaried · 7 months ago

Thank you for the duplicate check. I've reviewed the linked issues and believe this one has a distinct focus:

#26955 - About UI persistence after TeamDelete is called (cleanup files but UI remains)
#27610 - About model:inherit causing unrecoverable zombies (specific to model resolution)
#27639 (this issue) - About idle agents having no cleanup mechanism at all

The key difference:

  • This issue is about the absence of any built-in mechanism to clean up idle agents during normal operation
  • The other issues focus on cleanup failing after certain operations (TeamDelete) or due to specific configurations (model:inherit)

A user-facing solution for this issue would be:

  • A command to dismiss/clean idle agents (e.g., /team-clean-idle)
  • Automatic cleanup of agents that have been idle for X minutes
  • A UI button to dismiss individual idle agents

If maintainers still consider this a duplicate, I'm happy to close and 👍 the existing issue.

jaried · 7 months ago

Closing this issue. After further analysis, this is an orchestration design limitation rather than a bug:

  • Agent teams have no built-in lifecycle management for worktrees created during execution
  • When agents go idle, there is no cleanup mechanism by design — the orchestration layer simply doesn't include a worktree cleanup phase
  • This is expected behavior given the current agent team architecture

We've worked around this by building our own worktree management tool (forge-warp) that handles the full lifecycle: create → warp → resume → clean.

github-actions[bot] · 7 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.