A custom spam filter for cold email, built with Claude Code for about $0.04 a month
Published
How does this AI workflow work?
- Replaces: sorting cold pitches by hand out of roughly 500 emails a week across 3 inboxes, about 50 a week of which Gmail does not catch.
- Results: one inbox (the public one on a personal site) is now managed fully by an agent.
- Every new email is sorted within seconds into spam, "archived with a label" or inbox.
- The author says he now rarely has to correct a category.
- What to connect:
- Gmail push notifications (Google Pub/Sub) to a webhook on Google Cloud Run with Cloud Scheduler, and Upstash Redis.
- The Jev API from TypeSafe (a classifier that returns calibrated probabilities, about $0.042 per million tokens) for the emails that hard rules do not settle. Claude Code writes the code.
- Stated cost: about $0.04 a month, $2.04 with an AgentMail public inbox, mostly on free tiers.
- How it works: hard rules let through anyone you have written to, anyone who cc's a contact, and calendar invites. A weekly digest accepts plain-text replies such as "unmark David".
- Who it's for: founders, freelancers and small firms with a public contact address that attracts sales pitches and mass mail.
From the Morning Tokens issue of Nov 2, 2026