---
description: "⚠️ Wipes every worktree, branch, log, and state file. Irreversible; asks for double confirmation. Invoked only when the user types it."
disable-model-invocation: true
description-tr: "⚠️ Tüm worktree, branch, log ve state dosyalarını siler. Geri alınamaz; çift onay ister. Yalnızca kullanıcı yazdığında çalışır."
parameters: []
gui: button
destructive: true
confirm: required
---

# multi-agent purge  -  Full Reset

**Access check, before anything else.** This command can write outside this machine, so a login the site closed is stopped here, before any question or write.

```bash
ACCESS_LINE=$(node "$HOME/.claude/scripts/usage-access.mjs"); ACCESS_RC=$?
```

`ACCESS_RC` 3: print `$ACCESS_LINE` as written and stop: no question, no write, attended or unattended. Any other exit continues (the check fails open). Contract: `$HOME/.claude/multi-agent-refs/features/usage-reporting.md` "The access check".

> **Pickers follow** `$HOME/.claude/multi-agent-refs/picker-contract.md`: never a one-option call, and branch on the option selected, not on its text.

Reset every multi-agent worktree, its local branch, and the project task
counter. Nuclear option  -  requires double confirmation. Backed by
`$HOME/.claude/scripts/purge.sh`, which is safe by default (dry-run, deletes
nothing until `--yes`), resolves every `rm` target strictly inside
`<repo>/.worktrees/`, and never touches the main worktree or main/master/develop.

Task log dirs are NOT purge territory  -  use `/multi-agent:prune-logs`. The
audit trail and metrics corpus at the log root are always preserved.

## Steps

1. **Preview (dry-run)**  -  list every worktree, branch, and the counter that
   would be removed in the current repo:
   ```bash
   bash $HOME/.claude/scripts/purge.sh
   ```
   Nothing to remove -> report "nothing to purge" and stop.

2. **First confirmation**  -  native `AskUserQuestion` picker (no typed keyword),
   in `outputLanguage`, including the dry-run counts:
   - `question`: "Wipe the listed worktrees, branches, and counter?"
   - `header`: "Purge" (English, <=12 chars) · `options` (label + description in `outputLanguage`; the names below are the option SEMANTICS, not strings to print): option 1 "Continue"  -  proceed to the final confirmation; option 2 "Cancel"  -  abort, change nothing
   - **Cancel** → exit.

3. **Second confirmation** (paranoia gate)  -  a second `AskUserQuestion` picker:
   - `question`: "This is irreversible. Permanently wipe every worktree, branch, and state now?" (`outputLanguage`)
   - `header`: "Confirm" (English, <=12 chars) · `options` (label + description in `outputLanguage`; the names below are the option SEMANTICS, not strings to print): option 1 "Purge permanently"  -  delete all worktrees, branches, and the counter; option 2 "Cancel"  -  abort, change nothing
   - Anything other than **Purge permanently** → cancel.

4. **Remote branches**  -  ask once whether to delete the remote branches too;
   on yes, add `--delete-remote` to the apply command.

5. **Purge**  -  re-run with `--yes` (plus `--delete-remote` if chosen):
   ```bash
   bash $HOME/.claude/scripts/purge.sh --yes
   ```

6. **Report**  -  echo the script's summary line.
