One AGENTS.md for Claude Code, Codex and Copilot
TL;DR
AI tools follow written instructions, and Taproot keeps those instructions in one shared file that every tool reads.
Two AI tools, Claude Code and OpenAI Codex, build Taproot. Whichever one writes the code, the other reviews it.
One file means one set of rules. When the same rule lives in two places, the copies eventually disagree.
Instructions can grow too long for a tool to read in full. In October 2026 we cut ours to about a third of its size, and we check it regularly for length, contradictions and outdated rules.
Why I keep one set of AI instructions
Keeping agent definitions DRY is just as important as keeping code DRY. If you want AI to do something consistently, it needs consistent instructions.
AI instructions are the seed that controls how any session grows. When I think about coding with AI tooling like a garden, I end up with fewer weeds.
Taproot gets worked on by two AI tools, Claude Code and OpenAI Codex. I use them interchangeably and hand each task to whichever model release is better at it right now. Whichever one writes the code, the other reviews it. (GitHub Copilot reads repository instructions too, but I've stopped using it. It's too expensive.)
I started using two models for a practical reason: I kept burning through my entire Claude usage, so I started paying for OpenAI's models too. Codex did a good job, and I've used both ever since. I kept both because the models are different. When they review each other's work, each catches things the other missed. If you care about quality, I'd recommend building with at least two models.

Each tool has a file it reads first: CLAUDE.md for Claude Code, AGENTS.md for Codex, .github/copilot-instructions.md for Copilot. Give each its own copy of the rules and the copies drift, and a review starts depending on which copy the reviewer read.
So we keep one canonical file, AGENTS.md, and every tool reads it. A rule that lives in two places eventually says two different things.
How do Claude Code, Codex and Copilot share one AGENTS.md?
Codex reads AGENTS.md (opens in a new tab) natively, walking from the project root down to the current directory. Nothing to set up.
Claude Code's memory docs (opens in a new tab) say current versions read AGENTS.md too, but only when there's no CLAUDE.md in the working directory or above it. We have Claude-only notes, so our CLAUDE.md imports the shared guide on its first line, and an @path import loads every session as if it were inline. Below it is a model and credit budget for when Claude hands out work:
@AGENTS.md
## Model and credit budget — Claude only
This section is for Claude sessions; nothing here changes `AGENTS.md` or the
loop in [`docs/playbooks/work-task.md`](docs/playbooks/work-task.md).
Claude dispatches follow the playbook's cost ceiling. Prefer a current-
generation balanced model for substantive implementation and use `high`
reasoning for adversarial review by default.
...Copilot also reads AGENTS.md files (opens in a new tab). It can't import a file, so our .github/copilot-instructions.md is a pointer that repeats none of the rules. This is the whole file:
# Taproot: GitHub Copilot Instructions
Copilot has no file imports, so this file only points to the canonical guide.
Read [`AGENTS.md`](../AGENTS.md) in the repo root first: it covers architecture,
workflow, verification, code conventions, and the code-review output format.
Use the files in `.github/instructions/` (`csharp`, `typescript`, `proto`) only
as file-type reminders; where they overlap with `AGENTS.md`, follow `AGENTS.md`.What goes in AGENTS.md?
The top-level outline of Taproot's guide, about 590 lines:
What Taproot is
How to work in this repo: backlog tasks, verifying before handing off, the Tilt dev environment, tests and coverage, the Git workflow, task tracking, and the code review format
Architectural principles: contracts first, the command pipeline for all mutations, one authorization point per endpoint, client-first processing, shared code, typed outbox messages, and bounded contexts
C# and API conventions
TypeScript and frontend conventions
Protobuf conventions
Dependency philosophy
Area-specific architecture: one-line rules that link to longer documents in
docs/
Each rule targets a failure we've actually hit and points at one example in the code. Long explanations live in linked docs the AI tool opens when it needs them, and any rule a script can check becomes a guard instead of a paragraph (real ones are in how we enforce coding standards when AI writes the code). Same habit as documentation-first development: a guide is useful when it's specific.
It also fixes the review output format. Every review ends with one JSON array of findings, each with a file, line, severity (blocker, warning or nit) and suggestion, so findings from Claude Code and Codex can be tracked the same way.
Path-specific instructions with applyTo
Copilot supports path-specific instruction files (opens in a new tab) in .github/instructions/, each with an applyTo glob in its front matter. Copilot uses a matching one alongside the repository-wide file. Our three (C#, TypeScript, protobuf) are deltas: short reminders that must never contradict the main guide. Our review prompt points Claude Code and Codex at them too.
---
applyTo: "**/*.proto"
---
# Protobuf Review Deltas
`/AGENTS.md` is the canonical repo-wide guide. This file only captures
protobuf-specific reminders that are useful to surface when reviewing `.proto`
files.Why both models need to read the same rules
When Claude Code finishes a task, it reviews the change in a fresh, review-only context. Then Codex reviews it in a read-only sandbox through a small file-based exchange in the repository. When Codex wrote the code, Claude Code (claude -p) does the external review instead.
Two models only help if they judge the change against the same rules, so the review prompt names the files, including the backlog task (those live as Markdown in the repo, which I covered in we put our backlog in Git):
Read AGENTS.md,
docs/tasks/active/{{TASK}}.md, the full diff (`git diff {{BASE_SHA}}` plus the
untracked files listed below), relevant callers and callees, and matching
.github/instructions files.Should you use an import, a symlink, or a pointer?
AGENTS.md (opens in a new tab) is an open format, now stewarded by the Agentic AI Foundation under the Linux Foundation. When a tool also has its own file that it reads first, you have three ways to connect the two.
An import is what we use for Claude Code. The shared guide loads every session, and there's room for tool-specific notes underneath.
A symlink (ln -s AGENTS.md CLAUDE.md) works if you have nothing tool-specific to add, unless anyone clones on Windows, where Git may check the link out as a one-line text file.
A pointer, a file that tells the tool in words to go read AGENTS.md, is the weakest option. Anthropic's docs are blunt: Claude sees the file only if it decides to open it. Save pointers for tools like Copilot that support nothing better.
How to audit your AI tool instructions
An instruction file is code with no test suite, and it rots like documentation. The audit I did while writing the first version of this post found three problems that had been sitting there for months:
The protobuf delta said every RPC needs a
google.api.httpannotation.AGENTS.mdsays internal-only RPCs omit it so JSON transcoding doesn't expose them as REST endpoints (the example is in from .proto to a typed TypeScript client). A reviewer reading a.protochange got both rules.AGENTS.mdhad grown to about 98 KB. Codex stops reading project instruction files at 32 KiB combined by default, so most of the guide never loaded.A lot of it was wordy: rules restated several ways, explanations of things the code already made obvious, and workflows we no longer use.
We fixed all three in early October. The delta now matches, and a concise rewrite, with long material moved into linked docs, got AGENTS.md to about 32.5 KB. It has since crept back to about 34 KB, so the last few area-specific rules don't reach Codex again.
Put a recurring audit on the calendar like you would dependency updates. Each time, check:
Size. Run
wc -c AGENTS.mdand compare it with Codex's 32 KiB default (project_doc_max_bytes). An import doesn't make the text cheaper; it still loads every session.Contradictions. Read the canonical file next to every tool-specific and delta file, and search the deltas for the old wording of any rule you changed.
Stale rules. Delete instructions for code, tools or workflows that no longer exist.
Wordiness. Cut filler and rules said three ways. Concise rules are easier for the AI tool to follow and for you to keep accurate.
Rules that should be guards. If a script can check it, write the check and shorten the prose.
Claude Code can help with contradictions: /doctor prompt-audit (v2.1.283 or later) checks your CLAUDE.md, AGENTS.md and .claude/ files for conflicts and references to files or commands that don't exist, and changes nothing until you ask. /context shows whether CLAUDE.md actually loaded.
Does the shared file have to be called AGENTS.md?
No. Our design system repository, taproot-controls, keeps its shared guide in AI_GUIDELINES.md, and its CLAUDE.md, AGENTS.md and Copilot file point to it. Its AGENTS.md also carries a generated block for Trellis, our backlog toolkit. That CLAUDE.md is still a written pointer, so it has the weakness above; a one-line @AI_GUIDELINES.md import would fix it.
How to set up one AGENTS.md in your own repository
Pick one canonical file.
AGENTS.mdis the name the most tools read without extra setup.Move everything shared into it. Compare it section by section with any existing
CLAUDE.mdor Copilot file before you delete those copies.Import it where the tool supports imports and point to it where it doesn't. With nothing Claude-specific, skip
CLAUDE.mdand let Claude Code readAGENTS.mddirectly.Keep per-language files to reminders, and search them for old wording whenever a main rule changes.
Turn the rules you can check into scripts, so a drifted sentence fails a build instead of a review.
Use at least two models, and name the canonical file in every review prompt.
Audit on a schedule: size, contradictions, stale rules and wordiness.