Agent-team registry: members[] never pruned across /clear; internal agents_killed event mislabeled 'stopped by the user' and killed live agents

Status Open
Maintainer reply None cached
Activity 1 comment · opened Aug 13, 2026

Summary

On a long-lived project, the agent-team registry (~/.claude/teams/session-<id>/config.json) accumulates members[] entries indefinitely: cleanly-returned/TaskStopped subagents are never removed from the roster, and /clear reuses the registry rather than starting fresh.

In our case the roster grew to 56 members over ~46 hours across 4+ /clear boundaries (most entries were long-terminated seats). A CLI-internal agents_killed bookkeeping event then fired against the whole roster, killing the 3 actually-live agents mid-task — and the stop was labeled "stopped by the user" although the user took no action.

Impact

  1. Live agents killed mid-round (one was mid-provisioning; work had to be re-verified).
  2. The 'by the user' label misattributes an internal event to a human — burns trust and misdirects debugging toward the user's actions.
  3. Stale rosters make every roster-wide operation scale with history, not with live seats.

Expected

  • Prune a member's roster entry when it returns cleanly / is TaskStopped (or sweep at session start / /clear).
  • Label internally-originated kill events as internal (e.g. 'registry cleanup'), reserving 'stopped by the user' for actual user action.

Environment

Windows 11 Pro, Claude Code CLI (desktop terminal), in-process agent teams via the Agent tool. Version at incident time: see below if printed; incident 2026-08-13 ~10:40Z.

Happy to provide sanitized forensics timelines on request.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗