email-cleanup

email-cleanup is a skill for Claude Code, Codex from UseJunior/email-agent-mcp. It costs 92 tokens per session (3,840 once invoked), scanned A, original, Apache-2.0.

A set of instructions for cleaning up a Microsoft 365 or Outlook inbox using folders and automatic server-side rules. It uses the Microsoft Graph API, Microsoft's interface for working with Microsoft 365 data.

In plain words
What is it for?
Creating folders, moving groups of messages, and making rules that sort future email, such as GitHub notifications.
Why use it?
It helps separate useful conversations from newsletters and automated notifications, so important messages are easier to find.

Skill for Claude CodeCodex

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

Good fit Creating folders, moving groups of messages, and making rules that sort future email, such as GitHub notifications.

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

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 email-cleanup

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/usejunior/email-agent-mcp/email-cleanup"><img src="https://agentmods.dev/badge/skills/usejunior/email-agent-mcp/email-cleanup.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 92 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,840 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. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 2 findings, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Privilege Escalation · line 90
    Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
    Fix: Remove references to credential paths. Use environment variables or secrets managers. For docs, use placeholder paths (e.g., /path/to/config). Never load .env or token files in production code paths.
  • medium Rogue Agent · line 6
    Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
    Fix: Remove any persistence mechanisms (cron jobs, startup scripts, state files). Skills should not maintain state across sessions without explicit user consent.
How audits are shown
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.00092 $0.03840
Opus 5 $0.00046 $0.01920
Sonnet 5 $0.00018 $0.00768
Haiku 4.5 $0.00009 $0.00384

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

Security

Grade A, and why

email-cleanup 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.

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/email-cleanup/SKILL.md · 302 lines

How it starts

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

Inbox Cleanup & Rules (Outlook)

This skill covers both one-time inbox cleanup and ongoing rule automation for Microsoft 365 / Outlook. The workflow uses the Microsoft Graph API for folder management and server-side inbox rules.

When to Use This Skill

Use when the user's inbox has become noisy — automated notifications drowning out human conversations, newsletters mixed with client emails, or hundreds of unread messages that make it hard to find what matters.

Real trigger example: A user's partner email went unread for 9 days because it was buried under GitHub and npm notifications. This is the exact problem server-side rules solve.

Trust Boundary: What This Skill Can and Cannot Enforce

Before you install or grant OAuth consent, understand where the safety boundary lies.

This skill is instruction-only. It ships no code, executes nothing by itself, and cannot enforce any of the safety protections described below. Everything in the "Rule Security Model" and "Authentication & Required Scopes" sections is enforced (or not enforced) by whichever runtime actually executes the Microsoft Graph API calls. The skill file is a set of instructions, not a sandbox.

What that means in practice

  • The blocked-actions list (forwardTo, redirectTo, delete, etc.) describes what a trusted runtime SHOULD reject. Whether those actions are actually rejected depends on the runtime. If you use email-agent-mcp, rejection is built into the action handler (createInboxRuleAction in rules.ts). If you use a raw Graph API client or a custom MCP without equivalent guards, the protections do not automatically apply.
  • MailboxSettings.ReadWrite is a high-risk scope because it controls inbox rules — and inbox rules can be configured to forward or redirect mail externally. Granting the scope without a runtime that enforces the blocked-actions list gives up the primary mitigation.
  • Autonomous invocation (where the agent runs this skill without per-call approval) is a platform-level setting, not something the skill controls. Combined with write scopes, it increases the surface area of any runtime weakness.

Read the full file on GitHub · 302 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. 9d ago First seen · 302 lines · 92 tokens per session scan A 84f0366303e6

Subscribe to this mod's changes

email-cleanup is a skill published in the GitHub repository UseJunior/email-agent-mcp (6 stars, last pushed yesterday), licensed Apache-2.0. It adds 92 tokens to every session and 3,840 once invoked, about $0.0005 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.