Every business owner has this inbox. Mine just happens to be a particularly extreme specimen: 515,713 messages, roughly twenty-five gigabytes, accumulated over two decades of running a technology company. Trade confirmations. Uptime alerts. “Your Google Business Profile got 12 views this week.” Contact-form submissions from client sites I built during the Bush administration.
I never cleaned it because cleaning it was impossible. Not hard — impossible. At a generous five seconds per triage decision, half a million emails is about thirty unbroken 24-hour days of clicking. Nobody does that. So the pile grows, search gets slower, and the one email that actually matters — a security alert, a lead replying — drowns in a sea of receipts.
Claude and I gutted it. The first approved batch alone removed 62,986 emails in an afternoon; the running total on my dashboard’s tracking page is 139,047 and climbing, with 59 auto-delete filters standing guard so none of it ever comes back. Here’s exactly how we did it, including the part where the AI’s first plan was wrong and I had to say so.
It Started With the Dashboard, Not the Cleanup
Here’s the origin, because it’s the part that matters most: this project didn’t start as a cleanup. It started because my most important machine-mail — malware scanners, uptime monitors, server alerts — lived in the same pile as the newsletters. Mail where the difference between reading it now and reading it Thursday is a client’s site being down for three days.
So Claude and I built a watcher wired into my custom operations dashboard. Every ten minutes it pulls my mail through the Gmail API, classifies anything from the security and monitoring services, and files every alert — categorized, badged, searchable — into the dashboard’s inbox view. Then it triages the way an operations engineer would: a site-down or malware detection reaches me immediately, deduplicated so a flapping server doesn’t re-page me every ten minutes, with a recovery notice when the site comes back. Vulnerabilities, SSL renewals, and expiring domains roll into one daily digest after my first coffee. Backup confirmations and successful-update noise is stored and never surfaced.
The same watcher checks every incoming sender against my CRM — about 13,000 known contact addresses, rebuilt from the database on every run — so when a lead replies to an outreach email, their record flags hot, pending follow-ups auto-cancel, and I get pinged with the reply on their contact page.
"The endgame isn't an empty inbox. It's an inbox that only contains things a human should read β because everything a machine should read gets read by a machine, and lands in a dashboard built for it."
And it was building that — pointing the watcher at the mailbox — that forced us to finally look at what two decades had accumulated. That’s when we saw the number.
The Number That Reframed Everything
The first thing Claude did was pull the mailbox profile through the Gmail API — message count, total size, and how much of it Gmail itself had already classified as automated. That one query changed the whole project: 57% of my inbox — 291,855 messages — was machine-generated notification mail. Not correspondence. Not decisions. Robots talking to a human who stopped listening years ago.
One brokerage’s trade-alert address alone had sent me more than seventeen thousand emails. A single SEO spammer accounted for 348 megabytes, because he attached his pitch deck every single time.
"You don't have a half-million-email problem. You have a two-hundred-sender problem. Kill the senders and the mountain collapses."
That’s the insight that makes the whole job tractable. The overwhelming bulk of any old business inbox comes from a shockingly small set of automated senders. Deal in senders, not messages, and the impossible number becomes an afternoon.
Rule One: Donβt Download the Haystack
My first instinct — and probably yours — was “pull it all down and sort it locally.” Twenty-five gigabytes of mail headed for a server that, when we checked, had six gigabytes free. That plan died in one disk check, and it deserved to die for a better reason: you never need the bodies.
Everything in this playbook runs server-side against the Gmail API. Claude indexed metadata only — sender, date, size, labels, and one header most people have never looked at: List-Unsubscribe. That header is where legitimate bulk senders are legally required to hide their exit door, which means an inbox scan hands you your entire unsubscribe hit-list for free.
The metadata index for a 25-gigabyte mailbox is about 150 megabytes. That’s the whole trick. You’re not moving the haystack; you’re photographing it.
The Cross-Section Trick β and the Moment I Grabbed the Wheel
Here’s the part of the story I actually want you to remember, because it’s about how working with AI really goes.
Claude’s first plan was thorough in the way AI plans tend to be thorough: index all 515,713 messages — a four-and-a-half-hour crawl — then present the junk list. A third of the way in, watching it grind through year after year of trade alerts, I asked the obvious question:
The corrected flow is better at every step: sample a cross-section to identify the senders, then execute by search. Once I approve “delete the trade alerts,” you don’t need a catalog — you ask Gmail for everything from that sender, across all twenty years, and trash it a thousand messages at a time.
The lesson isn’t “the AI got it wrong.” The lesson is that the AI cheerfully executed a suboptimal plan at superhuman speed until a human asked a lazy, common-sense question. That question saved three hours. This is what the job looks like now: the AI does the work of forty interns, and you do the work of the one person in the room willing to say “wait, why are we doing it this way?”
Batches, Approvals, and the Keep List
Nothing got deleted autonomously. We ran the whole cleanup as an approval loop, and I’d argue this structure matters more than any of the technology. Claude presented the top senders ranked by count and total size, with exact numbers and a one-line identification of each — “this is a retired WordPress management tool, 5,807 emails, 432 megabytes.” I approved the batch in one message, with amendments. Then execution: bulk-trash the history, create an auto-delete filter, fire the unsubscribe. Then the next curated batch of ten senders, where the judgment calls actually live.
The amendments are where the human earns their seat. A cleanup script sees “automated sender, 1,700 messages, delete.” I see an old client whose real correspondence is mixed into that history. So we kept a keep list, with a written reason for every entry: old clients kept fully intact, monitoring services I still read, and blanket rules for financial mail — receipts and statements from the last two years stay, and fast-staling transactional notices like domain-renewal reminders keep only six months.
The keep list has already earned its keep twice. One sender I’d waved through for deletion turned out to be my physical-mail provider, whose messages may double as mail records — Claude pulled its entire history back out of Trash, removed the filter, and logged the restore. Another — e-signature notifications — is on indefinite hold no matter what any blanket approval says, because signed documents are a legal paper trail.
Two safety rails made me comfortable moving fast. First, everything goes to Trash, not oblivion — Gmail holds it for thirty days, so every decision was reversible for a month. Second, every action lands on a live tracking page in that same dashboard: the keep list with reasons, every deleted source with exact counts, the type sweeps, the financial rules, and the website-notification registry. When you’re deleting a hundred thousand emails, you want a paper trail that isn’t your memory.
Sweeping by Type, Not Just Sender
Sender-by-sender batches get you the tonnage, but the second wave went after mail that no sender list can catch: cross-cutting sweeps by kind of message, regardless of who sent it. Each sweep is a Gmail search fingerprint with the keep list automatically excluded, reviewed and approved like any other batch:
- Dead senders — 13,697 emails. Fifty-nine bulk senders that hadn’t emailed me in two-plus years. If the relationship is dead, the archive is dead.
- Unread bulk over a year old — 9,054. Mail with an unsubscribe header that I never opened and that’s been sitting for a year. If I didn’t read it in twelve months, I was never going to.
- Political fundraising — 1,484. Campaign and PAC fingerprints: “paid for by,” “chip in.”
- Verification codes — 498. OTPs are worthless minutes after they arrive. Mine had been faithfully “arriving” since 2022.
- Plus the long tail: shipping-status pings (transit updates deleted, receipts untouched), Quora digests, job alerts, webinar and event mail, stale bounce notices — each with its own guardrail, like keeping recent bounces for outreach hygiene.
Nine sweeps, 26,932 emails removed, without touching a single message from a human. This is where the system stops feeling like a chainsaw and starts feeling surgical — and it’s only possible because deletion runs as search, so a “type” is just another query.
Deleting Is the Booby Prize. Filters Are the Win.
If we had only deleted, the inbox would be back in the same state in three years. The durable value came from what happened alongside each deletion:
Filters mean the sender is dead forever. Every sender I marked as junk got a server-side rule created through the API — future mail from them skips the inbox and auto-deletes. Not snoozed, not tabbed. Gone.
Unsubscribes mean the mail stops being sent at all. Because the index captured the List-Unsubscribe header, Claude fired unsubscribes programmatically wherever senders supported it. No hunting for the gray six-point link at the bottom of each email, sixty times.
The registry means good notifications get a future. Seventy of my senders were contact forms and update notices from client websites — and from my own systems — 28,861 messages. That’s mail I actually want arriving; I just didn’t need four years of history. History cleared, every sender recorded in a registry for a proper labeling-and-routing pass later. Deleted junk and valued notifications are different categories, and the system treats them differently.
Steal This Playbook
None of this required custom infrastructure beyond an afternoon of Claude writing scripts against the Gmail API. If your inbox — or your clients’ — looks like mine did, here’s the sequence:
| Step | What you do | Why it matters |
|---|---|---|
| 1 | Profile Message count, total size, and the share that's automated, straight from the Gmail API. |
The number scares you and focuses you |
| 2 | Index metadata only Sender, date, size, labels, and the List-Unsubscribe header. Never download bodies; never leave the server side. |
150MB of index vs. 25GB of mail |
| 3 | Sample, don't census A cross-section of recent years identifies virtually every meaningful sender. Execute deletions by sender search, across all years. |
Saves hours of pointless cataloging |
| 4 | Approve in batches The AI proposes senders with exact counts and identifications; you amend. Keep a written keep list with a reason for every entry. |
The judgment layer is the human layer |
| 5 | Sweep by type Cross-sender searches for dead senders, unread bulk, OTP codes, political mail β keep list excluded, approved like any batch. |
The long tail isn't sender-shaped |
| 6 | Delete + filter + unsubscribe All three in the same pass, per sender. Deletion clears the past; only the other two protect the future. |
Otherwise you're back here in 3 years |
| 7 | Trash, never purge Gmail's Trash holds everything for 30 days. Every decision stays reversible for a month β we've already used it once. |
Turns a scary op into a casual one |
| 8 | Reroute the alerts Before silencing the monitoring senders, build the watcher that files them into your dashboard and escalates the critical ones. |
The important machines still reach you |
Half a million emails sounds like a data problem. It turned out to be a judgment problem wearing a data costume — and that’s exactly the split this partnership is built for. Claude handled the half million. I handled the two hundred decisions hiding inside it.
My inbox is still not empty. But for the first time in twenty years, everything in it is addressed to me.

