Claude Code reads CLAUDE.md and Codex reads AGENTS.md at the start of a session. Both are useful for the same thing: rules that stay true for a long time.
Include
- Commands: how to install, build, run tests and lint.
- Layout: where the main parts live, in a few lines.
- Conventions: naming, formatting, error handling, where tests go.
- Boundaries: folders and files the agent must not edit, such as generated code.
- Review rules: what a change needs before it is submitted.
Leave out
- Today’s findings and failed attempts. They change daily and belong in records with a status.
- Secrets of any kind.
- Long explanations of history. A link to a decision record is enough.
- Instructions copied from the web you did not review.
Keep two files in step
If the team uses both tools, keep the rules in one file and make the other point to it, or generate both from one source. The comparison page lists which file each tool reads.
Review it like code
An instruction file steers every session. Change it through a pull request, and read it once a quarter to delete what is no longer true.