apple-mail

apple-mail is a skill for Claude Code, Codex from dineshdb/pie. It costs 20 tokens per session (432 once invoked), scanned A, original, MIT.

A command-line tool for searching, reading, and sending messages through Apple Mail. It communicates with the Mail app using macOS automation.

In plain words
What is it for?
Use it to search mail by sender, subject, mailbox, date, or status; read matching messages; list accounts; and send emails.
Why use it?
It lets an agent work with configured Mail accounts without manually opening messages or relying on direct mailbox database access.

Skill for Claude CodeCodex

Install

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.

agentmods
npx agentmods add skills/dineshdb/pie/apple-mail
Any agent
npx skills add dineshdb/pie --skill apple-mail
Clone the repo
git clone --depth 1 https://github.com/dineshdb/pie

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for apple-mail

README.md
[![agentmods](https://agentmods.dev/badge/skills/dineshdb/pie/apple-mail.svg)](https://agentmods.dev/skills/dineshdb/pie/apple-mail)
Your own site
<a href="https://agentmods.dev/skills/dineshdb/pie/apple-mail"><img src="https://agentmods.dev/badge/skills/dineshdb/pie/apple-mail.svg" alt="Measured on agentmods" height="20"></a>
Per session 20 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 432 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5 $0.00020 $0.00432
Opus 5 $0.00010 $0.00216
Sonnet 5 $0.00004 $0.00086
Haiku 4.5 $0.00002 $0.00043

Measured 4d ago against content hash b9281f319786, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

apple-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.

The scan reads SKILL.md. This mod also ships 1 executable file (bin/mail.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

.pie/skills/apple-mail/SKILL.md · 72 lines

What it actually says

Apple Mail

Search, read, and send emails through Apple Mail via osascript IPC. Routes through Mail.app's own process — no Full Disk Access needed.

Use --md for markdown rendering.

Usage

mail.py <command> [options] --md

search

mail.py search --from "newsletter@" --limit 10
mail.py search --mailbox "INBOX" --unread
mail.py search --subject "weekly" --after 2026-01-01

Flags: --from, --subject, --mailbox, --after, --before, --unread, --flagged, --limit N

Output: pipe-delimited id|sender|subject|date

read

mail.py read <message_id>

Message ID is the Apple Mail message id string from search output.

send

mail.py send --to "[email protected]" --subject "Hello" --body "..."
mail.py send --to "[email protected]" --subject "Hello" --body-file body.txt
echo "body" | mail.py send --to "[email protected]" --subject "Hello"

accounts

mail.py accounts

Lists configured Mail accounts (name, type, emails).

perm

mail.py perm

Opens System Settings → Privacy & Security → Full Disk Access. (Not required for osascript commands, only for any SQLite-based tools.)

Notes

  • Search only scans the specified mailbox (default: INBOX)
  • Message IDs are Apple Mail message id strings (not ROWIDs)
  • --from and --subject are substring filters applied in AppleScript
  • Mail.app must be running or launchable
  • No TCC prompts — uses Apple Events IPC, not direct file access
Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

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.

  1. 4d ago First seen · 72 lines · 20 tokens per session scan A b9281f319786

Subscribe to this mod's changes

apple-mail is a skill published in the GitHub repository dineshdb/pie (2 stars, last pushed 3mo ago), licensed MIT. It adds 20 tokens to every session and 432 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.

Related

Other skills, from other repositories

release

Create a new versioned release with changelog. Bumps version in code, updates CHANGELOG.md, commits, tags, and pushes using the repository release flow. GitHub Actions creates the release and uses only the current changelog section as release notes. Use when the user says "release", "cut a release", "bump version"…

genai-io/san · 75 tokens

qa

Regression test a San feature by name. Looks for a feature doc in docs/reference/ or docs/packages/2-feature/, runs automated Go tests and interactive tmux tests, then produces a pass/fail report. Use this skill when the user says "qa", "regression test", "test feature X", "verify feature", or references a feature…

genai-io/san · 85 tokens

openspec-explore

Enter explore mode - a thinking partner for exploring ideas, investigating problems, and clarifying requirements. Use when the user wants to think through something before or during a change.

KunAgent/Kun · 39 tokens

pi-sync

Daily upstream-sync job for the pi Go port — fetch upstream pi, triage every change since the recorded pin, port what's in scope, verify idiomatic + parity via independent reviews, update the ledger, and push. Use for "sync with upstream", "porting job", or as the scheduled daily run.

sky-valley/pi · 66 tokens

proactive-agent

Transform AI agents from task-followers into proactive partners that anticipate needs and continuously improve. Now with WAL Protocol, Working Buffer, Autonomous Crons, and battle-tested patterns. Part of the Hal Stack 🦞.

MerkyorLynn/Lynn · 46 tokens

openspec-apply-change

Implement tasks from an OpenSpec change. Use when the user wants to start implementing, continue implementation, or work through tasks.

KunAgent/Kun · 31 tokens