Skip to main content
skill CX Codex

email-triage — Claude Code skill: email sorting and installation

email-triage sorts recent Gmail messages into three categories and ranks their urgency. Use it to request an email digest through the bot’s /digest command.

MIT 117 installs ★ 3 updated 2026-10-25

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add terrylica/cc-skills --skill email-triage -a claude-code
Open on GitHub

What email-triage does

The skill documents an on-demand Gmail review started with /digest [hours]. Messages go into System & Security, Work, or Personal & Family, with urgency ranked from critical to low. When nothing merits attention, the bot reports a quiet period.

The flow uses Gmail CLI to fetch messages, a Haiku model prompt to triage them, and a parser to turn the response into typed digest items. It checks that the triage code and Gmail CLI binary are present; if the binary is missing, the instructions use bun install --frozen-lockfile and bun run build to build it. Gmail CLI is required to provide messages for sorting.

This covers the on-demand digest only. The scheduled digest runs separately in a private deployment with its own implementation, rather than using this plugin’s triage code.

What it helps with

  • Sort recent Gmail messages into categories
  • Flag messages by urgency
  • Turn a model response into structured digest items
  • Diagnose a missing Gmail CLI binary

Example prompts for the agent

  • Sort my recent Gmail messages into the three categories and rank their urgency.
  • Run an email digest for the last six hours with /digest 6.
  • Check why Gmail triage cannot start and look for a missing Gmail CLI binary.

How to install email-triage

1Skills CLI (Vercel)

npx skills add terrylica/cc-skills --skill email-triage -a claude-code

2Manually: put the files in place

~/.claude/skills/email-triage/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/email-triage/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about email-triage

How do I install email-triage in Claude Code?

Run npx skills add terrylica/cc-skills --skill email-triage -a claude-code. The skill file will be at ~/.claude/skills/email-triage/SKILL.md.

What does email-triage do?

It sorts recent Gmail messages into three categories, assigns urgency levels, and supports an on-demand digest through /digest.

Does email-triage run the scheduled digest?

No. The skill covers the on-demand command. A separate private deployment runs the scheduled digest using its own implementation.

Source text

SKILL.md · MIT
---
name: email-triage
description: Gmail Commander email triage - the three-category Haiku prompt and parser in lib/triage.ts, run on demand by the bot's /digest command. The scheduled digest runs in a private deployment with its own implementation. TRIGGERS - email digest, triage emails, digest categories
allowed-tools: Read, Bash, Grep, Glob
---

# Email Triage

How Gmail Commander sorts recent email into what needs attention, and where each digest actually comes from.

> **Self-Evolving Skill**: This skill improves through use. If instructions are wrong, parameters drifted, or a workaround was needed — fix this file immediately, don't defer. Only update for real, reproducible issues.

## Two different digests — do not confuse them

| Digest                      | Trigger                                  | Code                                                                    |
| --------------------------- | ---------------------------------------- | ----------------------------------------------------------------------- |
| On-demand `/digest [hours]` | A user sends it to the bot (default 6 h) | This plugin: `scripts/lib/commands.ts` + `scripts/lib/triage.ts`        |
| Scheduled digest            | Several times a day, unattended          | The private deployment's `GmailDigest` service — its own implementation |

The scheduled digest runs in a **private Restate tenant on an always-on Mac mini** and does not import this plugin's triage code. Its schedule, prompt, alerting and failures are operated through that deployment's own repository runbook.

This plugin no longer ships a scheduled digest entry point: the laptop launchd job `com.example.gmail-commander-digest` was retired on 2026-09-24, and its `scripts/digest.ts` (with the Kokoro podcast-style voice briefing in `scripts/lib/tts-client.ts`) was removed on 2026-09-26 once nothing imported it. Do not recreate either.

## Mandatory Preflight

### Step 1: Check the triage code exists

```bash
PLUGIN="$HOME/.claude/plugins/marketplaces/cc-skills/plugins/gmail-commander"
ls -la "$PLUGIN/scripts/lib/triage.ts" 2>/dev/null || echo "TRIAGE_NOT_FOUND"
```

### Step 2: Verify the Gmail CLI binary (the triage input comes from it)

```bash
ls -la "$HOME/.claude/plugins/marketplaces/cc-skills/plugins/gmail-commander/scripts/gmail-cli/gmail" 2>/dev/null || echo "BINARY_NOT_FOUND"
```

**If BINARY_NOT_FOUND**: Build it from the committed lockfile:

```bash
cd "$HOME/.claude/plugins/marketplaces/cc-skills/plugins/gmail-commander/scripts/gmail-cli" && bun install --frozen-lockfile && bun run build
```

## Three-Category Triage System

| Category          | Examples                                                          |
| ----------------- | ----------------------------------------------------------------- |
| SYSTEM & SECURITY | Exchange alerts, 2FA codes, password resets, new device logins    |
| WORK              | Deadlines, invoices, contracts, GitHub PRs, professional requests |
| PERSONAL & FAMILY | Friends/family messages, appointments, vehicle service, health    |

Urgency levels within each: CRITICAL > HIGH > MEDIUM > LOW. When nothing qualifies, the model answers exactly `NO_SIGNIFICANT_EMAILS` and the bot reports a quiet window.

## Pipeline (`/digest [hours]`)

1. `fetchRecentEmails(hours)` runs `gmail search newer_than:<hours>h -n 50 --json` through `GMAIL_CLI_BIN`.
2. `formatEmailsForTriage()` renders the messages; `ANTI_SKILL_PREFIX` is prepended so the model ignores any skill or tool listings in its context.
3. One Agent SDK call with `TRIAGE_SYSTEM_PROMPT` on `HAIKU_MODEL` (no tools, one turn).
4. `isSkillContaminated()` discards a response that role-plays a skill instead of triaging.
5. `parseTriageResponse()` turns the text into typed items, and `formatDigestHtml()` renders them with the category and urgency emoji maps.

## Source Map

| Concern                                  | File                                                                     |
| ---------------------------------------- | ------------------------------------------------------------------------ |
| System prompt, anti-skill prefix, parser | [`scripts/lib/triage.ts`](../../scripts/lib/triage.ts)                   |
| `/digest` command handler                | [`scripts/lib/commands.ts`](../../scripts/lib/commands.ts)               |
| Category/urgency emoji maps, digest HTML | [`scripts/lib/telegram-format.ts`](../../scripts/lib/telegram-format.ts) |
| Gmail fetch                              | [`scripts/lib/gmail-client.ts`](../../scripts/lib/gmail-client.ts)       |

## Post-Change Checklist

- [ ] YAML frontmatter valid (no colons in description)
- [ ] Trigger keywords current
- [ ] Path patterns use $HOME not hardcoded paths
- [ ] `lib/triage.ts` exports unchanged in shape (the bot and its deployment import them)

## Post-Execution Reflection

After this skill completes, reflect before closing the task:

0. **Locate yourself.** — Find this SKILL.md's canonical path before editing.
1. **What failed?** — Fix the instruction that caused it.
2. **What worked better than expected?** — Promote to recommended practice.
3. **What drifted?** — Fix any script, reference, or dependency that no longer matches reality.
4. **Log it.** — Evolution-log entry with trigger, fix, and evidence.

Do NOT defer. The next invocation inherits whatever you leave behind.

© terrylica · MIT · terrylica/cc-skills

Similar skills

All skills for Notes, tasks and projects →

From the same set79

The whole set →
pueue-job-orchestration pueue-job-orchestration manages long-running tasks and batch processing using pueue queue orchestration, parallelism groups, and detailed CLI logs. CX Codex +1 120installs distributed-job-safety The distributed-job-safety skill helps prevent file collisions and unsafe concurrency in pipelines using pueue, moon, and systemd-run. Use it when jobs share files or compete for host resources. CX Codex +1 120installs project-directory-migration project-directory-migration — a skill that transfers Claude Code sessions, history, and context when you rename or move a project folder. Runs interactively with dry-run preview and rollback support. CX Codex +1 119installs infra-deploy infra-deploy deploys self-hosted Cal.com to GCP Cloud Run on a Supabase PostgreSQL database, or runs it locally with Docker Compose. CX Codex +1 119installs bot-process-control bot-process-control maintains process control rules for Gmail Commander bot instances in Restate and blocks duplicate Telegram pollers on workstations. CX Codex +1 117installs interactive-bot interactive-bot is a Claude Code skill that documents the Gmail Commander Telegram bot. It covers email slash commands, AI routing of free text through MCP, and compose/reply sessions. CX Codex +1 114installs symmetric-dogfooding symmetric-dogfooding sets up bidirectional integration testing between two interdependent repositories before release without mocks. CX Codex +1 112installs calcom-access calcom-access is a Claude Code skill for five other platforms that gives the agent access to Cal.com API for bookings, event types, schedules and slot availability. The API key is read from 1Password via CALCOM_OP_UUID. CX Codex +1 107installs

Project sponsors

Companies that keep this analytics open