agentmailbox

A set of rules for sharing project context between coding-agent sessions and agents, including previous decisions, tasks, and messages.

In plain words
What is it for?
Use it to restore context at the start of a task, coordinate with other agents, and save progress before a session ends.
Why use it?
It reduces the need to repeat background information when work moves between sessions or agents.

Cursor rule

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 rules/ragavrida/agentsmcp/agentmailbox
Clone the repo
git clone --depth 1 https://github.com/RagavRida/agentsmcp
Per session 912 This file is loaded in full into every session.
When invoked 912 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.00912 $0.00912
Opus 5 $0.00456 $0.00456
Sonnet 5 $0.00182 $0.00182
Haiku 4.5 $0.00091 $0.00091

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

Security

Grade A, and why

agentmailbox 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 2d 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.

skills/cursor/rules/agentmailbox.mdc · 102 lines

How it starts

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

AgentMailbox Context Sync

You have access to AgentMailbox via MCP tools. Use these tools to maintain persistent context across sessions and coordinate with other agents.

RULE #1: Memory First — ALWAYS

When a user gives you ANY query or task:

  1. IMMEDIATELY call agentsmcp_context_briefing with the user's query as the task parameter
  2. Read the returned briefing — it contains relevant files, symbols, decisions, tasks, and relationships from the persistent memory
  3. If the briefing returns results, USE THEM as your starting context instead of reading raw files
  4. Only fall back to grep / view_file / read_file when the briefing returns empty results for what you need

This single rule eliminates 95% of wasted input tokens.

On Session Start

Always check for unread messages at the beginning of a session:

  1. Call agentsmcp_receive to get unread messages
  2. If messages exist, summarize the context for the user
  3. If a relevant thread exists, call agentsmcp_sync with the threadId

Context Lookup Priority (use in order)

When you need information about the codebase:

  1. agentsmcp_context_briefing — one-shot task briefing (graph + index combined)
  2. agentsmcp_get_index — look up a specific file/symbol by key (200 tokens vs reading full file)
  3. agentsmcp_search_index — keyword search across all indexed entries (replaces grep)
  4. agentsmcp_query_graph — relationship traversal (find connected files/symbols/decisions)
  5. LAST RESORT: grep / view_file — only when memory has no entry

During Work — Record Progress

When the user makes important decisions or completes significant tasks:

  1. Call agentsmcp_send to record the decision/progress to the thread
  2. Include structured data: decisions, filesChanged, status, openQuestions
  3. Include a contextSnapshot with the current state

After Modifying Files — Update Memory

When you finish working on a file:

  1. Call agentsmcp_upsert_index with:
    • key: "file:relative/path.ts"
    • category: "file"
    • summary: ~200-token summary of what the file does, its exports, key functions
    • metadata: { lines, exports, imports, dependencies }

Read the full file on GitHub · 102 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. 2d ago First seen · 102 lines · 912 tokens per session scan A 11ea4a93bfdb

Subscribe to this mod's changes

agentmailbox is a cursor rule published in the GitHub repository RagavRida/agentsmcp (1 stars, last pushed 1mo ago), licensed MIT. It adds 912 tokens to every session, about $0.0046 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.