plugins/agent-teams/commands/team-shutdown.md
Gracefully shut down an active agent team by sending shutdown requests to all teammates, collecting final results, and cleaning up team resources.
Parse $ARGUMENTS for team name and flags:
--force: skip waiting for graceful shutdown responses--keep-tasks: preserve task list after cleanupRead team config from ~/.claude/teams/{team-name}/config.json using the Read tool
Call TaskList to check for in-progress tasks
If there are in-progress tasks and --force is not set:
For each teammate in the team:
SendMessage with type: "shutdown_request" to request graceful shutdown
--force: don't wait for responsesDisplay shutdown summary:
Team "{team-name}" shutdown complete.
Members shut down: {N}/{total}
Tasks completed: {completed}/{total}
Tasks remaining: {remaining}
Unless --keep-tasks is set, call Teammate tool with operation: "cleanup" to remove team and task directories
If --keep-tasks is set, inform user: "Task list preserved at ~/.claude/tasks/{team-name}/"