# Archive or remove · two-step recipe

Two steps, always: `xale_prepare_removal` returns a preview and changes nothing; `xale_confirm_removal` removes exactly that, with the person's words. Prefer archiving, which can be undone.

Checked 2026-12-02 · https://xale.app/docs/ai/archive-or-remove-two-step-recipe

## When

The person asks you to archive, bin or delete something.

## Calls

1. [`xale_prepare_removal`](https://xale.app/docs/ai/tools/xale_prepare_removal) with `action`, `id`, and `mapId` for a Mindmap branch. Nothing changes yet. It returns a `preview` and a `removalId`.
2. Show the person the preview, and ask.
3. Only when they clearly say yes: [`xale_confirm_removal`](https://xale.app/docs/ai/tools/xale_confirm_removal) with `removalId` and their exact words in `personSaid`.
4. Pass on `tellThePerson`. It says what was removed, how to undo it, and that it's listed under **Settings › Connected apps**.

| `action` | What it does |
| --- | --- |
| `archive_task`, `archive_milestone`, `archive_mindmap`, `archive_note`, `archive_list`, `archive_meeting`, `archive_habit` | Archives the item. It can be undone. |
| `archive_capture` | Moves the Capture to Trash. It can be restored. |
| `delete_mindmap_branch` | Deletes the node and everything under it, for good. |

```json
[
  { "tool": "xale_prepare_removal", "arguments": { "action": "delete_mindmap_branch", "id": "n_old_ideas", "mapId": "Mg4tY8rB" } },
  { "tool": "xale_confirm_removal", "arguments": { "removalId": "rm_3pQx7L", "personSaid": "yes, delete that branch" } }
]
```

## Say

- Prefer archiving: it can be undone.
- A Mindmap branch delete is for good. Say so before they confirm.
- If the person says you may remove things without asking each time, record their words with [`xale_allow_removals`](https://xale.app/docs/ai/tools/xale_allow_removals). Even then, still prepare each removal, still show the preview, and still say what you removed. [`xale_stop_allowing_removals`](https://xale.app/docs/ai/tools/xale_stop_allowing_removals) turns it off.

## If it fails

| What comes back | What to do |
| --- | --- |
| “That preview expired after 30 minutes. Prepare it again with xale_prepare_removal and confirm with the person.” | Prepare it again and ask again. |
| “Nothing was removed: it changed after the preview. Prepare it again, show the person the new preview, and ask again.” | As it says. |
| “Not during an unattended run. Removals happen only while the person is in the chat and has said yes.” | Never remove during an unattended run. |
| “The central topic can't be removed. Remove its branches instead.” | Archive the whole map with `archive_mindmap`, or remove branches. |

> Preview, then the person's yes, then exactly what was previewed.

## Related

- For people: [How do I let Claude remove things in Xale?](https://xale.app/help/removals-by-ai-how-to-allow)
- For people: [How do I restore deleted notes in Xale?](https://xale.app/help/trash-restore-deleted-items)
- Tools: [xale_prepare_removal](https://xale.app/docs/ai/tools/xale_prepare_removal)
- Tools: [xale_confirm_removal](https://xale.app/docs/ai/tools/xale_confirm_removal)
- Tools: [xale_allow_removals](https://xale.app/docs/ai/tools/xale_allow_removals)
- Tools: [xale_stop_allowing_removals](https://xale.app/docs/ai/tools/xale_stop_allowing_removals)
- Read next: [Removals · only when allowed](https://xale.app/docs/ai/removals-only-when-allowed)
- Read next: [Audit of changes · what's recorded](https://xale.app/docs/ai/audit-of-changes-what-s-recorded)
