Stop burning AI tokens on marketing junk.

Telling an agent to “ignore newsletters and promotions” in its system prompt doesn’t save a single token—the model still has to pull those emails into its context window to know they’re junk. comail filters your inbox at the API layer using Gmail labels, sender addresses, and domains, so bulk mail never reaches search_threads, never wakes your agent, and never touches your token budget.

Takes a minute to apply. No credit card required.

work-agentmorning triage · 45 unread in Gmail

Passed to the model · matched by co:work-agent

3 client threads returned by search_threads

  • Acme Corp <sara@acmecorp.com> — “Revised Q2 timeline”
  • Northstar <maya@northstar.co> — “Contract redlines attached”
  • Brightloop <dana@brightloop.io> — “Launch checklist sign-off”

in agent scope3 threads read

Withheld by comail · 0 model tokens spent

42 promotions, newsletters & alerts stripped before the API response

  • 18 marketing blasts & flash sales — outside allow-list
  • 9 Substack & industry digests — long-form HTML never fetched
  • 15 GitHub, Linear & automated alerts — excluded at the gate

outside scope42 threads skipped

45 unread emails landed overnight. Instead of pulling all 45 into the context window to sort them out, work-agent only ever sees the 3 client threads in its scope.

The problem

“Ignore promotions” in a prompt still pays to read them.

Most inbox agents waste the majority of their context window—and your usage cap—fetching, parsing, and discarding bulk mail you never wanted them to touch.

01

You pay the LLM to act as a spam filter

When an agent has raw Gmail access, the only way it can tell a customer question from a 5,000-word newsletter or HTML promo blast is to fetch the thread and feed it into the model.

02

Polling loops re-read the same clutter

Agents running on a 15-minute heartbeat or daily cron scan unread mail over and over. If you don’t mark every newsletter as read, the same promotional threads get pulled back into context on every run.

03

Context noise degrades the real work

Stuffing dozens of irrelevant threads into a session doesn’t just burn API credits and rate-limit quotas—it crowds the context window and makes the model worse at handling the three emails that actually matter.

How it works

Filter at the API layer for zero tokens.

  1. Scope the agent to an allow-list (or block noisy labels)

    Create work-agent in allow-list mode (default: deny) so it only sees threads labeled co:work-agent—or use deny-list mode and add exceptions for your Marketing and Newsletters labels.

  2. Route mail with deterministic rules, not LLM calls

    Add comail sharing rules for your client domains (like @acmecorp.com) or an existing Gmail label like Clients. Rules match headers and labels directly without invoking a model.

  3. Listen for scoped notifications instead of polling

    Rather than waking an LLM every ten minutes to check if anything arrived, your script waits on create_notification_url. comail only fires an event when an in-scope thread changes—so 40 incoming newsletters trigger zero wakeups.

  4. Spend your context window purely on the job

    When the agent calls search_threads or get_thread, comail returns only the conversations in its scope. The model reads the three client emails that need action and finishes in a fraction of the turns.

work-agent — openclaw

> Check today’s client threads and tell me what needs a reply.

comail · search_threads (query: "newer_than:1d")

thr_91a0: Sara Chen <sara@acmecorp.com> — “Revised Q2 timeline”

thr_4d90: Maya Lin <maya@northstar.co> — “Contract redlines attached”

thr_6c21: Dana Ortiz <dana@brightloop.io> — “Launch checklist sign-off”

42 unshared promotional & newsletter threads withheld by comail

comail · get_thread (thread_id: "thr_91a0")

Sara asks whether Phase 2 can move up by one week

comail · get_thread (thread_id: "thr_4d90")

Maya sent redlines on §4; waiting on your sign-off

comail · get_thread (thread_id: "thr_6c21")

Dana confirmed the checklist is approved—no action needed

Two replies needed: Sara at Acme on the Phase 2 dates, and Maya at Northstar on the §4 redlines. Brightloop is signed off.

search_threads only returns threads carrying co:work-agent. The 42 newsletters and promotions sitting in the same inbox never enter the tool results or the model’s context.

Configuration

Two ways to keep bulk mail out of context.

Use a strict allow-list for agents with a specific job, or a deny-list with noise exceptions for a general inbox assistant.

Strict allow-list

work-agent

Sees only threads labeled co:work-agent—applied by you in Gmail or automatically by rules matching your Clients label and customer domains. Everything else in your inbox is invisible.

work-agent permissions
view allow co:work-agent
view allow label: Clients
view allow domains: @acmecorp.com, @northstar.co
view deny default
attachments deny filenames only
send deny drafts only

Broad inbox, minus the noise

daily-assistant

Runs in deny-list mode so it can catch new senders, while comail strips out threads matching your Marketing and Newsletters labels, noisy domains, or no:daily-assistant.

daily-assistant permissions
view deny no:daily-assistant
view deny labels: Marketing, Newsletters
view deny domains: @substack.com, @github.com
view allow default
attachments deny filenames only
send deny drafts only
01

Zero-token routing

comail’s sharing rules and exceptions match Gmail labels, sender addresses, and domains directly. You never pay a classifier model to read incoming mail just to decide whether your agent should see it.

02

Keep attachment bytes out of context

Turn off attachments and the agent only sees filenames and sizes. When an agent with shell access does need a file, create_attachment_url lets it download the bytes straight to disk over HTTP instead of base64-encoding megabytes through the model.

03

Kill unwanted lists at the source

Tired of marketing emails cluttering your Gmail in the first place? Hand them to a dedicated unsubscribe agent that executes verified one-click unsubscribes and moves shady senders to Spam.

FAQ

Common questions.

Why not just tell the agent to ignore marketing in its prompt?

Because a prompt only runs after tool results enter the context window. If search_threads returns 30 promotions alongside 2 client emails—or if the agent opens a newsletter with get_thread to check whether it’s important—you’ve already paid the input tokens for those messages. Filtering in comail withholds them before the tool response ever reaches the model.

Does this help on flat-rate plans like Claude Max or ChatGPT Plus, or only with API keys?

Both. On API billing, fewer input tokens and fewer tool-call turns lower your spend directly. On flat-rate subscriptions, keeping bulk HTML emails and attachments out of context prevents context bloat and stretches your 5-hour and weekly message quotas much further.

Does comail use an LLM to classify my mail?

No. comail’s sharing rules and exceptions match Gmail labels, email addresses, and domains deterministically. You can also use standard Gmail filters (created by you or by a management agent) to label incoming mail on arrival by subject, keywords, or size.

How do attachments affect token usage?

When attachments permission is off, the agent only sees attachment filenames and byte sizes. When attachments is on, an agent with HTTP or shell access can call create_attachment_url (or create_upload_url when attaching files to a draft) to stream files directly to or from disk via a 5-minute signed URL—so binary files never get base64-encoded through the model’s context window.

Request access

We’re onboarding beta users in small batches. Tell us what you want your agent to handle; specific use cases go to the front of the line.

Clients / harnesses (optional)

Select all that apply.

We’ll only email you about the beta. No card, no newsletter.