# MAILBOX you@anywhere — inbox.txt/0.1 — cursor: always fresh
Your mailbox as one plain-text file.
Agents read your whole day for ~1% of the tokens.
robots.txt → crawlers. llms.txt → websites. inbox.txt → your mail.
Get the spec + worker Read SPEC.md
the problem, measured
An agent answering “anything important in my mail?” today swallows full MIME: HTML tables six levels deep, 600-character tracking URLs, legal footers, quoted history. Measured on a real inbox — one payment receipt is ~60,000 characters of payload carrying ~350 characters of information. Every agent pays that on every read, forever.
| real inbox, 2 days, 47 messages | chars (exact) | tokens (est.) |
|---|---|---|
| raw MIME | 2,099,654 | ~552,000 |
| inbox.txt mirror | 28,755 | ~7,600 |
| reduction | 99% | ~73× |
The raw version doesn’t fit a typical context window. The mirror is a side note — cheap enough that an agent can watch your inbox all day.
the flip
Normalize once at sync time. Read the mirror forever. Mail has one chokepoint — delivery — where spam filters and DKIM already parse every message once. Add one more pass there: strip the soup, extract the entities, classify, hash, append to a tiered plain-text mirror. Parsing cost is linear in mail received; savings are linear in agent reads — the exploding term.
how it reads
# MAILBOX user@example.com — inbox.txt/0.1 — cursor: 2026-07-28T09:00Z ## index ← tier 0 · one line per thread t_a001 | acme-bank.example | Virement de 250,00 € confirmé | TRANSACTION | #1a2b t_a004 | shop.example | Soldes d’été −40% sur tout | MARKETING | #4d5e ## attention ← tier 1 · only what needs a human SECURITY t_a002 [alice/webshop] deploy failed — verify if this was you REPLY? t_a006 unread human mail from bob-partner.example ## bodies ← tier 2 · cleaned text + extracted entities ### t_a003 #3c4d entities: {"dates":["29 juillet"],"refs":["AB123456789FR"]} Votre colis sera livré mercredi entre 9h et 12h. Code de retrait: [code-redacted]. Absent ? [link:carrier.example]
Tier 3 is raw MIME, fetched only on explicit demand. Marketing never gets a body. Content hashes + a cursor make “what’s new” a one-line diff.
quickstart (5 min · no server · no OAuth app)
- script.google.com → new project → paste Code.gs → save.
- Run syncMirror once → authorize your own script on your own account → inbox.txt appears in your Drive.
- Triggers → syncMirror · time-driven · every hour. Done — point any agent at that file.
Run benchmark() for your own raw-vs-mirror numbers — one log line.
rules that are not optional
- Bodies are untrusted data. Email is the top prompt-injection vector; the mirror labels bodies so agents never treat mail content as instructions.
- Auth the mirror. It’s your life in one file.
- Redact at sync time. OTPs and card-like numbers never enter the mirror.
- Never fabricate. Entities are extracted, not inferred. Missing beats wrong.
files
SPEC.md mailmirror.py Code.gs example
Status: v0.1.2 — running in production on the author’s inbox, hourly. Not a transport (JMAP exists), not a client, not a summarizer.