TeamDelete leaves original-case inboxes/ sibling behind; only the lowercased-hyphenated canonical dir is removed

Resolved 💬 2 comments Opened May 14, 2026 by Slaktmeister Closed May 14, 2026

Environment

  • Claude Code: 2.1.141
  • macOS: Darwin 25.2.0
  • Project uses CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1

Summary

When a team name contains uppercase letters or underscores, TeamCreate writes the canonical config.json to a lowercased-hyphenated path, but teammate inboxes/ are written to a parallel sibling at the original-case path. TeamDelete only removes the lowercased canonical dir, so every team-debate run leaks one orphan ~/.claude/teams/<original_case_name>/inboxes/ stub indefinitely.

Reproduction

  1. Create a team whose name has uppercase letters and/or underscores:

``
TeamCreate({
team_name: "team_full_team_AMD_2026-05-14T173000Z",
description: "..."
})
`
The returned
team_file_path is at the **lowercased-hyphenated** path:
~/.claude/teams/team-full-team-amd-2026-05-14t173000z/config.json`.

  1. Spawn at least one teammate via Agent({team_name: ..., name: ...}) so the platform creates the inboxes/ directory. The inboxes land at the original-case sibling:

~/.claude/teams/team_full_team_AMD_2026-05-14T173000Z/inboxes/.

  1. After teammates terminate, call TeamDelete(). It returns:

``
{"success": true, "message": "Cleaned up directories and worktrees for team \"team_full_team_AMD_2026-05-14T173000Z\""}
``

  1. Inspect ~/.claude/teams/:
  • team-full-team-amd-2026-05-14t173000z/gone ✓ (expected)
  • team_full_team_AMD_2026-05-14T173000Z/inboxes/still present ✗ (orphan)

Expected

TeamDelete removes both siblings (or, equivalently: only one canonical path is used end-to-end, so there's nothing to orphan).

Actual

The original-case dir with inboxes/ persists. In this project's ~/.claude/teams/ there are now 13 such orphan stubs from team-debate workflow runs over the past two weeks. Each is small (~40 bytes), so impact is bytes-scale, but the leak is linear with the number of team-debate runs.

Workaround

Manual sweep:

find ~/.claude/teams/ -maxdepth 2 -type d -name inboxes -empty -print0 | \
  xargs -0 -I{} dirname {} | \
  xargs rm -rf

Probable cause

TeamCreate normalizes the team name for the config-dir path (lowercase + hyphenate) but the teammate-mailbox subsystem uses the unnormalized name. TeamDelete only knows the normalized form. Fix candidates: (a) pick one canonical form and use it for both config and inboxes, or (b) teach TeamDelete to also remove the original-case sibling.

Additional context

This affects any workflow that spawns teams with non-canonical names. In our case, every workflows/run_full_team.md Step 8 invocation produces one orphan, because we name teams after the analyst-report run-id (mixed case + underscores + uppercase ticker) for audit-trail traceability.

View original on GitHub ↗

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