[BUG] TeamDelete fails on stale teams after session crash - must delete files manually to remove/reuse team name
Resolved 💬 1 comment Opened Apr 25, 2026 by mpercy Closed May 28, 2026
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
When a Claude Code session crashes (e.g., machine reboot, OOM), the team config at ~/.claude/teams/{name}/config.json retains the dead session's leadSessionId. In a new session, neither TeamCreate nor TeamDelete can operate:
- TeamDelete returns "No team name found" — the new session's ID doesn't match the stale
leadSessionIdin the config - TeamCreate returns "Team already exists" — the directory is still on disk
This creates a deadlock where the only workaround is manually rm -rf ~/.claude/teams/{name}, which loses task history and member registry.
This creates friction if you are running agent teams set up to generate fomulaic team names.
What Should Happen?
Probably one of:
TeamCreate --forceoverwrites stale configTeamDeleteaccepts a--team-nameparameter to delete by name without session context- Auto-detection of stale sessions (check if
leadSessionIdprocess is alive) with automatic cleanup
Error Messages/Logs
Steps to Reproduce
- Claude Code agent creates a team with the
TeamCreatetool - Spawn agents with the
Agenttool usingteam_name - Kill the session (e.g., machine reboot,
kill -9 claude, etc - Start a new Claude Code session
- Try
TeamDelete→ "No team name found" - Try
TeamCreatewith the same name → "already exists"
Claude Model
Opus
Is this a regression?
No, this never worked
Last Working Version
_No response_
Claude Code Version
2.1.119
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Other
Additional Information
_No response_
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗