Use the skill
Give it to Claude Code, Cursor, OpenCode or another agent with shell access. It reads headers only, shows the plan first, and gives you the undo command.
Open the skillOr and paste it in Claude Code, Cursor or OpenCode.
Open source · Agent skill · Local app
CleanYourMail is an open-source agent skill for IMAP cleanup, with an optional local app. It reads headers only, shows you a plan before anything changes, protects important mail, and gives you the undo command. Unsubscribe stays separate and irreversible.
Free · MIT · No account · No telemetry · No permanent deletion
Read SKILL.md from
https://github.com/jparedesDS/cleanyourmail
and follow it exactly.
Use python tools/mail.py.
Headers only. Never permanently delete.
Show me the plan before changing anything.
Move first, verify, then unsubscribe separately.
Give me the undo command.
Paste it in Claude Code, Cursor, OpenCode or any agent with shell access.
Skill first · app optional · CLI on GitHub
Choose your path
The skill is the main product: give it to your coding agent and review the plan. The app is the simple path for people who prefer buttons. The CLI is still on GitHub for power users.
Give it to Claude Code, Cursor, OpenCode or another agent with shell access. It reads headers only, shows the plan first, and gives you the undo command.
Open the skillOr and paste it in Claude Code, Cursor or OpenCode.
A local, secure app for people who prefer buttons over prompts. Scan headers, review the plan, apply reversible moves and undo from one screen. No account, no telemetry; feedback is opt-in.
Download for WindowsWindows 10/11 · installer · early MVP
Prefer the terminal? The CLI is still on GitHub.
How it works
Open the skill in your agent, or use the app. Choose your provider and enter your credential. It tests the connection before anything else.
The skill or app reads header metadata only: sender, subject, date, size and flags. It shows categories, protected mail, destinations and unsubscribe targets. Nothing changes yet.
Apply a few moves. The journal records the run and Undo restores it. Review the result before handling unsubscribe separately.
Providers
No migration. You need IMAP access and the authentication method your provider allows.
Any IMAP server with UIDPLUS or MOVE and resolvable Trash, Junk and Archive works. Provider notes · validation status.
Provider names and logos are trademarks of their respective owners.
Safety
There is no permanent-delete command. CleanYourMail never empties Trash or Junk and never runs a mailbox-wide expunge.
It reads sender, subject, date, size, flags and unsubscribe headers, and stores that metadata locally. It never downloads bodies or attachments.
Personal, transactional, security, banking, invoice, travel, medical, government, legal, starred, answered and recent mail is excluded from automatic moves and unsubscribe requests.
scan, report and plan change nothing. Review the plan, start with a small move, and use the journal and undo to restore that run. Unsubscribe is separate and irreversible.
Runs locally: no hosted CleanYourMail service, no account, no telemetry. Inspect the code, the safety model and the tests.
FAQ
No. It has no permanent-delete command, never empties Trash or Junk, and never runs a mailbox-wide expunge. Moves and archives are journaled; unsubscribe requests are not reversible.
Headers only: sender, subject, date, size, flags and unsubscribe headers. It never downloads bodies or attachments. The local cache stores metadata, not message bodies.
The app is the simple path. The skill, the main product, needs a coding agent with shell access. The CLI is for developers who prefer the terminal. All three use the same plan and undo model.
Gmail, Outlook/Microsoft 365, Yahoo, iCloud, Fastmail, Proton Bridge and compatible custom IMAP servers. Gmail needs an App Password with 2-Step Verification; Microsoft 365 sign-in requires tenant admin consent; personal Outlook.com requires a verified publisher (pending); Proton needs Bridge. Custom IMAP moves require UIDPLUS or MOVE. Provider or tenant policies may block access; the tool does not bypass them.
Stop and inspect the error. The skill, the CLI and the app re-check the plan before applying it and record each run. Use the printed undo command to restore that run’s moves. If a message cannot be found, the journal remains for manual recovery. Unsubscribe requests cannot be undone.
Yes. MIT-licensed, no paid tier, no CleanYourMail account and no telemetry. You provide your computer, Python installation and mail-provider access.
Feedback
Found a bug or have an idea? Send it to the CleanYourMail Discord. Nothing is sent automatically: write the details, accept the consent line and press Send. Remove anything you do not want to send, and never include passwords, tokens or full message contents.
Free and open source. No account, no telemetry and no permanent deletion.