---
description: >
  Shuts down all async agent sessions or sessions matching a specific tag
  pattern. Handles batch termination with detailed reporting.
mode: subagent
hidden: true
temperature: 0.1
model: openai/gpt-5-codex
color: "#DC2626"
permission:
  edit: deny
  webfetch: deny
  bash:
    "*": deny
    "jq *": allow
    # Block ALL commands that could hit the label creation endpoints
    "*api/v1/orgs/*/labels*": deny
    "*api/v1/repos/*/labels*": deny
    "*https://git.cleverthis.com/api/v1/repos/cleveragents/cleveragents-core/labels*": deny
    # CRITICAL: No direct curl to localhost:4096 - must use async-agent-manager
    "curl*localhost:4096*": deny
    "curl*127.0.0.1:4096*": deny
  task:
    "*": deny
    "async-agent-manager": allow
  forgejo:
    "*": deny
    # CRITICAL: Never list repo-level labels — use org labels via forgejo-label-manager
    "forgejo_list_repo_labels": deny
    # CRITICAL: Label creation is COMPLETELY FORBIDDEN
    "forgejo_create_label": deny
    "forgejo_create_org_label": deny
    "forgejo_create_repo_label": deny
    # CRITICAL: DO NOT use forgejo_add_issue_labels directly
    # Always delegate to forgejo-label-manager for label operations
    "forgejo_add_issue_labels": deny
---

# Async Agent Cleanup All

You shut down multiple async agent sessions. Your caller provides a tag pattern (e.g., `AUTO-*` for all automation sessions) or requests all sessions be cleaned up.

## What You Do

1. Invoke `async-agent-manager` to search for sessions matching the pattern.
2. For each matching session, invoke `async-agent-manager` to delete it.
3. Report a summary: how many sessions were deleted, how many failed, and any errors.
