CopybookSearch

AGENTS.md examples for Codex and Claude Code

AGENTS.md is a plain Markdown file of instructions that coding agents read before they work in your project. It has no required fields. agents.md lists the agents that read it, among them Codex, Cursor, Gemini CLI and GitHub Copilot’s coding agent.

Codex reads ~/.codex/AGENTS.md for every project, then one file a folder from the repo root down to the folder you are in. A file nearer your folder comes later, so its rules win. Codex stops adding files once they reach 32 KiB, the default project_doc_max_bytes in OpenAI’s docs. Claude Code reads AGENTS.md when the project has no CLAUDE.md.

15 tips36K+ saves on X, as of

Keep small tasks small

Rules Claude Code, Codex

Vox’s pick

2.1K saves

Scope Guard: AGENTS.md rules for small tasks

Asked to change a config, it builds a framework: minimum sufficient change, reuse first, ask before widening, test narrowly.

Codebase + Review

Rules Claude Code, Codex

598 saves

Ask before edge-case code: one AGENTS.md line

The agent codes for races that never happen: one line makes it state the risk and the odds, then wait for your OK.

Codebase

Rules Claude Code, Codex

756 saves

No compatibility code yet: AGENTS.md rules

No users yet, but the agent adds compatibility code and migrations: skip both, then docs, tests, smallest change and cleanup.

Codebase + Review

Rules Codex

1.4K saves

Less defensive code: 4 AGENTS.md rules

Even a tiny change gets null checks at every layer: Codex checks data once where it comes in, then just uses it.

Codebase

When to stop and ask

Rules Claude Code, Codex

257 saves

One-way door rules for AGENTS.md: when to ask

Questions you’d only rubber-stamp: work you can undo done and shown after, a stop at anything you can’t undo.

Long runs + Codebase

Rules Claude Code, Codex

383 saves

Decision page rule for long tasks

A summary saying all went well hides the agent’s choices: one screen of the ones that change the result, those to confirm in red.

Long runs + Review

Rules Claude Code, Codex

782 saves

To-dos first in long reports: an AGENTS.md rule

What it needs from you is buried mid-report: one AGENTS.md section puts the to-dos, numbered, at the top of every report.

Long runs + Codebase

Pages, images and previews

Rules Claude Code, Codex

15K saves

Two AGENTS.md lines: less text, UX/DX/AX

Taglines, helper text and labels on every screen: one line cuts them so the layout speaks for itself; one weighs UX, DX and AX.

Design + Codebase

Rules Codex

379 saves

Image options in one grid: an AGENTS.md rule

Image options drawn one at a time burn your limits: a global rule puts them all in one numbered grid, then builds your pick.

Design + Models and cost

Rules Claude Code, Codex

4.2K saves

Tailscale preview links on your phone: a rule

Agent links that say localhost: Tailscale links to previews, review pages and dashboards that open right on your phone.

Review

Turn repeat mistakes into rules

Rules Codex

1.6K saves

Repeated PR comments as AGENTS.md rules

A reviewer keeps flagging the same things: 50 recent PRs scanned, issues ranked by count, your picks written into AGENTS.md.

Codebase + Review

Rules Claude Code, Codex

184 saves

Repeat mistakes as helpers and lint rules

The agent keeps making one mistake: the right way in a helper, the old way banned by lint, an error that names the helper to use.

Codebase + Review

Rules Claude Code, Codex

3.2K saves

Bug-score rule for Astra’s code reviews

Astra flags bugs that almost never happen and Opus fixes each one: bugs scored, low scores filed as issues, code left alone.

Review

Trim the file

Prompt Claude Code, Codex

781 saves

3 slimmer AGENTS.md plans side by side

AGENTS.md past 200 lines gets followed less: 3 slimmer versions, each more aggressive, nothing lost, shown before changes.

Codebase + Models and cost

Rules Codex

5K saves

Old-rules review for Astra, by OpenAI’s guide

Rules from older models make Astra over-read or stop early: the triggers, required reading, checks and stop rules to cut.

Models and cost + Codebase