Borrowing it
Nothing to install: this file belongs to tuoc1226-maker/EmailMCP. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/tuoc1226-maker/EmailMCP/main/.claude/commands/clean-email.mdgit clone --depth 1 https://github.com/tuoc1226-maker/EmailMCPWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/commands/tuoc1226-maker/emailmcp/clean-email)<a href="https://agentmods.dev/commands/tuoc1226-maker/emailmcp/clean-email"><img src="https://agentmods.dev/badge/commands/tuoc1226-maker/emailmcp/clean-email.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00021 | $0.00998 |
| Opus 5 | $0.00010 | $0.00499 |
| Sonnet 5 | $0.00004 | $0.00200 |
| Haiku 4.5 | $0.00002 | $0.00100 |
Grade A, and why
clean-email scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
This is a copy
100% identical to clean-email — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.
How it starts
The opening of the file, as written. The whole thing — 102 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Clean My Email
You are an email triage assistant. Use the IMAP MCP tools to clean junk/spam folders across all connected email accounts.
Setup
- Blocklist location:
config/blocklist.jsonin this project directory (/Users/marlinjai/software dev/clean-my-email/) - MCP Server:
imap(nikolausm/imap-mcp-server with multi-account support)
Workflow
1. Load blocklist
Read config/blocklist.json from the project directory. This contains domains whose emails should be auto-deleted without classification.
2. Connect to all accounts
Use imap_list_accounts to see available accounts. For each account, use imap_connect to ensure it's connected.
3. For each account, process junk/spam folder
Use imap_list_folders to find the junk/spam folder for the account. Common names:
- Gmail:
[Gmail]/Spam - iCloud:
Junk - Outlook:
Junk Email
Use imap_search_emails on the junk/spam folder to get recent emails (last 7 days). If there are many, process in batches of 20.
4. Pre-filter: Auto-delete blocklisted domains
For each email, extract the sender's domain. If it matches a domain in blocked_domains, delete it immediately using imap_delete_email. Count these as "auto-deleted".
5. Classify remaining emails
For each remaining email, use imap_get_email to read its content. Classify it into one of:
-
JUNK: Obvious spam, scams, phishing, unwanted marketing from unknown senders → Delete using
imap_delete_email→ Add sender domain toblocked_domainsin blocklist -
NOT JUNK: Legitimate email that was incorrectly flagged as spam → Use
imap_send_emailto forward the email content to the user's own inbox address with subject prefix "[Rescued from Spam] " → Delete the original from spam usingimap_delete_email→ Print a summary: sender, subject, brief description of contents -
PROMOTION/NEWSLETTER: Legitimate promotional or newsletter content → Use
imap_list_foldersto find a matching promotions folder → If a matching folder exists and move is possible, describe what folder it belongs in → If no matching folder, leave it and note it in the report → Do NOT add to blocklist (these are opted-in)
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 5d ago First seen · 102 lines · 21 tokens per session scan A b11d9ee0c189
clean-email is a command published in the GitHub repository tuoc1226-maker/EmailMCP (0 stars, last pushed 2mo ago), licensed MIT. It adds 21 tokens to every session and 998 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to clean-email, differing in 0 lines, and is treated as a copy.
Other commands, from other repositories
cancel-ralph
Cancel active Ralph Loop.
obsidian-recap
Summarize a time period from the vault - today, week, or month.
setup-pm-skills
Onboard a new user — find out what they do, recommend the right bundles & top skills, and set up a project CONTEXT.md so every skill is tailored to them.
statusbar-style
Switch the status-bar style (classic / capsule / hairline).
engage.actions
Execute Phase 7 - Actions on Objectives and Goal Achievement.
superpowers-execute
Execute the current GSD phase plan with Superpowers instead of gsd-execute-phase.