An engineer asks a coding agent to add a time zone selector to exported reports. The work touches three repositories: the web app, the reporting API, and the JavaScript SDK. In one checkout, the agent finds an old note proposing that the API start returning local timestamps. In another, it finds a test that expects UTC. Both files are real. Neither tells it what the team agreed to yesterday.
That is the point at which a useful AGENTS.md starts to turn into a bad project diary. Put instructions that travel with the checkout in the file. Give the team a separate, shared place for decisions and evidence that change as the work moves.
What should you put in AGENTS.md?
Start with the instructions a new contributor would need in their first half hour: how to set up the repository, what to run before asking for review, and the conventions that are easy to miss by reading the code. Add a map only where the folder names do a poor job of explaining ownership. The AGENTS.md project has examples of these files in actual repositories, including how teams split guidance across directories.
A rule is worth keeping when you can point to the failure it prevents. “Change the API description and regenerate the client” protects a boundary that a coding agent can otherwise miss. “Write clean code” leaves it guessing. If the requirement must hold every time, enforce it in tests, CI, or permissions and point to that check from the file.
A short template for one repository
Here is a starting file for an SDK built with Node.js that defines an npm test script, commits its lockfile, and generates its request types from the API description. The commands should match the actual repository. A team that uses pnpm or has a separate integration suite would name those commands here.
# AGENTS.md
## Setup and checks
* Use npm ci to install from the committed lockfile.
* Run npm test before requesting a review.
* When a public response changes, include a compatibility test.
## File ownership
* Change generated request types at their source: the API description.
* Follow the generation command in CONTRIBUTING.md.
## Work that spans repositories
* Start from the current decision and task in the shared project record.
* Link the PR and CI results there when another repository depends on them.That is enough to give an agent a useful starting point. In the web app, the file might point to the fixture for the export screen. In the API repo, it might identify the compatibility suite and the canonical contract. Keep the last two rules in both places if both teams actually use them. Some repetition is cheaper than relying on a developer to know where an invisible global configuration lives.
Where do nested files help?
Use a file at the repository root for rules that apply across that checkout. In a monorepo, a package can have more specific guidance for its own tests or generated files. Codex documents how it discovers these files, from broader guidance down to the working directory. Treat that as behavior of the tool, not as a guarantee that every agent resolves instructions the same way.
Separate repositories are a different problem. A file in the SDK checkout does not load instructions from the adjacent API checkout simply because both are part of the same release. Start a fresh session in each repository and ask which instructions it actually found and what it would run for a small change. When the answer is off, fix the starting directory or the guidance before giving the agent more work.
Keep the release decision where all three teams can find it
In the report export example, the team decides to preserve UTC in existing API fields and use the selected time zone for display in the export. The SDK will accept a new optional time zone argument. Existing callers keep their current behavior. The API contract and tests remain where the code is maintained.
The useful project record is small: the accepted decision, why the team made it, the test that protects existing callers, and the three pieces of work that still have to land. Mark the older proposal as superseded in that record and link it if the discussion explains the choice. When the team changes the plan, update the record and its tests. A stable pointer in each AGENTS.md can stay as it is.
This is where a private Swarm Space helps. Put the accepted decision in the Space thread, attach or link the evidence people are authorized to share, and give each repository its own Task. Connect the coding tools your team already uses to the same Space. A connection with read access can retrieve the decision; a connection with the appropriate work permissions can also save the next update. The coding tool still needs its own repository access.
On Friday, the engineer working on the SDK may finish first. Have them or their connected agent leave the PR, the test result, and any unresolved dependency in the Space. On Monday, the web engineer can open a fresh session and ask which time zone behavior is approved and whether the SDK change is ready to use. A useful answer states the decision, links the evidence, and says what it cannot confirm. The guide to large engineering projects with AI follows this kind of handoff across a longer release.
Before you make AGENTS.md part of the workflow
Review changes to the file like changes to a build script. Remove instructions tied to an incident that has passed. Keep secrets out. When contributors use several agent tools, check where each tool reads its guidance before adding duplicate files. Keep personal preferences local so the shared file stays about the repository. If a new developer will use these instructions in their first week, include them in a first assignment brief they can work from.
Try the split on one change that crosses two repositories. Give both agents a brief local file and a pointer to the same accepted decision. When the plan changes, record the reason and check that a fresh session in each repository can find the revised decision. If you still need to paste yesterday's transcript, you know what is missing from the record.