Email is the office’s most repetitive flow: every day the same thing — read, classify, send a standard reply, forward it to the right person. It is the first candidate for an agent, and the “video production studio” case shows the full path up the ladder: skill → connector → schedule → hooks. We break down each step with files and configs — and with an incident that turned into a permanent rule.
Step 1: the email triage skill
A skill is a folder with a SKILL.md file where the process is described in steps; the agent loads the instruction when working with email and acts by it, not on general “intuition”. If you haven’t run an agent harness yet, start with the Claude Code quick start. The content of the skill from the case:
---
name: email-triage
description: Triage of incoming email for a video production studio.
Apply when processing incoming mail and preparing reply drafts.
---
EMAIL TRIAGE PROCESS
1. Read the email in full.
2. Classify it: order / partnership / spam / support / other.
3. For an order, extract: brand, video format, deadline.
4. Prepare a reply draft using the reply_order.md template.
5. STOP and show the draft to a human for approval.A creation life hack: ask the agent to interview you about the process first — it will ask about typical emails, exceptions and tone, and the skill will come together with details you would have missed doing it by hand. It works even on free tiers: writing a skill is a one-time, hour-long task. The email classes from the case and the agent’s actions:
| Class | What the agent does | Result |
|---|---|---|
| Order | extracts the brand, format, deadline | a reply draft from the template |
| Partnership | a compact summary of the offer | a digest for a human |
| Spam | marks it, doesn’t reply | the email goes to the archive |
| Support | picks a standard reply | a draft for review |
| Other | a brief summary | a line in the digest |
Why STOP is part of the process
The stop step is not overcaution but an architecture of trust: while the agent only prepares drafts, a mistake costs seconds of editing, not the studio’s reputation. The description field in the file header matters too: it is how the agent decides whether to apply the skill to the current task — phrase it concretely, with the keywords “email”, “incoming”, “draft”. Put the reply_order.md template next to the skill: the agent will drop the brand and the deadline into a ready-made structure instead of composing a letter from scratch.
Techniques for working with structured rule files are in the piece on the skills folder.
Step 2: the email connector — minimum access
Connectors (MCP) give the agent access to Gmail with minimal permissions: reading the inbox (the gmail.readonly scope), with no right to delete or send. The principle from practice: the agent reads only the “work” mailbox — a separate address set up for automation, not a personal one. Tina Huang’s paranoid standard: separate email for the agent — if the mailbox is compromised or the agent makes a mistake, personal correspondence stays untouched.
Write access connects only after a month of read-only trust — and even then the agent writes only drafts, never sends. A human opens the draft, edits it and sends it: a month of such work will show where the skill errs, with no risk to the studio’s reputation. The permission progression looks like this: reading → drafts → and only later, for internal emails, sending; client emails stay with a human always.
Privacy matters at the model choice stage too: emails contain personal data. Before hooking a free API up to your mail, check which providers log prompts and which data is safe to send to a free API.
Step 3: the schedule — the agent works without a push
Scheduled Tasks add an “every hour during working hours” trigger: the agent triages the mail by itself and sends a summary. The PC can be switched off — the schedule lives in the cloud, the runs happen on the service side. The schedule case: “every weekday at 10:00 — a mail and calendar summary” — a typical level-2 automation: the morning starts with a ready digest instead of manually scrolling the inbox.
Increase the frequency in stages: first once a day to judge the triage quality, then once an hour during working hours. That way you will notice classification false positives before they fill the digest, and you will learn the real rhythm of your incoming mail — a studio’s mail doesn’t match a shop’s mail.
A summary format that works: new emails by class, orders with deadlines first, emails the agent is unsure about in a separate “needs a human decision” block. The summary takes a few lines — otherwise people will stop reading it.
Step 4: hooks — the 30% discount incident
A real incident from the case: an agent in auto-approve mode promised a client a 30% discount in a reply. The instruction “don’t promise discounts” was in the skill — but a written request doesn’t enforce itself: the model can talk its way around the rule text under contextual pressure. The solution is a double hook, a technical barrier instead of a verbal one:
- a verbal filter — a regular expression over the outgoing text for patterns like “discount”, “free of charge”, “promise”; a match blocks the action until a human checks it;
- a semantic filter — a small model scores the outgoing text for dangerous promises where the mask stays silent: “we can discuss the terms” passes formally, but in meaning it is a commitment.
A hook filter in Python — the agent calls it before sending an email:
#!/usr/bin/env python3
import re, sys
text = sys.stdin.read()
RISKY = re.compile(r"discount|free|promise|\d+\s?%", re.IGNORECASE)
if RISKY.search(text):
print("Risky promise detected — human review required")
sys.exit(2) # exit code 2 = block the agent's action
sys.exit(0)For hooks, a return code of 2 means blocking: the agent won’t send the email while the filter finds a match. Hooks are described in the project settings (the settings.json file) and fire on events like PreToolUse — before the risky action executes, not after. Before you send the hook into battle, test it by hand:
echo "We can offer a 20% discount" | python hook_risky.py
echo $?The first call should print the warning and return code 2; the second should confirm that clean text passes. The incident became a rule: wherever a mistake is expensive — manual confirmation, with no exceptions for “convenient” cases.
The economics of the steps: hours of setup against weeks of routine
| Step | Cost | Effect |
|---|---|---|
| Skill | an hour of setup | reply drafts get done faster |
| Connector | 15 minutes | the agent reads the mail itself |
| Schedule | 5 minutes | no manual launches |
| Hooks | 30 minutes | incidents get blocked |
The development method from the case: one repetitive task → a skill → connectors → a schedule → automation. Don’t build everything at once — each step is validated by a week of operation: for a week the agent prepares drafts by the skill, for a week it reads the mail itself, for a week it sends scheduled summaries — and only then do hooks on outgoing mail come in. This progression costs hours of setup and saves you from rolling back: a mistake at an early step is visible before the agent has earned the right to act.
Rules the agent remembers between sessions are covered in the piece on agent memory and CLAUDE.md, and the method of tasking an agent is in the PRD method for agents.
Common questions
Will the agent send something to a client on its own? At the read-only step — no; with sending enabled — drafts only, plus hooks on outgoing mail, plus human confirmation for client emails.
Which email classes should you pick? 3–5 classes at most: more means confusion and contradictory rules. The starter set from the case: order, partnership, spam, support.
The agent’s weekly retro — what is it? A practice from the case: a “retro” task where the agent proposes improvements to its own skills — a “do-record-analyze-propose” cycle. The agent sees which emails landed in the wrong class and proposes edits to the steps. The last word stays with a human: changes go into a draft of the skill and are applied manually.
Email via MCP or a direct API? MCP connectors — for Cowork and agent harnesses; direct IMAP in scripts — for n8n and hand-written bots. Both options start read-only, and in both the class logic lives in your skill, not in the connector code: the transport changes, the process stays.
An email triage agent is the perfect first automation project: the steps from the case, double hooks on anything risky, a schedule in the cloud. The 30% discount incident is a warning to everyone: instructions without hooks don’t work — a risky action is closed off with a technical barrier. Concrete action: describe your email process in SKILL.md and run the agent in read-only mode on one class of emails. The practice is current as of fall 2026.
