Inbox Cleaner

Inbox Cleaner is a just-for-me project I made when I realized my personal email inbox was out of control. It helped motivate me to process a several dozen messages a day for three months and clear out my inbox. It’s a Google Apps script that charts the number of threads in my Gmail inbox against a goal number, and makes a leaderboard of my most-ignored senders, both in Google Sheets.
Use case
I like to keep my email inbox clear and deal with messages as they come in, and archive or delete them when I’m done. But I’d fallen deeply behind on my personal email inbox a few years ago and never dug myself out.
Realizing I had almost 4,000 unprocessed threads, I considered declaring email bankruptcy and moving on. But I wanted to build up my muscle of handling incoming messages each day, to unsubscribe from newsletters and marketing I didn’t want, and to build a list of people I want to be in touch with—and who I’ve ignored for far too long.
So I wanted to set a goal and track my progress toward it. I gave myself 90 days to process about 50 threads a day (on average, some days more, some days less).
To help me, Inbox Cleaner generated:
- A line chart of that day’s current total threads against my goal number of threads. Inbox Cleaner updated this chart automatically every morning.
- A leaderboard of most-ignored senders sorted by number of messages in my inbox, to help me clear out large batches at a time—especially things like newsletters, marketing, and automated system messages. I ran this function manually when I was ready for a fresh list and a session of satisfying batch deletions.
Whenever I worked on cleaning my inbox, I’d check the chart and set my goal for the day—50 or more messages. To speed up the process, I’d work my way through the most-ignored list, deleting or archiving batches of messages and unsubscribing from or moving newsletters to my RSS reader as I went.
Screenshots
Inbox Cleaner updated a spreadsheet with three tabs: one with the line chart data, the other with the line chart, and the last with my most-ignored senders.
Rationale
I’m a simple cavewoman who loves charts. Gamifying my inbox cleanout and pitting myself against the line that kept going down in a year-end sprint to zero worked. I emptied my inbox for the first time in 3 years using this.
How I built it
Because I’m using Google Workspace, writing an Apps Script to talk to Gmail and insert data into Google Sheets on a schedule was super-simple and only took a couple of functions to work. I used ChatGPT to present the problem and get some possible approaches.
Here was my first prompt:
I’ve got almost 4000 emails in my personal inbox from the last 3 years, and I want to get to inbox zero. Declaring email bankruptcy isn’t an option; I know there are messages I’d like to review, file, maybe even respond to late. There are also a bunch of things I want to unsubscribe from. I’d like to make a plan to knock this number down to 0 by Jan 1st, 2026. Ideally I can get this number down by 400 emails per week, including any new incoming email. I’d like to track my progress as I go. I want to be able to capture the current number of email messages in my inbox each day at say 9am, and log it into a Google Sheet. Then I want a line chart showing me my goal number of messages per day charted against the actual number of messages in my inbox that day. How could I go about doing this?
ChatGPT offered a couple of options, a Google Apps Script as the first one, and wrote it when I approved. I reviewed, copied and pasted the script into a new sheet, and ran it, troubleshooting bugs and adding on the leaderboard capability as I started to clean. Apps Scripts have timeout restrictions and Gmail API calls can take a long time to complete, so I did run into execution time-outs when my inbox was in the thousands, which I fixed by manually dialing down the number of threads to process per run.
Notes
I forgot how much was possible with low effort when you link together Google products with Apps Scripts. I’m going to keep this script’s daily schedule running to see how I do keeping my inbox clear going forward.
Back to Projects