A few days ago, I needed to find an old email in a Gmail account I had barely touched for years.
Opening the inbox was overwhelming.
It contained 77,502 emails, including 72,356 unread messages. Important conversations were buried beneath newsletters, promotions, job alerts, receipts, and automated notifications.
Manually reviewing tens of thousands of emails was not realistic, and deleting everything was not an option.
Instead, I used Codex with a connected Gmail workflow to analyze the mailbox, design a safer organization system, and clean up the inbox in controlled stages.
Understanding the problem
Before changing anything, I asked Codex to analyze the mailbox and identify where most of the volume was coming from.
The analysis revealed that more than 92% of the mailbox consisted of updates and promotions.
That changed how I approached the cleanup.
The real problem was not simply the number of emails. It was that high-priority conversations and low-priority notifications were competing for the same space.
The inbox needed structure before it needed deletion.
The system behind it
The prompts I used
The workflow was driven by a small set of prompts:
How many emails are in my mailbox?
Analyze my mailbox and suggest how to organize it using labels, rules, and a cleanup schedule.
Start with labels and archive first.
The most important instruction was:
Start with labels and archive first.
That constraint kept the workflow controlled and reversible.
Archiving removed messages from the inbox without deleting them, while labels made it easier to review what had been classified before taking stronger action.
Rules and label structure
I used a few simple rules based on Codexβs recommendations and my own preferences to reduce the risk of removing something important:
- Keep Finance and Security emails visible
- Archive newsletters, job alerts, and routine notifications
- Exclude starred and important messages
- Preserve the original read and unread state
- Keep cleanup actions reversible
Instead of organizing messages only by sender, I grouped them according to what I might need to do next:
Action/FinanceAction/SecurityCareer/Job AlertsReading/TechCleanup/30 Days
This made the labels more useful.
A sender-based label tells me where an email came from. An action-based label tells me why the email still matters.
The results
After applying the workflow, the inbox became significantly smaller and easier to navigate.
The inbox was reduced from 77,502 to 28,745 emails, a 62.7% reduction.
During the cleanup:
- 48,296 emails were archived
- 461 emails were moved to Trash
- Read and unread states were preserved
- Finance and security emails remained visible
- No permanent bulk deletion was performed
The goal was not to erase years of email history.
It was to remove low-value messages from the inbox while keeping useful information searchable and recoverable.
Final takeaway
The biggest improvement was not simply archiving 48,296 emails.
It was turning an abandoned inbox into a system where:
- Important messages remain visible
- Useful emails remain searchable
- Routine notifications leave the inbox
- Low-value messages become easier to review
- Future cleanup becomes more manageable
Codex helped handle the scale, but the workflow succeeded because the prompts were clear, the actions were staged, and the important decisions remained reversible.
This article was created with AI assistance



Top comments (0)