mail-newsletter

mail-newsletter is a skill for Claude Code from aashari/ai-agent-skills. It costs 59 tokens per session (898 once invoked), scanned A, original, MIT.

An email audit that identifies newsletters and mailing lists, counts messages from each sender, and finds unsubscribe links when requested. Newsletters are recurring bulk emails, such as product updates or mailing-list messages.

In plain words
What is it for?
Use it to review newsletter volume over a chosen period, identify email noise, and find subscriptions you may want to leave.
Why use it?
It helps reveal which subscriptions fill your inbox and which senders generate the most unread or unwanted mail.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: reads .claude/ paths; built for openclaw.

Good fit Use it to review newsletter volume over a chosen period, identify email noise, and find subscriptions you may want to leave.

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

Made for: Claude Code.

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 mail-newsletter

README.md
[![agentmods](https://agentmods.dev/badge/skills/aashari/ai-agent-skills/mail-newsletter/github.svg)](https://agentmods.dev/skills/aashari/ai-agent-skills/mail-newsletter)
Your own site
<a href="https://agentmods.dev/skills/aashari/ai-agent-skills/mail-newsletter"><img src="https://agentmods.dev/badge/skills/aashari/ai-agent-skills/mail-newsletter/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 mail-newsletter

Your own site · 80×15
<a href="https://agentmods.dev/skills/aashari/ai-agent-skills/mail-newsletter"><img src="https://agentmods.dev/badge/skills/aashari/ai-agent-skills/mail-newsletter.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 59 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 898 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.00059 $0.00898
Opus 5 $0.00030 $0.00449
Sonnet 5 $0.00012 $0.00180
Haiku 4.5 $0.00006 $0.00090

Measured 12d ago against content hash 790026cdd2c9, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

mail-newsletter 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 12d 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.

skills/apple-mail/mail-newsletter/SKILL.md · 98 lines

How it starts

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

Mail Newsletter — Subscription and Mailing List Audit

Analysis: $ARGUMENTS (default: last 90 days)

Step 1: Detect newsletters via unsubscribe_type (most accurate)

DB="$HOME/Library/Mail/V10/MailData/Envelope Index"
SINCE=$(($(date +%s) - 7776000))  # 90 days

sqlite3 "$DB" "
SELECT a.address, a.comment as name,
       m.unsubscribe_type,
       COUNT(*) as count,
       SUM(CASE WHEN m.read=1 THEN 1 ELSE 0 END) as read_count,
       ROUND(100.0 * SUM(m.read) / COUNT(*), 0) as read_pct,
       MAX(datetime(m.date_received,'unixepoch','localtime')) as latest
FROM messages m
JOIN addresses a  ON m.sender  = a.ROWID
JOIN mailboxes mb ON m.mailbox = mb.ROWID
WHERE m.date_received >= ${SINCE}
  AND m.deleted = 0
  AND mb.url NOT LIKE '%Spam%' AND mb.url NOT LIKE '%Trash%'
  AND mb.url NOT LIKE '%Sent%'
  AND m.unsubscribe_type > 0
GROUP BY a.address
ORDER BY count DESC;" 2>/dev/null

Step 2: Catch high-volume bulk senders without unsubscribe headers

sqlite3 "$DB" "
SELECT a.address, a.comment, COUNT(*) as cnt,
       ROUND(100.0 * SUM(m.read) / COUNT(*), 0) as read_pct
FROM messages m
JOIN addresses a ON m.sender = a.ROWID
JOIN mailboxes mb ON m.mailbox = mb.ROWID
WHERE m.date_received >= ${SINCE}
  AND m.deleted=0
  AND m.automated_conversation = 2
  AND m.unsubscribe_type = 0
  AND mb.url NOT LIKE '%Spam%' AND mb.url NOT LIKE '%Sent%'
GROUP BY a.address
HAVING cnt >= 10
ORDER BY cnt DESC LIMIT 20;" 2>/dev/null

Step 3: Group by mailing list (list_id_hash)

To see distinct mailing lists (e.g. a company using multiple sender addresses):

sqlite3 "$DB" "
SELECT m.list_id_hash, COUNT(*) as cnt, COUNT(DISTINCT a.address) as sender_variants,
       MAX(a.comment) as name_sample
FROM messages m
JOIN addresses a ON m.sender = a.ROWID
WHERE m.date_received >= ${SINCE}
  AND m.deleted=0
  AND m.list_id_hash IS NOT NULL AND m.list_id_hash != 0
GROUP BY m.list_id_hash
ORDER BY cnt DESC LIMIT 20;" 2>/dev/null

For senders with low read rates (< 30%), find unsubscribe links in body:

python3 ~/.claude/skills/_mail-shared/parser.py <ROWID>

Look for unsubscribe URLs in the body text.

Read the full file on GitHub · 98 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. 12d ago First seen · 98 lines · 59 tokens per session scan A 790026cdd2c9

Subscribe to this mod's changes

mail-newsletter is a skill published in the GitHub repository aashari/ai-agent-skills (5 stars, last pushed 6mo ago), licensed MIT. It adds 59 tokens to every session and 898 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