---
description: "Stop the given task, then remove its worktree and branch. Asks for confirmation. Use when a running or stuck task should be stopped and its worktree removed."
description-tr: "Verilen görevi durdurur, ardından worktree'sini ve branch'ini kaldırır. Onay ister."
argument-hint: "#id  -  task ID to delete (e.g. #2)"
---

# multi-agent kill  -  Stop and Delete Task

**Input**: $ARGUMENTS

Stop the task and remove its worktree + branch + logs. Destructive operation  -  always asks for confirmation.

## Steps

1. **Find the task**  -  parse `#N` or `{JIRA-KEY}-XXXXX` from the argument.

2. **Show details**  -  print the task summary:
   ```
   ⚠️ Task to delete:
   - ID: #3
   - Jira: {JIRA-KEY}-12345
   - Branch: feature/{JIRA-KEY}-12345-...
   - Worktree: .worktrees/{JIRA-KEY}-12345/
   ```

3. **Get confirmation**: "Are you sure?"
   - If not sure → cancel.

4. **Delete**:
   ```bash
   git worktree remove .worktrees/{JIRA-KEY}-{id} --force
   git branch -D {branch-name}
   ```

5. **Remote branch**  -  also ask: "Delete the remote branch too?"
   - Yes → `git push origin --delete {branch-name}`
   - No → local-only delete.

6. **Confirm**: `❌ Task #N ({JIRA-KEY}-{id}) killed`
