Orchestrate teams of Claude Code sessions changedagent-teams
Nearest release: v2.1.335, published 6 hours before upstream edited the page. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.
Upstream edited this page at 3 Dec 2026 04:02 UTC, give or take a minute or two: the time comes from Anthropic’s own sitemap rather than from a commit. This site recorded the change at 3 Dec 2026 04:07 UTC.
Upstream edited
Recorded here
Lines+34added
Lines−6removed
From line
222
where the diff opens
First seen
14 Aug 2026
this site's first read of the page
Recorded edits54to this page, all time
The whole hunk
from line 222, old and new numbered
/
from line 222
222222
223223The lead sends a shutdown request. The teammate can approve, exiting gracefully, or reject with an explanation.
224224
225The team's shared directories are cleaned up automatically when the session ends, so there's no separate cleanup step. See [Architecture](#architecture) for which directories are removed and which stay on disk.
225Claude Code removes the team config directory when the lead's session exits normally. See [Architecture](#architecture) for which directories are removed and which stay on disk.
226226
227227### Enforce quality gates with hooks
228228
from line 261
261261
262262Teams and tasks are stored locally under a session-derived name. The name is `session-` followed by the first eight characters of the session ID:
263263
264* **Team config**: `~/.claude/teams/{team-name}/config.json`. Claude Code removes the team config directory when the session ends.
264* **Team config**: `~/.claude/teams/{team-name}/config.json`. Claude Code removes the team config directory when the lead's session exits normally.
265265* **Task list**: `~/.claude/tasks/{team-name}/`. This directory stays on disk after the session ends. To change [how long Claude Code keeps it](https://code.claude.com/docs/en/claude-directory.md#cleaned-up-automatically), set [`cleanupPeriodDays`](https://code.claude.com/docs/en/settings-reference#cleanupperioddays).
266266
267267Claude Code generates both of these automatically at session startup and updates them as teammates join, go idle, or leave.
from line 491
491491
492492### Orphaned tmux sessions
493493
494If a tmux session persists after the Claude Code session ends, it may not have been fully cleaned up. List sessions and end the one created by the team:
494How you stop teammates still running in tmux after the lead's session ends depends on where you started the lead:
495495
496* **Inside tmux**: close the teammate panes in your own tmux window
497* **Outside tmux**: the panes are in a session named `claude-swarm` on a separate tmux server, which you reach with tmux's `-L` flag
498
499To end a leftover `claude-swarm` session, follow these steps in your shell:
500
501**1. Find the server's socket**
502
503List tmux's sockets, and look for any named `claude-swarm-` followed by the lead's process ID:
504
496505```bash theme={null}
497tmux ls
498tmux kill-session -t <session-name>
506ls "${TMUX_TMPDIR:-/tmp}/tmux-$(id -u)/"
499507```
508
509**2. Check that the lead has exited**
510
511Replace `<lead-pid>` with the process ID from the socket name:
512
513```bash theme={null}
514ps -p <lead-pid>
515```
516
517Continue if the output shows only a header line. If it lists a process, skip this socket so you don't end a team that's still running.
518
519**3. End the session**
520
521Use the same `<lead-pid>` value to end the `claude-swarm` session:
522
523```bash theme={null}
524tmux -L claude-swarm-<lead-pid> kill-session -t claude-swarm
525```
526
527If you see `no server running`, the session has already ended.
500528
501529## Limitations
502530
No line in this hunk matches that.