Skip to content
CommandImported

team-shutdown

Gracefully shut down an agent team, collect final results, and clean up resources

Imported description, not reviewed yet

This item came from its original repository and was only scanned automatically; no editor has written an Arabic description for it yet. Read its content yourself before you rely on it. This page is not indexed by search engines until it is reviewed.

Download

Files: 1 · Size: 2.8 KB

Download the ZIP

The file carries the license of the original source.

Install

After downloading, run the command in a terminal. unzip asks before it replaces any file that is there.

  • For this project

    It goes in: .claude/commands/

    mkdir -p .claude/commands && unzip ~/Downloads/agent-teams-team-shutdown.zip -d .claude/commands

  • For your account on the whole machine

    It goes in: ~/.claude/commands/

    mkdir -p ~/.claude/commands && unzip ~/Downloads/agent-teams-team-shutdown.zip -d ~/.claude/commands

Instructions

Team Shutdown

Gracefully shut down an active agent team by sending shutdown requests to all teammates, collecting final results, and cleaning up team resources.

Phase 1: Pre-Shutdown

  1. Parse $ARGUMENTS for team name and flags:

    • If no team name, check for active teams (same discovery as team-status)
    • --force: skip waiting for graceful shutdown responses
    • --keep-tasks: preserve task list after cleanup
  2. Read team config from ~/.claude/teams/{team-name}/config.json using the Read tool

  3. Call TaskList to check for in-progress tasks

  4. If there are in-progress tasks and --force is not set:

    • Display warning: "Warning: {N} tasks are still in progress"
    • List the in-progress tasks
    • Ask user: "Proceed with shutdown? In-progress work may be lost."

Phase 2: Graceful Shutdown

For each teammate in the team:

  1. Use SendMessage with type: "shutdown_request" to request graceful shutdown
    • Include content: "Team shutdown requested. Please finish current work and save state."
  2. Wait for shutdown responses
    • If teammate approves: mark as shut down
    • If teammate rejects: report to user with reason
    • If --force: don't wait for responses

Phase 3: Cleanup

  1. Display shutdown summary:

    Team "{team-name}" shutdown complete.
    
    Members shut down: {N}/{total}
    Tasks completed: {completed}/{total}
    Tasks remaining: {remaining}
    
  2. Unless --keep-tasks is set, call TeamDelete to remove team and task directories

  3. If --keep-tasks is set, inform user: "Task list preserved at ~/.claude/tasks/{team-name}/"

Files

  • LICENSE1 KB
  • team-shutdown.md1.7 KB

Comments (0)

No comments yet. Be the first.

Sign in to comment. Commenting comes at level 1 (Member).

Report