mail-muncher AGENTS.md

mail-muncher AGENTS.md is an instructions file for Codex, OpenCode from craigjmidwinter/mail-muncher. It costs 1,320 tokens per session, scanned A, original, MIT.

A set of project instructions for coding agents working on mail-muncher, a Go program that archives matching email to files and makes the archive available to agents.

In plain words
What is it for?
Use it when building, testing, formatting, linting, or changing mail-muncher. It also explains its Gmail and IMAP email pipeline and file outputs.
Why use it?
It gives agents the project rules, commands, and design constraints they need to make changes without breaking existing behavior.

Instructions file for CodexOpenCode

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 instructions/craigjmidwinter/mail-muncher/agents-md
Clone the repo
git clone --depth 1 https://github.com/craigjmidwinter/mail-muncher

Made for: Codex, OpenCode.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for mail-muncher AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/craigjmidwinter/mail-muncher/agents-md.svg)](https://agentmods.dev/instructions/craigjmidwinter/mail-muncher/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/craigjmidwinter/mail-muncher/agents-md"><img src="https://agentmods.dev/badge/instructions/craigjmidwinter/mail-muncher/agents-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 1,320 This file is loaded in full into every session.
When invoked 1,320 The same file — it is already loaded in full.
Security scan A 0 findings. 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.01320 $0.01320
Opus 5 $0.00660 $0.00660
Sonnet 5 $0.00264 $0.00264
Haiku 4.5 $0.00132 $0.00132

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

Security

Grade A, and why

mail-muncher AGENTS.md scanned grade A with 0 findings 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 4d 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

AGENTS.md · 100 lines

How it starts

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

AGENTS.md

Working notes for coding agents. Conventions and invariants only — the README is the user-facing documentation and is not repeated here.

What this is

mail-muncher gives a program its own read-only mailbox. It archives mail matching user-written rules to .eml and markdown files on disk, and serves that archive to agents over MCP. Go, no cgo, single binary. Two providers (Gmail API, IMAP) sit behind one interface; a pipeline fetches, parses, evaluates a match tree, and writes through sinks.

Commands

Go 1.25+. No code generation, no build tags, no other toolchain.

make build   # go build -o ./mail-muncher, version stamped from git describe
make test    # go test ./...
make lint    # golangci-lint run if installed, else go vet ./...
make fmt     # go fmt ./...
make tidy    # go mod tidy

These are green on a clean checkout. If they are not, that is a bug worth reporting rather than working around.

golangci-lint is optional and CI does not run it. Without the binary, make lint prints golangci-lint not found; falling back to go vet and runs go vet. The full set is pinned in .golangci.yml and is worth running locally before any change to error handling, file paths, or anything that writes to disk — it is not a CI gate because it was measured at 51 minutes on a GitHub runner. CI runs gofmt -l ., go mod tidy verification, go build, go vet, and go test -race.

Invariants a change must not break

These are the product, not preferences. A change that breaks one is wrong even if it compiles and the suite passes.

  • No new OAuth scope. internal/provider/gmail/auth.go declares exactly one — gmail.readonly — and it is the only scope constant in the tree.
  • Nothing that can send, delete, or modify mail. No Gmail Modify/Trash/Delete/Send/Insert/BatchModify; no IMAP STORE/EXPUNGE/APPEND/MOVE/COPY. IMAP opens mailboxes with EXAMINE (SelectOptions{ReadOnly: true}) and fetches with BODY.PEEK[] so reading never sets \Seen. This is enforced mechanically by TestProviderSourceNeverCallsAWriteCapableMailboxMethod in internal/provider/, which AST-walks provider source and fails on any write verb. If that test fires, the change is the problem, not the test.
  • No credentials, tokens, real email addresses, or real message ids in a diff. Fixtures use example.com, acme.example, and .test. The OAuth client fixture at internal/provider/gmail/testdata/credentials.json is deliberately fake and must stay that way.
  • The provider seam holds. Adding a provider must require zero changes to internal/pipeline, internal/filter, or internal/sink. A if provider == "imap" outside internal/provider/ means the interface is wrong; fix the interface.

Read the full file on GitHub · 100 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. 4d ago First seen · 100 lines · 1,320 tokens per session scan A c4642f8575ec

Subscribe to this mod's changes

mail-muncher AGENTS.md is an instructions file published in the GitHub repository craigjmidwinter/mail-muncher (3 stars, last pushed 13d ago), licensed MIT. It adds 1,320 tokens to every session, about $0.0066 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.