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.
Asked to change a config, it builds a framework: minimum sufficient change, reuse first, ask before widening, test narrowly.
Complete the current task with the minimum sufficient change.
## Before editing- Read the relevant code, tests, and configuration directly. Do not work from search snippets or guesses.- If the requirement is ambiguous or the premise is unverified, resolve that before building on it.
The agent codes for races that never happen: one line makes it state the risk and the odds, then wait for your OK.
Before you add code for a race condition or security edge case that is unlikely or purely hypothetical, tell me exactly what would go wrong, how likely that is, and how much complexity the extra code adds, in words a 10-year-old could understand. Then wait for my OK. Don't quietly widen the scope to guard against problems that only exist in theory.
No users yet, but the agent adds compatibility code and migrations: skip both, then docs, tests, smallest change and cleanup.
Only for projects with no real users yet.
## Ground rules- No backward compatibility, no data migrations- Replace what you change with the simplest code that works, and update every caller in the same change
Even a tiny change gets null checks at every layer: Codex checks data once where it comes in, then just uses it.
- Validate unknown values once at the boundary that owns them. Pass typed values inward instead of repeating `typeof value === "object"` and property-existence checks.- Do not defensively revalidate values already guaranteed by a schema, constructor, or internal type.- Do not extract single-use helpers preemptively. Inline the logic at the call site unless the helper is reused, hides a genuinely complex boundary, or has a clear independent name that improve…
Questions you’d only rubber-stamp: work you can undo done and shown after, a stop at anything you can’t undo.
Walk through two-way doors and show me after. Stop at one-way doors.
Two-way door: anything you can undo. Code, branches, PRs, test data, dev infra.
One-way door: anything you can't. Prod data, deploys to users, force-pushing a shared branch, deleting what you didn't make, a message sent to another person.
If my answer would be a rubber stamp, don't ask. If running something could answer…
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.
Over a long task you make a lot of small decisions for me: the defaults, what's out of scope, which request wins when two of them clash. A summary that says everything went well hides all of that. So before you say it's done, ask yourself "Did I miss anything?" and fix what you find. Then put every decision you made without asking on a one-screen HTML page outside the repo, in words a 10-year-old can follow. Only the ones that change the result, with the ones I need to confir…
What it needs from you is buried mid-report: one AGENTS.md section puts the to-dos, numbered, at the top of every report.
When a long task is done, or you're stuck and need me to do something, list what you need from me at the very top of your reply. One thing per item, numbered. Spell out what I should do, where, and what to send back to you when I'm done, e.g. "Log into Stripe, export the September refunds CSV, put it in inbox/". Whatever's blocking you most goes first. If you don't need anything from me, just say so.
Image options drawn one at a time burn your limits: a global rule puts them all in one numbered grid, then builds your pick.
Add an image rule to my global Codex AGENTS.md (in ~/.codex; if an AGENTS.override.md exists, add it to that file):
- If it's unclear what I want (what it is, who it's for, what style), ask me one or two questions first. If it's clear, just generate the image.- When I ask for multiple options, variants or style comparisons, put them all in one image: a grid sized to the count (9 options → 3×3), each cell numbered, and generate only that one image.- After showing it, tell…
Agent links that say localhost: Tailscale links to previews, review pages and dashboards that open right on your phone.
Any time you give me a link to something running on this computer (a preview, a review page, a dashboard), give me a Tailscale link, never localhost. I work across several computers and my phone. Publish it with tailscale serve, open the link yourself to check it works, then send it.
A reviewer keeps flagging the same things: 50 recent PRs scanned, issues ranked by count, your picks written into AGENTS.md.
Use gh to scan the 50 most recent PRs in each GitHub repo under [CODE DIRECTORY]. Find the issues [REVIEWER GITHUB USERNAME] keeps flagging. Rank them by frequency and link the relevant PRs. Wait for my approval, then add only the rules I choose to ~/.codex/AGENTS.md.
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.
Go through the corrections in AGENTS.md or CLAUDE.md and the last 50 commits in this repo (focus on fixes and reverts). Find patterns the agent keeps getting wrong that lint can catch, up to 3. If you find fewer, report fewer. For each one:
1. Write a helper function or type that wraps the right way to do it2. Add a rule in the lint tool the project already uses that bans the old pattern, with an error message that names the…
Astra flags bugs that almost never happen and Opus fixes each one: bugs scored, low scores filed as issues, code left alone.
Rate each bug from 1 to 10 on how often it would happen and how bad it would be. If the two scores multiplied are below 5, just file it as an issue and leave the code alone.
AGENTS.md past 200 lines gets followed less: 3 slimmer versions, each more aggressive, nothing lost, shown before changes.
Read these two docs, then read my AGENTS.md (and CLAUDE.md, if the project has one) and the files it imports, and give me three ways to restructure them:
1. Delete instructions that do nothing: things Opus already does, and things it can tell from the code. Merge duplicates, and list any contradictions so I can choose.2. Keep only the rules needed every time in the root AGENTS.md, under 200 lines. Move rules that only matter for one folder into that folder's own AGENTS.md, and…
Rules from older models make Astra over-read or stop early: the triggers, required reading, checks and stop rules to cut.
Read this guide and review my project’s AGENTS.md and Skills. Identify overly broad skill triggers, documents you’re required to read for every task, redundant checks, conflicting instructions, and rules that make you stop for confirmation before the task is complete.
For each issue, quote the original instruction, explain its potential impact, and suggest the smallest change needed. List any proposals involving safety, permission boundaries, or reduced verification separately…
Models and cost + Codebase·
Paste it where your agent reads it. Copybook in your agent can look up tips like this mid task.Send it to your computer for later.Add to your agentEmail me
Copybook Pro: line-by-line review of your CLAUDE.md or AGENTS.md, and tip lookups from your agent with no daily limit. Early bird: $59 for the 1-year pass. The price rises as Pro grows.See Pro