The first time I let AI clean up my Gmail, it was fast. Too fast: invoices ended up in the trash. Claude didn't make a mistake, it did exactly what I told it to. I just told it the wrong thing.
I'll show you how to tell it the right thing. You connect Gmail to Claude, give it clear rules about what it can and can't do, and finally turn it into a routine that sorts your mail on its own every morning. No API keys, the connector inside Claude is enough.
The rule everything stands on
Clean up, yes. Delete blindly, no.
Claude can sort mail into labels and archive it. Both are reversible, you can find an archived email any time. It can only delete from a list it shows you first for approval. Nothing goes to the trash unless you approve it yourself.
Why so strict? The Gmail trash is only reversible for thirty days. If you don't notice in time, the invoice is gone.
What you need
- Claude Code with the Gmail connector.
- The Tidy inbox skill. It's free in the tools. It contains a skill and four text files with prompts.
Step 1: install the skill
Open Claude Code, drag the whole folder from the package into it (or just the ZIP) and type:
Install this email skill for me.Claude asks whether you want it just for this project or for all of them. If
you're not sure, pick all. Then close and reopen Claude Code, or type /clear,
so the skill loads.
Step 2: connect Gmail through the connector
In Claude, open the settings, go to Connectors and pick Gmail. When you sign in, choose the right account. If you've connected Gmail before, click Reconnect and choose the account again.
You do the sign-in, not Claude. You type the passwords yourself and Claude never sees them.
When you sign in, check every permission offered. Otherwise the connector may only be able to read on some accounts, and then Claude can't archive or label anything.
Step 3: restart, don't skip this
After connecting, close Claude and open it again. Without a restart it doesn't know about the new connector. It takes a few seconds, so don't skip it.
Then check that the connection works:
Show me my 3 most recent emails.If you can see senders and subjects, you're good to go.
Step 4: run your first cleanup
With the skill installed, you can just type "Clean up my Gmail." If you want to have the rules right in front of you, or you don't want to install the skill, paste this prompt from the package:
Clean up my Gmail. Rules:
1. First only read and sort, don't delete anything.
2. Three drawers, no more:
- Invoices (invoice, receipt, order, bank, government office, contract) = KEEP, label "Invoices"
- Newsletters (bulk emails, discounts, notifications) = archive, label "Newsletters"
- Everything else (written by a person, waiting for a reply) = keep, label "To reply"
Invoices win over newsletters. If you're not sure, keep the email and list it for me under "Not sure".
3. Nothing goes to the trash unless I approve it. Build a list (sender, subject, date, why)
and wait for my "yes". Only then delete, and only what I approved.
4. Work in batches of ~100 emails and keep telling me how many unread are left.
5. At the end, a summary: before / after, how many in each drawer, what's under "Not sure".If you just want to sort your mail and not change anything yet, the package
also has a variant called tri-supliky.txt. It doesn't delete or archive
anything, it only adds labels.
Why three drawers
More drawers means more mistakes. Three is enough:
- Invoices stay in the inbox with a label and never go to the trash.
- Newsletters get archived. The archive costs nothing.
- Everything else stays, and whatever is waiting for a reply gets a label.
The order matters. An online shop sends you discounts and invoices from the same address. That's why invoices win over newsletters: if an email has an amount, an order number or a PDF attachment, it belongs with the invoices, even if it looks like an ad.
And when Claude isn't sure, it leaves the email alone and lists it under "Not sure". Better one extra email in the inbox than one gone.
Step 5: go through the list before deleting anything
Once Claude finishes sorting, it shows you a list of trash candidates. For each email you see who it's from, what it's about and, most importantly, why it should go. Go through the whole thing. The first cleanup takes longer, the next ones will take a minute.
If you find something on the list that shouldn't be there, don't approve it, and tell it:
This is an invoice, keep it, label Invoices.You can talk to Claude normally, like a colleague. After the cleanup, feel free to ask it something like "Did you archive anything from Vojta?" and it lists all the archived emails that match.
Step 6: cleanup every morning at seven
An automation is one thing that repeats, plus an alarm clock that starts it for you. Paste this prompt from the package into Claude:
Set up a scheduled task that cleans up my Gmail every day at 7:00 using the poradek-v-mailu skill:
- sorts into three drawers (Invoices / Newsletters / Everything else), labels, archives newsletters
- deletes NOTHING: only lists trash candidates, I'll approve them when I sit down at the computer
- sends me a 5-line morning summary: how many came in, how many invoices, how many to reply to,
what's under "Not sure", what's waiting for trash approvalNotice the second bullet. Even the morning task doesn't delete anything. When it runs without you, the trash candidates wait in the summary until you approve them.
tip
If scheduled tasks in Claude don't work for you, ask it to create the task in
Windows Task Scheduler instead. The steps are in the package, in the file
kdyz-to-nejde.txt.
What to watch out for
Model and tokens
My mistake, I admit it: I didn't notice which model the cleanup was running on, and it ran on the strongest model at maximum. It burned a pile of tokens and worked in a needlessly complicated way. For sorting mail, Sonnet at medium effort is enough.
An old inbox takes time
I gave Claude a Gmail account that had been collecting mostly junk for years. It took a long time, but the result was worth it: the inbox is practically empty and the archive only holds things that really don't matter. Expect the first cleanup to take a while.
The connection expires after a while
If it was working and suddenly Claude can't get into your mail, disconnect Gmail and connect it again. It takes a minute.
Check the archive in the first week
An invoice can hide in an email that looks like a newsletter. The drawer order rule mostly takes care of that, but in the first week, go through the Newsletters archive yourself.
What next
You can automate almost anything the same way. A task can run every hour, every day or once a week, depending on what you need from it. Email is just the first example.
If Claude ever offers to delete something it shouldn't, tell me under the video. I want to see where it goes wrong, and I'll add it to the skill.
The whole process live: Video for this guide (the video is in Czech). The package is available for download in the tools. You can clean up your files just as safely too, see cleaning up the Downloads folder.
Kafe a cígo, fajně si sednout a jdeme na to.
Coffee and a smoke, get comfy and let's go.
Vojta Horava
Want to know when the next one is out?
Now and then I write about what's new: a video, a tool, an article. Unsubscribe with one click.
