apple-mail

apple-mail is a skill for Claude Code from eins78/agent-skills. It costs 66 tokens per session (3,551 once invoked), scanned A, original, MIT.

A read-only Apple Mail search tool for checking messages and finding or saving attachments. It can query Mail.app or search stored email files directly.

In plain words
What is it for?
Use it to search or read Apple Mail, find older messages, list attachments, and save attachments. It cannot send or modify emails.
Why use it?
It helps locate messages and attachments in one or more mail archives without changing or sending email.

Skill for Claude Code

Written for Claude Code: ${CLAUDE_SKILL_DIR} variable. Also seen: positional $N argument; mentions Claude Code.

Part of the eins78-skills plugin — 15 skills shipped together

Good fit Use it to search or read Apple Mail, find older messages, list attachments, and save attachments. It cannot send or modify emails.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/eins78/agent-skills/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 eins78/agent-skills --skill apple-mail
Clone the repo
git clone --depth 1 https://github.com/eins78/agent-skills

Made for: Claude Code.

Or install eins78-skills, the plugin that ships this one along with the rest of its 15 skills.

Its marketplace also offers this one on its own, as the plugin apple-mail/plugin install apple-mail after adding the marketplace above.

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/eins78/agent-skills/apple-mail/github.svg)](https://agentmods.dev/skills/eins78/agent-skills/apple-mail)
Your own site
<a href="https://agentmods.dev/skills/eins78/agent-skills/apple-mail"><img src="https://agentmods.dev/badge/skills/eins78/agent-skills/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/eins78/agent-skills/apple-mail"><img src="https://agentmods.dev/badge/skills/eins78/agent-skills/apple-mail.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 66 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,551 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.00066 $0.03551
Opus 5 $0.00033 $0.01775
Sonnet 5 $0.00013 $0.00710
Haiku 4.5 $0.00007 $0.00355

Measured 9d ago against content hash cb5f3b9770b9, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, 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 9d ago.

The scan reads SKILL.md. This mod also ships 2 executable files (scripts/emlx.py, tests/test-emlx.sh), 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.

skills/apple-mail/SKILL.md · 324 lines

How it starts

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

Apple Mail (Read Only)

Read email two ways: Mail.app AppleScript for live state and attachments, and ripgrep over the on-disk .emlx files for searching large archives. No sending or modifying emails.

Prerequisites

AppleScript path:

  • Mail.app running and logged in
  • Automation permissions granted (System Settings → Privacy & Security → Automation → Terminal/Claude Code → Mail)
  • If first access attempt times out, ask user to check for macOS permission dialog

Archive-search path: Full Disk Access for the calling terminal app (System Settings → Privacy & Security → Full Disk Access). Mail.app need not be running.

Reliability: always wrap osascript with timeout + retry

Apple Mail's AppleScript bridge hangs intermittently — sometimes for minutes — even on simple queries. The AppleScript-internal with timeout of N seconds does NOT kill a wedged osascript process. Always wrap calls with shell-level timeout and retry on failure.

Pattern:

# Run osascript with 15s shell timeout, retry up to 3 times with 2s backoff.
mail_query() {
  local script="$1" attempt
  for attempt in 1 2 3; do
    result=$(timeout 15 osascript -e "$script" 2>&1) && { echo "$result"; return 0; }
    sleep 2
  done
  echo "ERROR: Mail query failed after 3 attempts" >&2
  return 1
}

# Usage:
mail_query 'tell application "Mail" to count (messages of inbox whose read status is false)'

Reasonable defaults: 15s timeout, 3 retries, 2s sleep. Bump the timeout for messages of every mailbox (cross-account searches) to 60s. If all 3 retries fail, report the failure and move on — never block a briefing on Mail.

Account & Machine Context

See docs/email-accounts.md for which accounts are configured on which machines.

Commands

List accounts

osascript -e 'tell application "Mail" to get name of every account'

Count unread messages

osascript -e 'tell application "Mail" to count (messages of inbox whose read status is false)'

Read the full file on GitHub · 324 lines

Files

What ships with it

3 files 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. 9d ago First seen · 324 lines · 66 tokens per session scan A cb5f3b9770b9

Subscribe to this mod's changes

apple-mail is a skill published in the GitHub repository eins78/agent-skills (2 stars, last pushed 2d ago), licensed MIT. It adds 66 tokens to every session and 3,551 once invoked, about $0.0003 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

xiaohongshu-search-full

Search Xiaohongshu (XHS / RedNote) notes by keyword with full field extraction including body text, topics/tags, image list URLs, video stream URL, publish timestamp, and all engagement stats (likes, collects, comments, shares). Supports all page filter options: sort order (general, latest, most liked, most commented…

browser-act/skills · 254 tokens

x-tweet-by-conversation

Collects every tweet in an X (Twitter) conversation thread given a conversation id (root tweet id) — the focal tweet plus all replies, sub-replies, and quote chains — and returns normalized per-tweet data with text, author, engagement counts, media, hashtags, mentions, inreplyto mapping, and cursor for pagination. Use…

browser-act/skills · 218 tokens

amazon-reviews-api-skill

This skill helps users automatically extract Amazon product reviews via the Amazon Reviews API. Agent should proactively apply this skill when users express needs like getting reviews for Amazon product with ASIN B07TS6R1SF, analyzing customer feedback for a specific Amazon item, getting ratings and comments for a…

browser-act/skills · 124 tokens

amazon-competitor-analyzer

Scrapes Amazon product data from ASINs using browseract.com automation API and performs surgical competitive analysis. Compares specifications, pricing, review quality, and visual strategies to identify competitor moats and vulnerabilities.

browser-act/skills · 48 tokens

create-site

Creates a new Power Pages code site (SPA) using React, Angular, Vue, or Astro. Guides through the full process from initial concept to deployed site: requirements discovery, scaffolding, component planning, design, implementation, validation, and deployment. Use when the user wants to create, build, or scaffold a new…

microsoft/power-platform-skills · 73 tokens

add-cloud-flow

Integrates Power Automate cloud flows into a Power Pages site. Lists available flows, suggests relevant ones based on intent, identifies scenarios and web roles, creates metadata files, and generates client-side code to call flows. Handles both new flow registration and adding already-registered flows to additional…

microsoft/power-platform-skills · 91 tokens