CODEX RESET RADAR Codex Reset Radar
中文
PRO TIPS · Workflow Setup

Adding AGENTS.md to an Existing Repo: A 20-Minute SOP

Updated: 2026-10-18~3 min readsources × 2

TL;DRWhen Codex misbehaves in an old repo, the model usually isn't the problem — nobody told it the rules. This is a 20-minute SOP for backfilling an AGENTS.md: draft with /init, fill in a four-block skeleton, validate on a small task, write corrections back.

Sources SOURCES

Distilled from public community discussions. This page only breaks them down and verifies — it never reposts the original; opinions belong to their authors.

Facts FACTS

Check these claims against the listed sources. For allowance mechanics, first-party account displays outrank community summaries.

Concepts CONCEPTS

Not everything said in a community thread is a fact — each concept carries its nature label. Read the label first.

AGENTS.mdSource-checkable

A file that lives in the repo and is written for coding agents: what the project is, how the commands run, what the rules are. Pure Markdown, one copy shared by humans and agents.

Persistent instructionsSource-checkable

The official best-practices framing: constraints that hold across sessions get locked into standing instructions instead of being re-issued by hand every time you open a session.

Draft dependenceCommunity opinion

Running /init and adopting the output without proofreading. Community experience says drafts routinely mix in model guesses — script names that don't exist, stale paths — and shipping them as-is cements the errors into an instruction file the agent will trust more than its own judgment.

Docs written for the agentCommunity opinion

An influential community position: AGENTS.md should serve the agent first — commands it can execute, boundaries it can verify. Vision statements and sentiment don't constrain a model.

Step-by-step SOP STEP BY STEP

GOALTake over an existing repo that has no AGENTS.md and produce a minimum viable version — in 20 minutes — that keeps Codex on the rails.
YOU NEEDCodex CLI is installed and logged in locally; the repo builds and runs on your machine.
  1. 01
    Generate the draft

    Start codex in the repo root, type /init, and let it scan the codebase into a first-draft AGENTS.md.

  2. 02
    Delete what it guessed wrong

    Read the draft end to end. Anything you can't personally vouch for — script names, paths, version numbers — check one by one: fix the wrong ones, delete the nonexistent ones. The draft is a starting point, not a deliverable.

  3. 03
    Fill in the four blocks

    Complete project context, architecture notes, dev commands, and coding conventions. Every command must actually run in this repo — the agent will execute what you wrote, not what you meant. While you're at it, mark which commands are slow and which have side effects.

  4. 04
    State the no-go zones

    List what must never be touched: generated directories, lockfiles, environment configs. Silence reads as permission — for anything you didn't explicitly forbid, the agent defaults to trying it, so the fence has to be written down.

  5. 05
    Validate on a small task

    Have it fix one known small bug or add one unit test. Watch whether it reaches for the right commands from AGENTS.md and whether it stays out of the no-go zones.

  6. 06
    Write corrections back

    For every class of mistake it makes during validation, add the matching constraint to AGENTS.md. This file earns its keep through continuous appending, not one heroic write.

RESULTThe repo root now holds a proofread AGENTS.md. In new sessions Codex uses the right commands and avoids the no-go zones from the first prompt — and every future correction is a one-line append away.

Want today's verdict? Back to the live radar.

More Workflow Setup playbooks SAME CATEGORY

🎯 Any confirmed public reset today?
Open the signal radar for sourced announcements; personal allowance and exact reset time remain in Usage.
Open the signal radar →