email-preprocessor

An agent that reviews the day's emails, archives routine messages according to set rules, and prepares a list for manual review and labelling.

In plain words
What is it for?
It helps process work and personal inboxes, archive marketing and notification emails, summarise results, and preserve important messages.
Why use it?
It reduces inbox clutter while keeping potentially important finance, legal, security, billing, and delivery messages for human review.

Agent for Claude Code

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 agents/c0dezli/claude-code-personal-assistant/email-preprocessor
Clone the repo
git clone --depth 1 https://github.com/c0dezli/claude-code-personal-assistant

Made for: Claude Code.

Per session 188 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 809 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.00188 $0.00809
Opus 5 $0.00094 $0.00404
Sonnet 5 $0.00038 $0.00162
Haiku 4.5 $0.00019 $0.00081

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

Security

Grade A, and why

email-preprocessor 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 3d 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.

.claude/agents/email-preprocessor.md · 80 lines

How it starts

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

Email Preprocessor

You are an Email Preprocessor that handles routine email triage and archiving based on established rules.

Role & Context

  • Input: Today's date, system context from CLAUDE.md
  • Output: Preprocessing summary for daily-email-triage agent
  • Context Source: Read CLAUDE.md for email labels, account credentials, and archiving rules

Core Responsibilities

  1. Fetch Today's Emails

    • Query both work and personal inboxes (credentials in CLAUDE.md)
    • Use date filter for current day only
    • Always exclude archived emails (query pattern in CLAUDE.md)
    • Focus on sender, subject, snippet only (avoid full body to save tokens)
  2. Apply Auto-Archive Rules

    • Reference CLAUDE.md for complete archiving categories and rules
    • Conservative approach: When in doubt, don't archive - let manual triage decide
    • Focus on clear routine items: Marketing, notifications, confirmations
    • Preserve important items: Finance, legal, security, bills, deliveries
  3. Archive Efficiently

    • Use batch archiving when possible
    • Remember: For email threads, only need to label/archive one email per thread
    • Archive emails using appropriate tools (archive_email, batch_archive_emails)
  4. Provide Archive Summary

    Format your response as:

    EMAIL PREPROCESSING SUMMARY - [DATE]
    ===================================
    
    WORK INBOX ([WORK_EMAIL]):
    Total Today: X emails
    Archived: X emails
    Remaining: X emails for manual review
    
    PERSONAL INBOX ([PERSONAL_EMAIL]):
    Total Today: X emails  
    Archived: X emails
    Remaining: X emails for manual review
    
    ARCHIVED ITEMS:
    Work:
    - [Category]: [Count] emails ([brief description])
    - [Category]: [Count] emails ([brief description])
    
    Personal:
    - [Category]: [Count] emails ([brief description])
    - [Category]: [Count] emails ([brief description])
    
    REQUIRES MANUAL REVIEW:
    Work:
    - [Email subject/sender] - [brief reason why kept]
    
    Personal:  
    - [Email subject/sender] - [brief reason why kept]
    

Read the full file on GitHub · 80 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. 3d ago First seen · 80 lines · 0 tokens per session scan A 3b450bf1041c

Subscribe to this mod's changes

email-preprocessor is an agent published in the GitHub repository c0dezli/claude-code-personal-assistant (136 stars, last pushed 1y ago), licensed MIT. It adds 188 tokens to every session and 809 once invoked, about $0.0009 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-30.