Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add commands/omarshahine/apple-pim/mailgit clone --depth 1 https://github.com/omarshahine/apple-pimWrote 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/omarshahine/apple-pim/mail)<a href="https://agentmods.dev/commands/omarshahine/apple-pim/mail"><img src="https://agentmods.dev/badge/commands/omarshahine/apple-pim/mail.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 | $0.00027 | $0.02095 |
| Opus 5 | $0.00014 | $0.01047 |
| Sonnet 5 | $0.00005 | $0.00419 |
| Haiku 4.5 | $0.00003 | $0.00210 |
Grade A, and why
mail 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 4d 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.
How it starts
The opening of the file, as written. The whole thing — 196 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Mail Management
Manage macOS Mail.app messages. Reads (accounts, mailboxes, messages, get, search) use a fast direct-SQLite path against Mail's local Envelope Index (milliseconds, works with Mail.app closed, needs Full Disk Access) and fall back to JXA automatically. Mutations and content search go through Mail.app via JXA/AppleScript, which requires Mail.app to be running.
Available Operations
When the user runs this command, determine which operation they need and use the mail tool with the appropriate action:
List Accounts
Use mail with action accounts to show all configured mail accounts.
List Mailboxes
Use mail with action mailboxes to list mailboxes with unread and total message counts:
- Optional:
account(filter by account name)
List Messages
Use mail with action messages to list messages in a mailbox:
- Default mailbox: INBOX
- Parameters:
mailbox,account,limit(default: 25),filter(unread, flagged, all)
Get Message
Use mail with action get to get a single message with full body content:
- Required:
id(RFC 2822 message ID) - Optional:
mailbox,account(hints for faster lookup) - Optional:
format(plaindefault, ormarkdownfor HTML-to-markdown conversion)
Search Messages
Use mail with action search to find messages by subject, sender, or content:
- Required:
query(search term) - Optional:
field(subject, sender, content, all),mailbox,account,limit,since(ISO 8601 date)
Send Message
Use mail with action send to send an email through Mail.app:
- Required:
to(array of recipient addresses),subject(email subject),body(plain text body) - Optional:
cc,bcc,from(sender address for account selection) - Uses AppleScript to compose and send via Mail.app's outgoing message
Reply to Message
Use mail with action reply to reply to a message with proper threading:
- Required:
id(RFC 2822 message ID),body(reply text) - Optional:
mailbox,account(hints for faster lookup) - Uses Mail.app's
replyverb which sets In-Reply-To, References headers, and quotes the original
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.
- 4d ago First seen · 196 lines · 27 tokens per session scan A ca2506e46711
mail is a command published in the GitHub repository omarshahine/apple-pim (50 stars, last pushed today), licensed MIT. It adds 27 tokens to every session and 2,095 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other commands, from other repositories
prep-for-task
Bootstrap context for a new session on the rem project. Run this BEFORE starting any implementation work.
journal
Write a journal entry for today's work session on the rem project.
release
Create a new release for the rem project.
app
Control macOS apps via peekaboo app.
mcp
Run Peekaboo as an MCP server via peekaboo mcp.
drag
Execute drag-and-drop flows via peekaboo drag.