Case study · Open source · 2026
Your inbox, minus the noise.
A local, agent-native skill that reads email headers only, files newsletters, promotions and spam, and unsubscribes safely — without reading message bodies and without permanently deleting anything.
Inbox cleaners usually ask for your password, read your mail and delete the evidence. I wanted the opposite: a small local tool that shows the plan first, touches headers only, and can undo every move. CleanYourMail is that tool.
The project is also an experiment in agent-native software. The CLI is the product; SKILL.md and a short prompt teach a coding agent to use it without hiding the safety rules. There is no hosted service, no account, no telemetry and no third-party API.
List-Unsubscribe headers. No bodies, no attachments, no full-mailbox download.plan.json with exact UIDs, destinations and unsubscribe targets. Nothing changes during scan, report or plan.undo restores it.mailto: or a manual link. No body links, redirects, cookies or private/local targets.The workflow is deliberately boring: read, protect, plan, apply, verify, undo if needed.
plan.json with the exact moves and unsubscribe targets.UID EXPUNGE only the source copy. Moves run before any unsubscribe request.X-GM-MSGID for Gmail archive) before restoring.
EXPUNGE. If the server lacks UIDPLUS or MOVE, moves are refused.apply re-checks UIDVALIDITY, flags, category and the protected list before each batch.The interesting part is not what it can do. It is what it refuses to do.
imaplib, smtplib, sqlite3, tomllib.mailto:, manual links and an SSRF guard.X-GM-LABELS and undo via X-GM-MSGID.security.txt, sitemap and no analytics.The hardest part was not classification. It was designing the refusal paths: what to do when the server cannot move safely, when the plan is stale, when the message is protected, or when an unsubscribe target looks hostile. A tool that can say “I will not do that” is more useful than one that can do everything.
A reviewable plan also turned out to be better UX than a hidden automatic action. The person sees the exact moves before anything changes, and the undo journal makes the reversible part real instead of a promise.