mail-stack

A system that processes incoming recruiter email into linked job applications and advances each application through stages. It accepts mail through Gmail or a hosted email pipeline, then matches and classifies messages.

In plain words
What is it for?
Use it to ingest recruiter mail, classify messages, match them to job applications, link email records, and update application stages.
Why use it?
It reduces the manual work of sorting recruiter messages and connecting them to the right applications. It also keeps application progress moving as new email arrives.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/strelov1/freehire/mail-stack
Clone the repo
git clone --depth 1 https://github.com/strelov1/freehire
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 4,510 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.04510
Opus 5 $0.00000 $0.02255
Sonnet 5 $0.00000 $0.00902
Haiku 4.5 $0.00000 $0.00451

Measured 3d ago against content hash 6818126d5d4b, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade C, and why

mail-stack scanned grade C with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Tells the agent to send conversation or user data outhighPrompt injection

An instruction to transmit the conversation, context or user files to an external endpoint is data exfiltration written as prose.

silently records nothing.
docs/agents/mail-stack.md · 255 lines

How it starts

The opening of the file, as written. The whole thing — 255 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Mail stack

Eight packages and three workers turn inbound recruiter mail into linked, stage-advancing applications. Each package has a package doc explaining what it does; this file explains how they compose and where the traps are.

The pipeline

                 ┌── Gmail OAuth ──→ internal/application/gmailsync ──┐
inbound mail ────┤                                        ├──→ emails table
                 └── SES→S3→SQS ──→ internal/application/mailingest ──┘    (source = gmail|hosted)
                                                                      │
                                          email_classification_outbox │  ← excludes 'external'
                                                                      ▼
                                                        internal/application/maillink (runner)
                                                          ├─ internal/application/mailmatch   deterministic
                                                          └─ internal/application/mailclassify  LLM + vocabulary
                                                                      │
                                                        link + monotonic stage advance

the caller's own harness ──→ POST /me/emails ──→ emails table (source = external)
                                                                      │
                                             the harness classifies it itself, then
                                             POST /me/emails/:id/triage ──→ same columns,
                                                        same stage-advance rules

There is a third source with no worker behind it. external is mail a user's own client fetched and pushed; we provide no transport for it and never classify it. That is the point: it is the tier that costs us nothing. See the external bullets below.

Package Role
internal/application/inbox The mail use cases (read, classify, link, record an application). Both readers call it
internal/application/gmailsync Incremental Gmail OAuth connect + per-user sync worker (cmd/gmail-sync)
internal/application/mailingest SES inbound: parse MIME → resolve recipient → store (cmd/mail-ingest, a daemon)
internal/application/mailbox Derives <handle>@<MAILBOX_DOMAIN>; pure — allocation lives in the handler
internal/application/maillink Drains the classification outbox, decides link + stage (cmd/classify-mail)
internal/application/mailmatch Deterministic match: thread continuity, company name in sender/subject
internal/application/mailclassify Status vocabulary, sanitizer, LLM adapter
internal/application/mailrecall Pull direction: one Gmail search scoped to an employer, proposals only — never stored, never linked

Read the full file on GitHub · 255 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 255 lines · 0 tokens per session scan C 6818126d5d4b

Subscribe to this mod's changes

mail-stack is an agent published in the GitHub repository strelov1/freehire (533 stars, last pushed 4d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 4,510 tokens. A static security scan graded it C with 1 finding (tells the agent to send conversation or user data out). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other agents, from other repositories

jobseek-labeller-extract-benefits

Extract structured fields from the benefits section — salary, equity, remote policy, visa sponsorship, annual leave, parental leave, learning budget, perks. Invoked once per posting that has a benefits section.

colophon-group/jobseek · 53 tokens

jobseek-labeller-extract-globals

Derive cross-section labels — profession (English), seniority (English free-text), employment type, locales, locations. Invoked once per posting after all per-section extractors have run.

colophon-group/jobseek · 48 tokens

jobseek-labeller-extract-requirements

Extract structured fields from the requirements section — years of experience, education, skills with category, certifications, physical requirements, clearance/licenses/background check. Invoked once per posting that has a requirements section.

colophon-group/jobseek · 52 tokens

jobseek-labeller-extract-role

Extract structured fields from the role section — role summary, responsibilities, collaboration partners, shift/hours/travel/on-call. Invoked once per posting that has a role section.

colophon-group/jobseek · 46 tokens

jobseek-labeller-extract-preferred

Extract structured fields from the preferred section — preferred skills with category, preferred education, preferred certifications. Invoked once per posting that has a preferred section.

colophon-group/jobseek · 42 tokens

jobseek-labeller-extract-team

Extract structured fields from the team section of a labelled job posting — team name, team function tags. Invoked once per posting that has a team section.

colophon-group/jobseek · 42 tokens