apple-mail

apple-mail is a skill for Claude Code, Codex from YunjueTech/Yunjue-Agent. It costs 33 tokens per session (1,452 once invoked), scanned A, original, Apache-2.0.

A macOS integration for Apple Mail that lets an agent work with email messages and mailboxes through commands.

In plain words
What is it for?
Use it to refresh inboxes, list or search messages, read and manage email, send messages, reply, and inspect accounts or mailboxes.
Why use it?
It avoids switching between an agent and the Mail app for common email tasks.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to refresh inboxes, list or search messages, read and manage email, send messages, reply, and inspect accounts or mailboxes.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/yunjuetech/yunjue-agent/apple-mail
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.

Any agent
npx skills add YunjueTech/Yunjue-Agent --skill apple-mail
Clone the repo
git clone --depth 1 https://github.com/YunjueTech/Yunjue-Agent

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/yunjuetech/yunjue-agent/apple-mail/github.svg)](https://agentmods.dev/skills/yunjuetech/yunjue-agent/apple-mail)
Your own site
<a href="https://agentmods.dev/skills/yunjuetech/yunjue-agent/apple-mail"><img src="https://agentmods.dev/badge/skills/yunjuetech/yunjue-agent/apple-mail/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for apple-mail

Your own site · 80×15
<a href="https://agentmods.dev/skills/yunjuetech/yunjue-agent/apple-mail"><img src="https://agentmods.dev/badge/skills/yunjuetech/yunjue-agent/apple-mail.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 33 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,452 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00033 $0.01452
Opus 5.5 $0.00013 $0.00581
Sonnet 5.5 $0.00007 $0.00290
Haiku 4.5 $0.00003 $0.00145

Measured 1mo ago against content hash 5e3be8c7b5a4, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo 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.

example/cli/skills/apple-mail/SKILL.md · 165 lines

How it starts

The opening of the file, as written. The whole thing — 165 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Apple Mail

Interact with Mail.app via AppleScript and SQLite.

Commands

Command Usage
Refresh mail-refresh [account] [wait_seconds]
List recent mail-list [mailbox] [account] [limit]
Search mail-search "query" [mailbox] [limit]
Fast search mail-fast-search "query" [limit]
Read email mail-read <message-id> [message-id...]
Delete mail-delete <message-id> [message-id...]
Mark read mail-mark-read <message-id> [message-id...]
Mark unread mail-mark-unread <message-id> [message-id...]
Send mail-send "[email protected]" "Subject" "Body" [from-account] [attachment] ¹
Reply mail-reply <message-id> "body" [reply-all]
List accounts mail-accounts
List mailboxes mail-mailboxes [account]

Refreshing Mail

Force Mail.app to check for new messages:

mail-refresh                    # All accounts, wait up to 10s
mail-refresh Google             # Specific account only
mail-refresh "" 5               # All accounts, max 5 seconds
mail-refresh Google 0           # Google account, no wait

Smart sync detection:

  • Script monitors database message count
  • Returns early when sync completes (no changes for 2s)
  • Reports new message count: Sync complete in 2s (+3 messages)

Notes:

  • Mail.app must be running (script will error if not)
  • mail-list does NOT auto-refresh — call mail-refresh first if you need fresh data

Output Format

List/search returns: ID | ReadStatus | Date | Sender | Subject

  • ● = unread, blank = read

Gmail Mailboxes

⚠️ Gmail special folders need [Gmail]/ prefix:

Shows as Use
Spam [Gmail]/Spam
Sent Mail [Gmail]/Sent Mail
All Mail [Gmail]/All Mail
Trash [Gmail]/Trash

Custom labels work without prefix.

Fast Search (SQLite)

✨ Now safe even if Mail.app is running — copies database to temp file first.

mail-fast-search "query" [limit]  # ~50ms vs minutes

Read the full file on GitHub · 165 lines

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. 1mo ago First seen · 165 lines · 33 tokens per session scan A 5e3be8c7b5a4

Subscribe to this mod's changes

apple-mail is a skill published in the GitHub repository YunjueTech/Yunjue-Agent (542 stars, last pushed 7mo ago), licensed Apache-2.0. It adds 33 tokens to every session and 1,452 once invoked, about $0.0001 per session on Opus 5.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-30.