agents

agents is a cursor rule for Cursor from mex-memory/mex. It costs 30 tokens per session (1,151 once invoked), scanned A, original, MIT.

Always-loaded project rules that describe a project's identity, non-negotiable requirements, commands, and code map. The code map can point the agent to related symbols and execution paths.

In plain words
What is it for?
Use them as the first reference when working in the project, especially when exploring unfamiliar code or deciding which project rules apply.
Why use it?
They give the agent a stable starting point and reduce unnecessary code reading. They also define how to discover and load more specific project context.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use them as the first reference when working in the project, especially when exploring unfamiliar code or deciding which project rules apply.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/mex-memory/mex/cursorrules
About the project

mex is a repository-local knowledge system for AI coding agents that turns codebase discoveries into connected Markdown documentation and a code graph. It helps agents and developers retain architectural decisions, conventions, edge cases, and project context across coding sessions while detecting documentation affected by code changes. The catalogue skills and instructions are add-ons for using mex with coding agents.

mex-memory/mex · 1,767 stars · on GitHub · mexmemory.com

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.

Clone the repo
git clone --depth 1 https://github.com/mex-memory/mex

Made for: Cursor.

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 agents

README.md
[![agentmods](https://agentmods.dev/badge/rules/mex-memory/mex/cursorrules/github.svg)](https://agentmods.dev/rules/mex-memory/mex/cursorrules)
Your own site
<a href="https://agentmods.dev/rules/mex-memory/mex/cursorrules"><img src="https://agentmods.dev/badge/rules/mex-memory/mex/cursorrules/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for agents

Your own site · 80×15
<a href="https://agentmods.dev/rules/mex-memory/mex/cursorrules"><img src="https://agentmods.dev/badge/rules/mex-memory/mex/cursorrules.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 30 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,151 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00030 $0.01151
Opus 5.5 $0.00012 $0.00460
Sonnet 5.5 $0.00006 $0.00230
Haiku 4.5 $0.00003 $0.00115

Measured 28d ago against content hash 0ef411935f5e, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

agents 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 28d 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.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

  • agents — 86% identical, 0 lines differ
.mex/.tool-configs/.cursorrules · 64 lines

How it starts

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

[Project Name]

What This Is

Non-Negotiables

Commands

Code Graph

Use the smallest relevant structured resolver. For Inbox or Relay mutations, resolve only the intended action with mex inbox contract --action <command-id> --json or mex relay contract --action <command-id> --json; use mex capabilities --json only for broader capability discovery. If the user explicitly asks to create, save, or draft a checkout-local Inbox or Relay draft, preview and apply that exact draft without asking for redundant confirmation. Deleting a local draft, or publishing, approving, rejecting, withdrawing, marking stale, repairing, taking or acknowledging, or closing, requires fresh explicit confirmation after semantic preview. Treat Git commit, push, and pull as separate actions requiring their own authorization.

The repo is indexed into .mex/graph.db. Use it to avoid re-reading code you already have — it is one tool alongside Grep/Glob, not a replacement for them.

  • If you know the symbol name, go straight to it: mex graph query <who-calls|what-calls|where-defined> <symbol> and mex graph get <id...> are exact. This is the strongest part of the graph. Each call first proves the whole index is still fresh, so on a large repository it takes seconds: pass several ids to one graph get instead of calling it once per id. Give it exact names — an approximate name can return a confident wrong match.
  • Exploring an unfamiliar task? mex graph scope "<task>" returns bounded, source-backed JSONL context plus trustworthy execution flows. Scope matches on words, not meaning, so treat it as starting evidence rather than a complete answer.
  • Treat source returned by the graph as ALREADY READ; do not re-open those files.
  • Read the summary status and evidence. status: "ok" remains usable when truncated: true; only optional evidence was omitted. For partial or degraded, narrow the task or follow suggestedNextCommands.
  • Use mex graph get <id> --detail source only when source is missing, you need exact expansion, or a partial/degraded summary suggests it. Do not expand nodes by quota.
  • If the evidence is insufficient or the task wording does not match the code, use Grep/Glob instead. Do not re-run scope with reworded phrasing more than once.
  • Before editing a symbol, run mex impact <symbol|file> to see affected callers and scaffold memory.
  • During mex sync, adjudicate any AMBIGUOUS grounding; after repairs, ensure the refreshed grounding is re-emitted.

Read the full file on GitHub · 64 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. 28d ago Changed 0ef411935f5e
  2. 1mo ago Changed · +5 lines 157489dca00e
  3. 1mo ago Changed · +2 lines b5c9e50a497f
  4. 1mo ago First seen · 57 lines · 30 tokens per session scan A 3728ea8f5fdf

Subscribe to this mod's changes

agents is a cursor rule published in the GitHub repository mex-memory/mex (1,767 stars, last pushed 2d ago), licensed MIT. It adds 30 tokens to every session and 1,151 once invoked, about $0.0001 per session on Opus 5.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-30.