advanced-gmail-mcp: Command for Claude Code

.claude/commands/checkemail.md

checkemail is a command for Claude Code from coreyepstein/advanced-gmail-mcp. It costs 16 tokens per session (899 once invoked), scanned A, original, MIT.

An inbox-cleanup command that first archives likely junk and then reviews important emails individually. It uses Gmail accounts configured for the agent.

In plain words
What is it for?
Archiving newsletters, promotions, social notifications, duplicate messages, expired codes, and other low-priority mail, then triaging emails that need attention.
Why use it?
It separates messages that can be safely filed away from emails that may need a personal response or decision.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: names the AskUserQuestion tool.

This is coreyepstein/advanced-gmail-mcp's own configuration. It tells Claude Code how to work on advanced-gmail-mcp itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything advanced-gmail-mcp configures →

Reuse

Borrowing it

Nothing to install: this file belongs to coreyepstein/advanced-gmail-mcp. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/coreyepstein/advanced-gmail-mcp/main/.claude/commands/checkemail.md
Clone the repo
git clone --depth 1 https://github.com/coreyepstein/advanced-gmail-mcp

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 checkemail

README.md
[![agentmods](https://agentmods.dev/badge/commands/coreyepstein/advanced-gmail-mcp/checkemail.svg)](https://agentmods.dev/commands/coreyepstein/advanced-gmail-mcp/checkemail)
Your own site
<a href="https://agentmods.dev/commands/coreyepstein/advanced-gmail-mcp/checkemail"><img src="https://agentmods.dev/badge/commands/coreyepstein/advanced-gmail-mcp/checkemail.svg" alt="Measured on agentmods" height="20"></a>
Per session 16 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 899 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.1 $0.00016 $0.00899
Opus 5 $0.00008 $0.00449
Sonnet 5 $0.00003 $0.00180
Haiku 4.5 $0.00002 $0.00090

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

Security

Grade A, and why

checkemail 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 6d 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/commands/checkemail.md · 107 lines

How it starts

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

/checkemail — Inbox Cleanup + Triage

Two-phase inbox sweep: (1) batch archive junk, (2) walk through real emails one by one.

User's input: $ARGUMENTS

Setup

Load gmail tools: ToolSearch with query +gmail.

Determine accounts: if user specified one, use it. Otherwise all configured accounts.

Phase 1 — Fetch + Classify

  1. list_emails for each account (max_results=25, parallel)
  2. For every email with a threadId, check if user already replied:
    • get_thread for each thread (parallel, batch by account)
    • If any message in thread has from: matching the account's address, mark as already handled
  3. Classify every inbox email into one of:
    • Archive — newsletters, promotions, notifications, social, expired codes, calendar accepts, duplicate sends, FYI-only items user already replied to
    • Triage — needs user attention (action required, waiting on reply, unread from a real person, financial/legal)

Always-archive rules

These are ALWAYS classified as Archive without asking:

  • Newsletters / Substacks / daily digests
  • Promotional emails (CATEGORY_PROMOTIONS)
  • Social notifications (CATEGORY_SOCIAL)
  • Calendar accepts/declines (no action needed)
  • Automated billing receipts
  • GitHub PR merge notifications (already merged = FYI)
  • Tool/service update notices
  • Threads where user already sent the most recent reply (waiting on other party)

Present results

Show a single summary with two sections:

Proposed archives — grouped table by account:

## Proposed Archives (N emails)

### Account-Alias (X)
| From | Subject | Reason |
|------|---------|--------|

Triage queue — numbered list across all accounts:

## Triage Queue (N emails)

| # | Account | From | Subject | Status |
|---|---------|------|---------|--------|

Then ask: "Archive all N? Then we'll walk through triage."

Wait for user confirmation. User may exclude items from archive or add items to archive.

Phase 2 — Archive

On approval, batch_modify per account (archive action). Report count.

Read the full file on GitHub · 107 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. 6d ago First seen · 107 lines · 16 tokens per session scan A b7b79fa1fb2a

Subscribe to this mod's changes

checkemail is a command published in the GitHub repository coreyepstein/advanced-gmail-mcp (7 stars, last pushed 6mo ago), licensed MIT. It adds 16 tokens to every session and 899 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.