email-triage
Skill0 starsChanged 5 months agoMITView on GitHub
Unified multi-mailbox triage and reply for Claude Code / Codex. Fetches unread (or last-N-hours) mail across all your IMAP accounts, classifies it, writes a single Markdown "email digest", and optionally marks the messages read. Use when the user says "triage my email", "check my inbox", "any important mail", "email digest", or asks to draft/send a reply. Pure local: credentials from the macOS Keychain, mail over IMAP/SMTP.
4 other projects use a version of this.
Adopted by
Most recently taken up by
- mariagorskikh/open-instincttheir own version, first seen Oct 5, 2026
- Magnus-Gille/claude-skillstheir own version, first seen Oct 5, 2026
- strikersam/autonomous-ai-agencytheir own version, first seen Aug 30, 2026
- selamy-labs/agent-skillstheir own version, first seen Jul 12, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- mariagorskikh/open-instinct★ 219same name
- strikersam/autonomous-ai-agency★ 9same name
- Magnus-Gille/claude-skills★ 5same name
- selamy-labs/agent-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
We split this skill into the rules it gives an agent
10 rules. 0 are common, 6 are distinctive, and 4 are very specific to this project.
0
Common
Most of the 4 edited versions we read keep these.
6
Distinctive
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 13
Add/remove a mailbox by editing config only — never touch the script.
- Very specific: line 17
If config.json doesn't exist (only config.example.json), or its accounts are still placeholders,
- Distinctive: line 18
walk the user through setup conversationally: instead of erroring:
- Distinctive: line 20
Ask which mailboxes they want to connect (just the email addresses).
- Very specific: line 28
Write config.json (copy from config.example.json, fill accounts + digest_dir).
- Very specific: line 29
Run python3 scripts/mailbox.py healthcheck to confirm every account logs in.
- Distinctive: line 56
Read the JSON, write a one-line summary per message, and bucket each into:
- Distinctive: line 63
Rule: never put marketing in 🔴.
- Very specific: line 65
Write the digest to (expand ~.
- Distinctive: line 85
After confirmation, write a JSON spec file:
“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
email-triage
Fetch mail from multiple mailboxes, classify it, write a Markdown digest, optionally mark read.
Division of labor: scripts/mailbox.py does only IMAP/SMTP I/O (connect / fetch / mark / send);
you (the AI) do the classification and write the digest — that part rides your subscription, no API cost.
Config in config.json (accounts, servers, optional proxy, digest dir, auto_mark_read).
Add/remove a mailbox by editing config only — never touch the script.
First run / onboarding (when config.json is missing or has no real accounts)
If config.json doesn't exist (only config.example.json), or its accounts are still placeholders,
walk the user through setup conversationally instead of erroring:
- Ask which mailboxes they want to connect (just the email addresses).
- For each, fill in the IMAP/SMTP servers — auto-detect from the domain using the table below; ask only if the domain is unknown.
- Tell the user how to get an app password / authorization code for each provider (see table),
and give them the exact Keychain command to run (in their own Terminal, not via the agent):
security add-generic-password -s "email-imap" -a "their@email.com" -U -w - Write
config.json(copy fromconfig.example.json, fillaccounts+digest_dir). - Run
python3 scripts/mailbox.py healthcheckto confirm every account logs in. - Offer to set up the daily schedule (see README → launchd).
Common provider servers (IMAP / SMTP, both SSL — 993 / 465):
| Provider | IMAP | SMTP | App password |
| Gmail / Google Workspace | imap.gmail.com | smtp.gmail.com | Enable 2-Step Verification → App Passwords |
| Outlook / Hotmail / Office365 | outlook.office365.com | smtp.office365.com | Microsoft account → App passwords |
| Yahoo | imap.mail.yahoo.com | smtp.mail.yahoo.com | Account security → Generate app password |
| iCloud | imap.mail.me.com | smtp.mail.me.com | appleid.apple.com → App-Specific Passwords |
| Zoho | imap.zoho.com | smtp.zoho.com | Security → App Passwords |
| imap.qq.com | smtp.qq.com | Settings → enable IMAP → SMS authorization code | |
| NetEase 163 / 126 | imap.163.com / imap.126.com | smtp.163.com / smtp.126.com | Settings → enable IMAP → authorization code |
| Custom domain | ask the host (often Zoho / Google Workspace / cPanel) | — | per host |
Standard flow: produce a digest
1 · Fetch (read-only; does not change read state)
python3 scripts/mailbox.py fetch # unread only
python3 scripts/mailbox.py fetch --since-hours 24 # everything received in the last 24hPrints JSON (one object per message: account/uid/from/date/subject/snippet) and saves the UID
list to state/last_fetch.json for the mark step. Limit to some accounts: --account a@b.com c@d.com.
2 · You classify + write the digest Read the JSON, write a one-line summary per message, and bucket each into:
- 🔴 Action needed — genuinely needs the user (customer mail, billing problems, decisions)
- 🟡 Worth a look — relevant notices (shipping/policy/login alerts, weekly reports)
- 🟢 Self-triggered alerts — security alerts caused by the user's own setup/logins (ignorable; check time/device, don't confuse with real threats)
- ⚪ Marketing / notifications — newsletters, promos; ignorable
Rule: never put marketing in 🔴; when unsure, lean 🟡 rather than burying something important.
Write the digest to (expand ~; create the month subfolder; confirm the dir exists first):
<digest_dir>/<YYYY-MM>/email-digest-<YYYY-MM-DD>.mdLead with a summary (per-category counts) and put 🔴 at the very top.
3 · Mark read (only if config.auto_mark_read is true)
⚠️ Safety order: confirm the digest file is written and non-empty first, then mark.
python3 scripts/mailbox.py mark-read # marks exactly the UIDs from the last fetchHealth check (troubleshooting)
python3 scripts/mailbox.py healthcheck # logs in to each account, reports unread counts
python3 scripts/mailbox.py smtp-test # SMTP login only, sends nothingReply (draft → confirm → send)
- Draft the reply and show it to the user for confirmation — sending is outbound; never auto-send.
- After confirmation, write a JSON spec file:
{"account":"sender@you.com","to":"recipient@x.com","subject":"Re: ...","body":"...", "in_reply_to":"<original-Message-ID>","references":"<original-Message-ID>"} - Send:
python3 scripts/mailbox.py send --spec /tmp/reply.json
Key constraints
- Credentials live in the macOS Keychain: service =
config.keychain_service, account = email address. The script never sees plaintext; the AI never sees the password. - Optional proxy: set
config.proxy{host,port}if your network needs a SOCKS proxy to reach mail servers (e.g. behind a firewall). Connections use remote DNS so they work even when local DNS can't resolve. - Look but don't touch:
fetchuses IMAP read-only (EXAMINE) — reading never marks mail read; onlymark-readchanges state. - NetEase 163 requires an IMAP
IDcommand after login — handled automatically. - Scheduled runs use
scripts/run_daily.sh(see README) withfetch --since-hours 24.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

