refd: Instructions file for Codex

AGENTS.md

refd AGENTS.md is an instructions file for Codex, OpenCode from emaitchess/refd. It costs 12,662 tokens per session, scanned A, original, MIT.

Repository-specific instructions for AI coding agents working on refd, an open-source service that monitors how brands appear in AI-generated search answers. The repository is a monorepo, meaning one code repository contains several related applications and packages.

In plain words
What is it for?
Use it when making or reviewing changes in the refd repository, including work that must follow both AGENTS.md and CLAUDE.md.
Why use it?
It gives coding agents the project’s structure, coding rules, required documentation, and commands so changes fit the repository.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: mentions CLAUDE.md; mentions Claude Code; mentions AGENTS.md.

This is emaitchess/refd's own configuration. It tells Codex and OpenCode how to work on refd itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything refd configures →

Reuse

Borrowing it

Nothing to install: this file belongs to emaitchess/refd. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/emaitchess/refd/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/emaitchess/refd

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 refd AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/emaitchess/refd/agents-md/github.svg)](https://agentmods.dev/instructions/emaitchess/refd/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/emaitchess/refd/agents-md"><img src="https://agentmods.dev/badge/instructions/emaitchess/refd/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 refd AGENTS.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/emaitchess/refd/agents-md"><img src="https://agentmods.dev/badge/instructions/emaitchess/refd/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 12,662 This file is loaded in full into every session.
When invoked 12,662 The same file — it is already loaded in full.
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.12662 $0.12662
Opus 5.5 $0.05065 $0.05065
Sonnet 5.5 $0.02532 $0.02532
Haiku 4.5 $0.01266 $0.01266

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

Security

Grade A, and why

refd 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 1mo 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.md · 117 lines

How it starts

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

AGENTS.md

Guidance for AI coding agents working in this repository.

CLAUDE.md is the Claude Code twin of this file — apply any change to both.

What this is

refd (refd.ai) — open-source AI search monitoring. Each workspace tracks one brand's visibility, mentions, citations, and rank across AI answer surfaces: ChatGPT, Perplexity, Gemini, Google AI Mode (BrightData dataset scrapers), and Google AI Overviews (BrightData SERP API). BrightData is the only data provider. Available hosted (refd.ai) or self-hosted; born tracking mrmr, since generalized. Public copy never pairs "refd" with "aeo".

Reference docs: DESIGN.md (design system — all UI work follows it), docs/METRICS.md (scoring and aggregation contract), and docs/mcp.md (remote MCP and OAuth usage).

Monorepo layout

Bun workspaces (apps/*, packages/*) — three independently deployed Cloudflare Workers plus a shared package (docs/plan-three-worker.md).

  • apps/api (@refd/api, api.refd.ai) — the Worker: Hono API, OAuth, MCP, cron trigger, queue consumer, every binding (D1, R2, KV, Queues, AI, Browser, rate limits), and secrets (apps/api/.dev.vars locally). The only Worker that declares bindings, cron, or queue consumers — CI enforces this via scripts/check-worker-topology.sh.
  • apps/dashboard (@refd/dashboard, dash.refd.ai) — the React + Vite SPA as an assets-only Worker (@/* → src/*). noindex, with its own public/robots.txt + public/_headers (CSP allows api.refd.ai) and no landing route. It calls the API cross-origin, so its client builds absolute URLs from VITE_API_ORIGIN and sends credentials: 'include'.
  • apps/web (@refd/web, refd.ai) — the public site: a static Astro build fronted by a tiny Worker (src/worker.ts) that does homepage Markdown negotiation over the assets. Owns the indexable SEO assets (apps/web/public/), the sitemap and llms.txt routes, JSON-LD, and the static 404. Pure .astro (Biome-excluded; astro check can't run on the repo's TS 7, so astro build validates the templates); CTAs link to dash.refd.ai.
  • packages/core (@refd/core) — runtime-neutral code shared across Workers (config, surfaces, mentions, workspaces, site-metadata, blocks, metric-copy, glossary, concepts, public-pages), imported via subpaths like @refd/core/config. No build step; consumers bundle the TS source.

Read the full file on GitHub · 117 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. 1mo ago Changed · +11 lines · +2,099 tokens per session 0531fa560a73
  2. 1mo ago Changed · +2 lines · +825 tokens per session 75e64b7347de
  3. 1mo ago Changed · +150 tokens per session bb1eab1d470d
  4. 1mo ago Changed · +1 lines · +92 tokens per session 8768cf99a1b8
  5. 1mo ago Changed · +3 lines · +801 tokens per session f2c77456f332
  6. 1mo ago Changed · +379 tokens per session c47a2a02063f
  7. 1mo ago Changed · +4 lines · +831 tokens per session 5385f7c5e4dc
  8. 1mo ago Changed · +463 tokens per session bdd6a9ca9950
  9. 2mo ago Changed · +1 lines · +533 tokens per session 94206525f19c
  10. 2mo ago First seen · 95 lines · 6,489 tokens per session scan A 2d0c26a8a489

Subscribe to this mod's changes

refd AGENTS.md is an instructions file published in the GitHub repository emaitchess/refd (2 stars, last pushed 1mo ago), licensed MIT. It adds 12,662 tokens to every session, about $0.0506 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-31.

Related

refd AGENTS.md compared with instructions from other repositories

refd AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
refd AGENTS.mdemaitchess/refdInstructions file21mo agoMITA12,662Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143kyesterdayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149kyesterdayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode