All ideasMore in Work

Clean my giant inbox by sender — trash only, never delete, undo everything

Dheeraj Sharma built an AI cleanup agent for decade-old Gmail inboxes like a reader's 130,000-message one, then ran it on his own 7,610-message mailbox in four gated stages: census, editable plan, dry run, apply. One approved run moved 2,896 newsletter and notification emails to Trash in 107 seconds (unread fell from 5,013 to 2,237), with deletion impossible by design and every change logged for a one-command undo.

How it works

  1. Census: sample the newest 2,000 messages, roll senders up to domains, count each exactly with cheap ID-only queries
  2. Plan: The AI drafts keep/trash/archive/label/unsubscribe per sender with reasons; he edits it and switches every unsubscribe to no
  3. Dry run: shows exactly how many messages each plan line would move, changes nothing
  4. Apply on his go: 2,896 messages moved to Trash in 107 seconds, all logged first
  5. Undo available as one command, restoring exact labels; safety suite of 54 checks guards trash-only, no-delete permission and starred/important exclusions

Why it’s worth knowing

It cleared 2,896 emails in 107 seconds while being technically incapable of deleting anything — the safety is in the permissions, not the prompt.

Where it’s from

Summarized from a public post on genaiunplugged.substack.com. See the original ↗

Upgraded prompt

A ready-to-use prompt for this idea, built from research on what makes AI agents do the job right: who the AI should be, the exact steps, and a check to make sure it was done the way you wanted.

1Who the AI should be
2The prompt, with the steps
3The check when it’s done
Upgraded prompts are coming soon.

Try next

Every idea is a real post from someone who tried it, summarized in our words, with a link to the original. App names are swapped for plain words.