Cleanup
Cleanup is Herald’s high-leverage inbox reduction screen. It groups mail by sender or domain, shows detail rows, previews individual messages, and exposes destructive actions, archive, unsubscribe, hide-future-mail, automation rules, custom prompts, and cleanup rule management.
Overview
Section titled “Overview”Press 3 to open Cleanup. Use it when you want to answer questions like “which senders have the most mail?”, “what can I archive?”, “what can I delete?”, and “which future mail should be hidden or automated?”
Screen Anatomy
Section titled “Screen Anatomy”| Area | What it shows |
|---|---|
| Folder sidebar | Folder tree and counts when the terminal is wide enough and no cleanup preview is hiding it. |
| Summary table | Group rows by sender or domain with columns for selection, Sender/Domain, Count, and Dates. |
| Detail table | Emails for the focused summary row with columns for selection, Date, Subject, Size, and Att. |
| Preview panel | Current cleanup email body, header metadata, action hints, unsubscribe visibility, scroll state, delete/archive progress. |
| Full-screen preview | Cleanup preview expanded across the terminal. |
| Rule editor overlay | Full-screen Automation Rule form opened by W. |
| Custom prompt overlay | Full-screen prompt editor opened by P. |
| Cleanup manager overlay | Full-screen saved cleanup rules manager opened by C. |
| Status bar | Sender/domain mode, selection counts, deletion/archive progress, dry-run mode, folder counts, and confirmations. |
Controls
Section titled “Controls”| Key | Context | Preconditions | Result |
|---|---|---|---|
d | Cleanup | Not loading. | Toggles sender grouping and domain grouping. |
space | Summary or details | Visible data can be interacted with. | Selects or unselects the focused sender/domain row or message row. |
enter | Summary | Summary focused. | Loads detail table for the focused sender/domain. |
enter | Details | Details focused and preview closed. | Opens preview for the focused message. |
enter | Preview | Cleanup preview open and details focused. | Scrolls preview down one line. |
j / down | Summary/details | Preview not intercepting scroll. | Moves selection down. |
k / up | Summary/details | Preview not intercepting scroll. | Moves selection up. |
j / down | Preview | Cleanup preview open and details focused. | Scrolls body down. |
k / up | Preview | Cleanup preview open and details focused. | Scrolls body up. |
D | Cleanup | Not loading, not already deleting, target exists. | Opens delete confirmation or directly queues current preview email. |
e | Cleanup | Not loading, not already deleting, target exists. | Opens archive confirmation or directly queues current preview email. |
A | Cleanup preview | AI configured and preview email exists. | Re-classifies the preview email. |
u | Cleanup preview | Body includes List-Unsubscribe. | Opens unsubscribe confirmation. |
h / H | Cleanup | Focused sender or preview email exists. | Creates hide-future-mail behavior for that sender. |
W | Cleanup | Rule editor closed. | Opens automation rule editor, prefilled with focused sender or domain. |
P | Main UI | Rule/prompt/settings overlays are closed. | Opens custom AI prompt editor. |
C | Cleanup | Cleanup manager closed. | Opens saved cleanup rules manager. |
z | Cleanup preview | Preview open. | Toggles full-screen cleanup reader. |
esc | Cleanup preview/overlays | Preview, full-screen, or overlay active. | Closes the active state. |
tab / shift+tab | Cleanup | Visible panels available. | Cycles between sidebar, summary, details, and chat when present. |
Workflows
Section titled “Workflows”Review a Sender
Section titled “Review a Sender”- Press
3. - Keep sender mode or press
dfor domain mode. - Move through the summary table with
j/k. - Press
enterto load details. - Press
tabto focus details, then move through messages. - Press
enterto preview a message.
Delete or Archive a Group
Section titled “Delete or Archive a Group”- Focus the summary table.
- Press
spaceon one or more senders or domains. - Press
Dto delete oreto archive. - Read the confirmation description in the status bar.
- Press
yto confirm orn/Escto cancel.
Delete or Archive Individual Messages
Section titled “Delete or Archive Individual Messages”- Load details for a sender or domain.
- Press
tabto focus details. - Press
spaceon individual messages. - Press
Dore. - Confirm only when the status description matches your selection.
Create a Hide-Future-Mail Rule
Section titled “Create a Hide-Future-Mail Rule”- Focus a sender in the summary table or open a message preview.
- Press
h. - Herald creates the backend rule/action used to hide matching future mail.
Create Automation
Section titled “Create Automation”- Focus a sender or domain that should trigger automation.
- Press
W. - Choose trigger type: sender, domain, or AI category.
- Enter trigger value.
- Select actions: desktop notification, move, archive, delete, webhook, or shell command.
- Fill action details such as destination folder, webhook URL/body, shell command, or notification text.
- Complete the form to save.
Manage Cleanup Rules
Section titled “Manage Cleanup Rules”- Press
C. - Press
nto create a cleanup rule,enterto edit selected,dto delete, orrto run all. - In the edit form, set rule name, match type, match value, action, older-than days, and enabled state.
- Press
escto leave edit mode or close the manager.
States
Section titled “States”| State | What happens |
|---|---|
| Sender mode | Summary groups exact sender addresses. |
| Domain mode | Summary groups extracted sender domains. |
| Empty summary | No cleanup groups are available for the folder/cache state. |
| Selected summary rows | Status reports selected sender/domain count. |
| Selected detail rows | Status reports selected message count and sender/domain spread. |
| Delete/archive confirmation | Status bar asks for y confirm or n/Esc cancel. |
| Deleting/archive in progress | Requests are queued serially; status shows progress and reconnect messages when needed. |
| Cleanup preview | Sidebar hides to make room; details panel can scroll the body. |
| Full-screen preview | Cleanup preview expands and rewraps body lines. |
| AI unavailable | A and category-trigger workflows cannot classify new content. |
| Dry-run mode | Status shows [DRY RUN]; destructive rules can be exercised without live mutation when that runtime mode is active. |
| Narrow terminal | Cleanup collapses columns and can hide the sidebar or summary panel while preview is open. |
Data And Privacy
Section titled “Data And Privacy”Cleanup reads cached sender statistics, message metadata, message bodies for previews, unsubscribe headers, classifications, and rules. Delete and archive write to the IMAP mailbox and update SQLite cache. Hide-future-mail, automation rules, custom prompts, and cleanup rules are stored through Herald’s backend. Webhook and shell-command automation can send or expose email-derived values outside Herald when you configure those actions.
Troubleshooting
Section titled “Troubleshooting”If delete/archive is not available, check whether a deletion is already running or the selected folder is read-only.
If a confirmation describes the wrong target, press n or Esc, clear selections with space, and select again.
If u does nothing, the previewed message does not include a usable List-Unsubscribe header.
If automation actions do not run, reopen W or C to verify the rule is enabled and that the match value is precise.