/aie-email:email-inbox-cleanupfrom aie-email
File reviewed email under an agreed protocol while preserving unread mail, drafts and outstanding work labels; run or resume an existing cleanup executor. Trigger on "clean up my inbox", "file email I have read", "sort what is left", or "resume inbox cleanup". Does not send mail or change arrival filters.
Ships in aie-email. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Reduce Inbox clutter according to the owner's established review and task policy. Use already-granted scope; do not require the owner to approve the same routine filing again.
Verify the account mapping, approved review signal, destination labels, open-task policy and actual tool/executor capabilities. Use owner-provided email.config.md or the current conversation. Without a review signal or mutation authority, prepare a preview and ask only for the missing decision. An agent reading mail must not mark it read or count its own access as human review.
If a maintained deterministic executor exists, invoke its documented manual entrypoint with its lock, limits, checkpoints and recovery behavior. Compare its active policy with the requested one before running. When an older executor supports only a narrower subset of the authorized request, state that limitation and proceed with that safe subset; hold unsupported items and report them separately. For example, a completed-record worker leaves an unpaid To Do invoice in Inbox even when the desired future policy would file it. Do not rewrite its rules, bypass limits, reset cursors or improvise a competing worker during a run. Installation alone does not prove execution.
Without an executor, use available provider tools only for a bounded authorized batch with recoverable before-state. Do not claim that this creates a reliable recurring service. If the necessary per-message operations or verification are unavailable, produce the concrete plan and capability gap.
Read complete current conversation state before filing. Protect any unread sibling, star, draft, pending reply approval, snooze or unresolved legitimacy, classification, destination or next-step ownership. These are the bundle's conservative defaults; a deliberate owner exception must be explicit and supported by the executor. Preserve state on every message, including unrelated labels.
For confidently classified reviewed mail, follow the selected open-task policy:
Neither policy treats reading, age, an automated receipt or a new label as evidence that a human task is complete. Unknown mail stays visible with Review; routine informational mail does not acquire a fabricated task.
Use stable account + conversation + message IDs. Capture before-state and required additions/removals, re-read immediately before mutation, and act only on eligible captured messages. For Gmail, archive by removing INBOX only from those messages; do not mark read, remove work labels or apply a thread-wide archive to unseen siblings. Other providers need verified equivalent semantics. Gmail label semantics.
Record each intended mutation before execution. Verify the full expected label/read state afterward, recheck conversation changes, and restore Inbox to exact affected IDs if a concurrent unread/draft/approval change invalidates filing. A new UNREAD state explicitly invalidates review: restore only the captured Inbox removal, retain the new UNREAD state and unrelated concurrent edits, and defer that conversation until a later human review. Do not retry filing that conversation in the same invocation. Do not blindly retry an ambiguous write: read its result, reconcile the journal, and leave unresolved recovery visible.
Use configured bounded passes, backoff and a single writer lock. Stop on quota deferral, required recovery, account failure, overlap or lack of progress. Keep durable cursors and revisit older held mail when its review state changes. If scheduling is requested, use one explicit owner and an IANA time zone, reuse an existing matching job, and verify a real scheduled result separately from manual success.
Report completed-record filing separately from filing with work remaining, plus labels added, protected/uncertain work, errors and the remaining queue. Repeated evaluations are not distinct-thread counts. Sending, deletion, unsubscribe, filter changes and credential expansion are outside cleanup.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
6 skills in this plugin
/email-contact-syncAdd intended human recipients to the sending account's chosen contacts after verified sent replies, with deduplication and preserved contact data. Trigger on "add people I reply to to contacts", "sync contacts after sent replies", or "promote replied-to people to main Contacts". Excludes drafts and bulk recipient harvesting./email-digest-reviewReview diverted email and sorting digests for missed human requests, account notices, newsletters, promotions and confirmed spam. Trigger on "review my email digest", "check SaneBox for missed mail", or "find spam and misfiled messages". Does not authorize permanent deletion or future sender blocking./email-npx claudepluginhub mrhinkle/aienterprise-skills --plugin aie-email