---
title: "A custom spam filter for cold email, built with Claude Code for about $0.04 a month"
date: 2026-11-02
url: "https://morningtokens.com/workflows/a-custom-spam-filter-for-cold-email-built/"
source: "https://x.com/ChoyRb/status/2116327296093307313"
issue: "https://morningtokens.com/issues/2026-11-02/"
---

# A custom spam filter for cold email, built with Claude Code for about $0.04 a month

## 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.

Source: https://x.com/ChoyRb/status/2116327296093307313

From the Morning Tokens issue of 2026-11-02: https://morningtokens.com/issues/2026-11-02/
