r3: Instructions file for Codex

AGENTS.md

r3 AGENTS.md is an instructions file for Codex, OpenCode from hyperlogue/r3. It costs 4,845 tokens per session, scanned A, original, MIT.

Repository instructions for r3, a local tool for reviewing AI-written code and documents in a browser and sending feedback back to the agent.

In plain words
What is it for?
Use them when working on the local daemon, command-line tool, browser application, stored reviews, file or diff capture, feedback, or live server-sent updates.
Why use it?
They explain the system's parts and data flow so changes preserve reviews, comments, replies, and live updates.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: reads .claude/ paths; mentions subagents.

This is hyperlogue/r3's own configuration. It tells Codex and OpenCode how to work on r3 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 r3 configures →

Reuse

Borrowing it

Nothing to install: this file belongs to hyperlogue/r3. 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/hyperlogue/r3/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/hyperlogue/r3

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

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

Your own site · 80×15
<a href="https://agentmods.dev/instructions/hyperlogue/r3/agents-md"><img src="https://agentmods.dev/badge/instructions/hyperlogue/r3/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 4,845 This file is loaded in full into every session.
When invoked 4,845 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.04845 $0.04845
Opus 5.5 $0.01938 $0.01938
Sonnet 5.5 $0.00969 $0.00969
Haiku 4.5 $0.00485 $0.00485

Measured today against content hash f7af022acf9d, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

r3 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 today.

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 · 324 lines

How it starts

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

r3 — Render. Review. Refine.

r3 is a local-first workspace for published artifacts and human/agent conversations. A per-user server owns immutable content and persisted threads; the browser, CLI, and agents use the same HTTP/JSON contract. The server, worker, CLI, and SPA ship as one self-contained binary. Read README.md for usage.

Write README.md for human readers evaluating and getting started with r3. Keep agent instructions, protocol semantics, and exhaustive feature details in the agent guide or reference documentation.

Use CONTEXT.md for domain terminology. Backend names the entity; server and notification worker name its storage and local notification roles. Subscription names notification routing state; selected subscription names the one currently chosen. Existing protocol fields retain their wire spellings.

This file, the artifact design, schema explanation, and the deep-reference skills below are the design source of truth. Update the document that owns a decision when it changes. Verification maps behavior to executable acceptance checks. Earlier live-file reviews have been retired; imported historical evidence remains readable but does not define new API behavior.

Architecture

The HTTP/JSON contract is the product. Start at shared/artifacts.ts (re-exported by shared/types.ts), then server/artifact-api.ts, cli/artifact-commands.ts, and web/src/artifact-api.ts. Keep all three clients aligned.

publisher: capture local files/git → CLI HTTP upload ─┐
browser: fetch + authenticated event stream ──────────┼→ backend server
agent: CLI/HTTP publications, threads, claims ───────┘    SQLite + immutable blobs
local agent harness ← persistent worker ← outward stream ← selected backend
opaque preview document → scoped version bytes + trusted r3 runtime
  • The server is the only SQLite writer. Storage and domain services are explicitly constructed and injected; importing modules must not open a database.
  • Ordinary requests use artifact/version identity. The server never resolves a publisher path, Git repository, worktree, or live file. Git and directory capture run on the publisher. Direct upgrades from live-review stores require r3 1.5.0 first; current startup upgrades only artifact schemas.
  • Projects are optional groups, assigned explicitly or inferred from a sanitized publisher-supplied Git remote under server policy. Their IDs do not derive from paths or URLs. Later publications preserve the group; deletion preserves artifacts.
  • One logical agent session identifies one run. Multiple agents, including subagents, use distinct IDs. Sessions are attribution, not credentials, accounts, artifact ownership, or live presence.
  • Local mode starts the same backend server lazily and announces it in $XDG_RUNTIME_DIR/r3/daemon.json. A private Unix sidecar bootstraps local CLI credentials. A loopback-only server needs no login unless requireLogin=true; any external bind, host, public URL, or trusted proxy always requires login and refuses requireLogin=false. No-login mode refuses forwarded requests, issues no credentials, and the browser warns once about it unless disableLoginNotice is set. Publication URLs stay stable; r3 open needs a one-time sign-in ticket only when local login is required. Browser boot never exposes the API credential. Backend selection is R3_URL, nearest project .r3.json, user backendUrl, then automatic local. Saved credentials are keyed by the complete normalized URL; r3 login supports browser approval or an API key. The separate persistent worker opens only private Unix IPC and outgoing backend streams. CLI data/watch go directly to the backend. Read remote protocol for auth, recovery, and wire rules.
  • The loopback application listener dispatches scoped preview paths separately from its authenticated API. Previews use the browser's r3 address automatically; every rendered document has an opaque browser origin and no application credentials. App HTML downloads are attachments; the workspace checks browser capabilities and obtains any required consent before loading executable documents.
  • SSE carries invalidations after committed writes. Clients refetch state on ready or reconnect. No filesystem watcher or live-content fallback remains.

Read the full file on GitHub · 324 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. today Changed · +5 lines · +101 tokens per session f7af022acf9d
  2. 11d ago Changed · +23 lines · +406 tokens per session 00450d904a09
  3. 12d ago Changed · +4 lines · +57 tokens per session 7d33bac3a674
  4. 13d ago Changed · +8 tokens per session 879ccbea8f72
  5. 14d ago Changed · -5 tokens per session 98ae8ab310b2
  6. 15d ago Changed · -2 lines · -27 tokens per session df31016fa9a1
  7. 17d ago Changed · +4 lines · +35 tokens per session e7586816c7bf
  8. 18d ago Changed · +2 lines · +31 tokens per session 2661c84b4a6e
  9. 25d ago Changed · +6 lines · +85 tokens per session d18b6aaba60d
  10. 29d ago First seen · 282 lines · 4,154 tokens per session scan A a77b7bcf51c6

Subscribe to this mod's changes

r3 AGENTS.md is an instructions file published in the GitHub repository hyperlogue/r3 (45 stars, last pushed today), licensed MIT. It adds 4,845 tokens to every session, about $0.0194 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.

Related

Other instructions, from other repositories

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 9,649 tokens

next.js AGENTS.md

AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,384 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, cache eligibility and rollout and applying the notice (cutover).

microsoft/vscode · 5,262 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,680 tokens

vscode copilot-instructions.md

Copilot instructions for microsoft/vscode, covering vs code copilot instructions, project overview, root folders, core architecture (src/ folder) and built-in extensions (extensions/ folder).

microsoft/vscode · 2,731 tokens

deno copilot-instructions.md

Copilot instructions for denoland/deno, covering deno development guide for github copilot, network access, high level overview, key directories and key files to understand first.

denoland/deno · 3,077 tokens