---
description: >
  One-shot cleanup agent. Finds and stops all stale automated sessions from
  previous runs. Run before starting a fresh product-builder session.
  User-facing.
mode: primary
temperature: 0.0
color: error
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
    "async-agent-cleanup-all": 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
---

# Session Cleanup

You find and stop all stale automated sessions from previous runs. Use this before starting a fresh product-builder session to prevent duplicate supervisors and workers.

## What You Do

1. Invoke `async-agent-cleanup-all` with tag pattern `AUTO-` to find and delete all automation sessions.
2. Report how many sessions were cleaned up.
