# How to test an AGENTS.md change before it reaches your team

> Test an AGENTS.md change the way you test code: run the same held-out tasks with the old file and the new one, several times each, and compare pass rate, tokens and cost, task by task. AutoRouter, the Mac app for all your coding agents, builds a free company benchmark from your merged work that you can rerun whenever your AI setup changes.

Authors: AutoRouter
Author profile: https://autorouter.com/about
Published: 2026-11-25T21:30:00.000Z
Reading time: 9 min
Canonical: https://autorouter.com/blog/test-agents-md-changes
Part of: What is an LLM router? (https://autorouter.com/blog/what-is-an-llm-router.md)
Publisher: AutoRouter (https://autorouter.com)

## Key facts

- A February 2026 study found that context files such as AGENTS.md did not generally improve coding agents' task success and raised inference cost by over 20% on average ([Gloaguen et al.](https://arxiv.org/abs/2602.11988)).
- Claude Code reads AGENTS.md only when there is no CLAUDE.md or CLAUDE.local.md in the working directory or above it, so an AGENTS.md edit can change nothing in Claude Code ([Claude Code docs](https://code.claude.com/docs/en/memory), read November 25, 2026).
- AutoRouter offers engineering teams a free benchmark built from work they have shipped, which the team keeps and can rerun when its AI setup changes.

To test an AGENTS.md change before your team gets it, run the same set of past tasks with the old file and with the new one, several times each, keeping the model, the agent and its settings the same, then compare pass rate, tokens and cost per task and look for tasks that newly fail. AutoRouter, the [Mac app for all your coding agents](https://autorouter.com), builds a [free company benchmark](/benchmarks) from your team's merged pull requests that you can rerun every time your AI setup changes, an instruction file included. The steps below do the same thing by hand, for AGENTS.md and for CLAUDE.md, Claude Code's equivalent. AutoRouter wrote this post.

![AutoRouter's benchmark tests AGENTS.md on shipped work. 1. Hold out past tasks (Merged PRs with tests); 2. Freeze everything else (Model, agent, settings); 3. Run old and new (Three or more runs each); 4. Compare the results (Pass rate, tokens, cost); 5. Ship without regressions (No task newly failing). Source: Gloaguen et al., 2026; Anthropic, November 19, 2024; AutoRouter benchmarks, November 25, 2026.](https://autorouter.com/blog/images/test-agents-md-changes/1-ab-test.png)

## Why test an AGENTS.md change at all?

Test it because a change to an instruction file can make your agents worse and more expensive without anyone noticing. In a study published in February 2026, [Gloaguen et al.](https://arxiv.org/abs/2602.11988) ran several coding agents and models on real issues with and without context files such as AGENTS.md. Context files did not generally improve task success and raised inference cost by over 20% on average, whether a model or a developer wrote them. Agents followed the instructions well; the repository overviews that many files open with did not help. The authors conclude that any attempt to improve performance with these files "should be rigorously evaluated before deployment."

That doesn't mean AGENTS.md is useless. The same study found the files useful for specifying non-standard coding practices: rules an agent can't work out from the code, like which package manager or test command a repository uses. It means you can't tell from reading a diff whether a new paragraph helps, and every developer on the team pays for the extra tokens on every request.

## Where do coding agents read AGENTS.md and CLAUDE.md?

Each agent reads its instruction files from your home folder down to the folder you work in, and the rules differ enough that an edit can reach one agent and not another. As of November 25, 2026:

| Agent                                                                 | Files it reads                                                                                 | Where                                                                                                             | Watch for                                                                             |
| --------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
| [Codex](https://learn.chatgpt.com/docs/agent-configuration/agents-md) | `AGENTS.override.md`, else `AGENTS.md`                                                         | `~/.codex` (or `CODEX_HOME`), then each folder from the repository root down to the working folder                | One file per folder; stops adding files at `project_doc_max_bytes`, 32 KiB by default |
| [Claude Code](https://code.claude.com/docs/en/memory)                 | `CLAUDE.md`, `.claude/CLAUDE.md`, `CLAUDE.local.md`; `AGENTS.md` only when none of those exist | `~/.claude/CLAUDE.md`, then every folder above the working folder at launch; subfolders when Claude works in them | With a `CLAUDE.md` present, it skips `AGENTS.md` unless the `CLAUDE.md` imports it    |
| [Cursor](https://cursor.com/docs/context/rules)                       | `AGENTS.md`, beside `.cursor/rules`                                                            | Project root and subfolders                                                                                       | Nested files combine with their parents; the more specific one wins a conflict        |

Two things follow for a test. First, make sure the file you edited is the one being read: in Claude Code, run `/context all` and check the list under Memory files, or `/memory`, which lists an `AGENTS.md` it read. Second, keep personal files out of both sides of the comparison. A `~/.codex/AGENTS.md`, a `~/.claude/CLAUDE.md`, a `CLAUDE.local.md` or Claude Code's auto memory loads alongside the team's file and can hide or fake an effect.

![Your personal files load too, so isolate them. Codex: 1. Global AGENTS.md (~/.codex or CODEX_HOME); 2. Repository root (Override file, then AGENTS.md); 3. Each folder down (Closer files come later). Claude Code: 1. User CLAUDE.md (~/.claude/CLAUDE.md); 2. Each folder down (CLAUDE.md, else AGENTS.md); 3. Subfolders on demand (When Claude works there). Codex stops adding files at 32 KiB by default; Claude Code also loads CLAUDE.local.md. Source: OpenAI Codex AGENTS.md guide and Claude Code memory docs, read November 25, 2026.](https://autorouter.com/blog/images/test-agents-md-changes/2-where-files-load.png)

## Which tasks should you test an AGENTS.md change on?

Test it on past tasks your team already shipped, with tests that check the result. Take recent merged pull requests that changed both source and tests, start each task from the code as it was before the change, write the goal without the fix, and hold back the tests to grade with afterward. [How do you build an AI coding benchmark for your company?](/blog/build-an-ai-coding-benchmark) walks through making these tasks; the same set then serves every instruction, model and agent change you want to try. [How Ramp, Cursor and Uber build AI coding benchmarks](/blog/private-benchmarks-ramp-cursor-uber) shows how larger teams source and refresh theirs.

Include tasks the change should help and tasks it shouldn't touch. A new rule about database migrations should help migration tasks, and the other tasks show whether the extra text costs tokens or distracts the agent everywhere else. Where a task has no tests, grade it with a rubric written before you see any output; grading coding agents: tests, rubrics or an LLM judge covers when each grader fits.

## How do you run an AGENTS.md A/B test?

These steps run on a Mac or a CI runner with git and the agents you already use. Commands are examples; change paths, models and the test command to fit your repository.

**1. Save both versions of the file.** Keep the current file and the proposed one side by side:

```sh
mkdir -p arms
git show main:AGENTS.md > arms/old.md
git show my-agents-change:AGENTS.md > arms/new.md
```

**2. Keep personal instructions out.** For Codex, point `CODEX_HOME` at a clean folder that holds only your sign-in, so no global `AGENTS.md` loads. For Claude Code, run on a machine or account without a `~/.claude/CLAUDE.md`, delete any `CLAUDE.local.md` from the task folders and turn auto memory off with `/memory`.

```sh
export CODEX_HOME="$(mktemp -d)"
cp ~/.codex/auth.json "$CODEX_HOME/"
```

**3. Run every task with each file, three or more times.** Use a fresh copy of the task for every run, the same model and effort, and the same agent version. For Claude Code in a repository that has a `CLAUDE.md`, copy the file to `CLAUDE.md` instead.

```sh
for t in tasks/*/; do for arm in old new; do for run in 1 2 3; do
  w="$(mktemp -d)"; cp -R "$t/repo/." "$w"; cp "arms/$arm.md" "$w/AGENTS.md"
  (cd "$w" && codex exec --json --skip-git-repo-check -s workspace-write "$(cat "$t/prompt.md")") \
    > "$t/$arm-$run.jsonl"
  (cd "$w" && patch -p1 < "$t/tests.patch" && <your test command>) \
    && echo "$t $arm $run pass" || echo "$t $arm $run fail"
done; done; done >> results.txt
```

For Claude Code, the run line is `claude -p "$(cat "$t/prompt.md")" --model opus --output-format json --permission-mode acceptEdits`. Its JSON output includes the run's cost and token counts; Codex's JSON events include token usage, which you can price with the provider's list prices.

**4. Compare the two files.** For each one, work out the pass rate across all runs, the median tokens and cost per task, and the tasks that passed in every run with the old file but failed in any run with the new one. Those newly failing tasks are the regressions to read before anything else.

**5. Ship only what holds up.** Merge the change when it helps the tasks it was written for, costs no more elsewhere and leaves no regression you can't explain. Otherwise cut it back and run again; deleting a paragraph is a change worth testing too.

## How much run-to-run variance should you expect?

Expect enough variance that a few points of pass rate on a few dozen tasks can be noise. Coding agents don't give the same result twice on the same task, so one run per file measures luck as much as the file. Anthropic's [statistical approach to model evaluations](https://www.anthropic.com/research/statistical-approach-to-model-evals) (November 19, 2024) recommends resampling each question several times and averaging, and comparing results question by question as paired differences, since the same questions tend to be easy or hard for both sides. It also found that when questions come in related groups, such as several tasks from one pull request, the honest error bars can be more than three times as wide as the naive ones.

The cheapest way to see your own noise is to run the old file against itself first. The gap between two runs of the same file is your noise floor; a difference between old and new that isn't clearly bigger than it is no difference. Treat every number in this table as an example for a made-up team, not a measurement:

| Example for a made-up team (40 tasks, 3 runs each) | Pass rate | Tokens per task | Cost per task | Tasks newly failing |
| -------------------------------------------------- | --------- | --------------- | ------------- | ------------------- |
| Old file, run A                                    | 60%       | 182,000         | $1.42         | None (baseline)     |
| Old file, run B                                    | 65%       | 179,000         | $1.40         | Noise check         |
| New file                                           | 67%       | 151,000         | $1.18         | 2                   |

![Run the old file twice to see the noise. Old file, run A, 60%; Old file, run B, 65%; New file, 67%. Example for a made-up team: 40 tasks, pass rate over three runs each; a 2-point gain sits inside a 5-point noise floor.](https://autorouter.com/blog/images/test-agents-md-changes/3-noise-floor.png)

In this example the new file's 2-point gain in pass rate sits inside a 5-point gap between two runs of the old file, so the file doesn't make the agent more capable. Its cost per task fell about 16% against a gap of about 1% between the old runs, which is likely real. The two newly failing tasks decide it: read them, and ship the change only if they fail for reasons unrelated to the new text.

## How does AutoRouter's free benchmark test instruction changes?

AutoRouter builds a [free benchmark](/benchmarks) for engineering teams from real work they have shipped, then tunes a custom router, skills and team-wide system prompts against it to save them money. It starts with a diagnostic of the team's agent traces: where agents burn tokens repeating mistakes, what the best engineers do that others could learn, and where the team pays for more intelligence than it needs. The benchmark's tasks come from the team's merged pull requests and agent traces, each starting from the repository as it was before the change and graded against the team's tests or a rubric written with the team.

The team keeps the benchmark and can rerun it every time a new model comes out or its AI setup changes, which is the test above run on its own work. Targets for savings, speed and performance are agreed before tuning, and a paid pilot follows only if they are met. Which repositories, pull requests and transcripts may be read, and where the benchmark runs, are agreed at kickoff. [What is an LLM router?](/blog/what-is-an-llm-router) explains how the routing side works.

To test your next AGENTS.md change on your team's own merged work instead of building the harness yourself, [apply for AutoRouter's free company benchmark](/benchmarks).

## Questions

### Does Claude Code read AGENTS.md?

Yes, from version 2.1.277, but by default only when there is no `CLAUDE.md`, `.claude/CLAUDE.md` or `CLAUDE.local.md` in the working folder or above it. To share one file, have `CLAUDE.md` import it with `@AGENTS.md`, or change the Project instructions setting to read both. Check what loaded with `/memory`.

### How many tasks do I need to test an AGENTS.md change?

No fixed number works for every team; it depends on how big a difference you need to detect. A few dozen tasks with three runs each will show a large effect and miss a small one, and running the old file against itself tells you which gaps your set can resolve. Add tasks before you add runs once the noise floor stays wide.

### Should AGENTS.md include a repository overview?

Test it before you keep one. Gloaguen et al. found repository overviews didn't help agents finish tasks, while instructions about non-standard practices were followed. Short rules the agent couldn't infer from the code, such as the test command or a forbidden pattern, are the safer bet.

### Can I test a CLAUDE.md change the same way?

Yes. Copy each version to `CLAUDE.md` in the task folder, run Claude Code with `-p` and `--output-format json` for the cost and tokens, and compare the same numbers. AutoRouter's [free company benchmark](/benchmarks) runs on the team's own merged work, so either file can be tested the same way.

## Sources

- [Evaluating AGENTS.md: Are Repository-Level Context Files Helpful for Coding Agents?](https://arxiv.org/abs/2602.11988), Gloaguen, Mündler, Müller, Raychev and Vechev, February 12, 2026
- [AGENTS.md](https://learn.chatgpt.com/docs/agent-configuration/agents-md), OpenAI Codex docs, read November 25, 2026
- [How Claude remembers your project](https://code.claude.com/docs/en/memory), Claude Code docs, read November 25, 2026
- [Rules](https://cursor.com/docs/context/rules), Cursor docs, read November 25, 2026
- [A statistical approach to model evaluations](https://www.anthropic.com/research/statistical-approach-to-model-evals), Anthropic, November 19, 2024

## Read next

- [How to write model routing rules in plain English](https://autorouter.com/blog/plain-english-routing-rules.md): AutoRouter, the Mac app for all your coding agents, lets you write routing rules in plain English, such as "Use Claude Opus 5.5 for UI work." When one of your rules applies, it decides the turn, and your rules come before AutoRouter's recommended ones. Choosing a specific model in the picker sends turns straight to that model instead.
- [What is an LLM router?](https://autorouter.com/blog/what-is-an-llm-router.md): An LLM router is software that sits between an application and several large language models and decides which model handles each request, usually to lower cost or keep requests flowing without giving up quality. Routers range from gateways that pick a provider by price and uptime to rule sets, learned classifiers, cascades and plan-aware routers. AutoRouter, the Mac app for all your coding agents, is a plan-aware router and is unrelated to LiteLLM's Auto Router or OpenRouter's Auto Router.
- [How Ramp, Cursor and Uber build AI coding benchmarks, and how you can](https://autorouter.com/blog/private-benchmarks-ramp-cursor-uber.md): AutoRouter, the Mac app for all your coding agents, builds a free private coding benchmark from your team's merged pull requests, the approach Ramp, Cursor and Uber each took in-house. Ramp grades 500 tasks from merged agent pull requests with a panel of LLM judges, Cursor grades real sessions with agentic graders and refreshes them every few months, and Uber runs thousands of monorepo pull requests through one harness to pick the Pareto-best model. A startup can copy the method with one workflow, a few dozen validated tasks, three runs per model, and pass rate and cost per task.

Tags: [Guides](https://autorouter.com/blog/tags/guides.md), [Teams](https://autorouter.com/blog/tags/teams.md), [AutoRouter](https://autorouter.com/blog/tags/autorouter.md)

Drafted with AI from the sources linked above, then checked and edited by the AutoRouter team.

AutoRouter is a Mac app for AI model routing in Codex, Claude Code, Cursor and other supported coding agents. It uses eligible connected subscriptions first. See [setup](https://autorouter.com/setup.md) and [pricing](https://autorouter.com/pricing).
