agents-md

agents-md is a cursor rule for Cursor from nedcodes-ok/cursorrules-collection. It costs 0 tokens per session (742 once invoked), scanned A, original, MIT.

A guide to AGENTS.md, a file that gives coding agents project-specific instructions. It explains how agents discover these files from global settings down through the project folders, with deeper rules taking priority.

In plain words
What is it for?
Use it when creating, reviewing, or troubleshooting AGENTS.md and AGENTS.override.md files, their discovery order, scope, and precedence.
Why use it?
It clarifies which instructions apply in a repository and how to structure them without exceeding the combined file-size limit.

Cursor rule for Cursor

Written for Cursor: a Cursor rule (.mdc). Also seen: mentions CLAUDE.md; reads ~/.codex paths; mentions AGENTS.md.

Good fit Use it when creating, reviewing, or troubleshooting AGENTS.md and AGENTS.override.md files, their discovery order, scope, and precedence.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/nedcodes-ok/cursorrules-collection/agents-md
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/nedcodes-ok/cursorrules-collection

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-md

README.md
[![agentmods](https://agentmods.dev/badge/rules/nedcodes-ok/cursorrules-collection/agents-md/github.svg)](https://agentmods.dev/rules/nedcodes-ok/cursorrules-collection/agents-md)
Your own site
<a href="https://agentmods.dev/rules/nedcodes-ok/cursorrules-collection/agents-md"><img src="https://agentmods.dev/badge/rules/nedcodes-ok/cursorrules-collection/agents-md/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-md

Your own site · 80×15
<a href="https://agentmods.dev/rules/nedcodes-ok/cursorrules-collection/agents-md"><img src="https://agentmods.dev/badge/rules/nedcodes-ok/cursorrules-collection/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 742 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.00000 $0.00742
Opus 5.5 $0.00000 $0.00297
Sonnet 5.5 $0.00000 $0.00148
Haiku 4.5 $0.00000 $0.00074

Measured 2mo ago against content hash 440e1c945262, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

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 2mo 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.

rules-mdc/ai-tools/agents-md.mdc · 45 lines

How it starts

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

AGENTS.md Rules

AGENTS.md is the instruction file for OpenAI Codex (and increasingly, other tools like GitHub Copilot coding agent, Zed, and OpenCode). It's loaded once per session before any work begins.

Discovery Chain

  • Global: ~/.codex/AGENTS.md (or AGENTS.override.md if it exists — override takes priority, only one file at this level)
  • Project: Starting from the Git root, Codex walks down to your current working directory, checking each directory for AGENTS.override.md then AGENTS.md. At most one file per directory
  • Merge order: Files concatenate root-to-leaf, separated by blank lines. Later files override earlier guidance because they appear last in the combined prompt
  • Size limit: 32 KiB combined by default (project_doc_max_bytes config). If you hit it, split instructions into subdirectory files

What Goes In AGENTS.md

  • Working agreements: "Always run npm test after modifying JavaScript files," "Prefer pnpm when installing dependencies"
  • Verification commands: How to build, test, lint, typecheck. Codex runs these to validate its own changes
  • Repo conventions: naming patterns, directory structure expectations, PR requirements
  • Tool preferences: which package manager, which test runner, which formatter — Codex won't guess correctly without this

Override Files

  • AGENTS.override.md in any directory replaces AGENTS.md at that same level — useful for temporary overrides without editing the base file
  • Common use: a services/payments/AGENTS.override.md that says "use make test-payments instead of npm test" for that specific service
  • Delete the override to restore the base instructions

Patterns That Work

  • Keep global (~/.codex/AGENTS.md) minimal — personal preferences that apply everywhere (coding style, preferred tools, commit message format)
  • Project root AGENTS.md handles repo-wide setup: build commands, CI expectations, PR conventions
  • Subdirectory overrides for teams/services with different tooling or constraints
  • Commands first, conventions second — Codex needs to know how to verify its work before anything else

Read the full file on GitHub · 45 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. 2mo ago First seen · 45 lines · 0 tokens per session scan A 440e1c945262

Subscribe to this mod's changes

agents-md is a cursor rule published in the GitHub repository nedcodes-ok/cursorrules-collection (38 stars, last pushed 8mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 742 tokens. 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.

Related

agents-md compared with cursor rules from other repositories

agents-md next to 6 cursor rules from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
agents-mdnedcodes-ok/cursorrules-collectionCursor rule388mo agoMITA0Cursor
23-app-startuporbitalsonic/AndroidPilotCursor rule111d agononeA0Cursor
30-screen-languageorbitalsonic/AndroidPilotCursor rule111d agononeA0Cursor
01-feature-checklistorbitalsonic/AndroidPilotCursor rule111d agononeA36Cursor
06-coroutines-floworbitalsonic/AndroidPilotCursor rule111d agononeA0Cursor
09-resources-xmlorbitalsonic/AndroidPilotCursor rule111d agononeA0Cursor
10-manifestorbitalsonic/AndroidPilotCursor rule111d agononeA0Cursor