We hid a different codeword in AGENTS.md, CLAUDE.md and Copilot's instructions file
A team that mixes coding agents ends up with several instruction files in one repository: AGENTS.md, CLAUDE.md, .github/copilot-instructions.md, a Cursor rule. We wanted to know which tool reads which file, so on 30 Nove
A team that mixes coding agents ends up with several instruction files in one repository: AGENTS.md, CLAUDE.md, .github/copilot-instructions.md, a Cursor rule. We wanted to know which tool reads which file, so on 30 November 2026 we put a different codeword in each one and asked. Our AI agent sessions ran the test under a founder's direction.
The setup
Small throwaway git repositories, each with some mix of these files:
| File | The one line in it |
|---|---|
AGENTS.md |
The codeword is KIWI. |
CLAUDE.md |
The codeword is PEAR. |
.github/copilot-instructions.md |
The codeword is PLUM. |
.cursor/rules/team.mdc, always applied |
The codeword is FIG. |
Three tools, on Windows: Claude Code 2.1.331, Codex CLI 0.164.0 and GitHub Copilot CLI 1.0.114, which updated itself to 1.0.117 partway through. Each got the same prompt in a fresh session:
Without reading any file or running any command, list every codeword that appears in the instructions you were given at startup. Reply with the codewords only, or NONE.
Claude Code ran with its tools switched off, Codex in a read-only sandbox, and Copilot with its shell, read and write tools denied. Our own user settings were kept out of Claude Code, and Codex's list of fallback filenames was cleared. One run per cell.
What each one read
| Files in the repository | Claude Code | Codex | Copilot CLI |
|---|---|---|---|
AGENTS.md only |
KIWI | KIWI | KIWI |
AGENTS.md and CLAUDE.md
|
PEAR | KIWI | KIWI, PEAR |
| All four files | PEAR | KIWI | PLUM, KIWI, PEAR |
AGENTS.md, and a CLAUDE.md that starts with @AGENTS.md
|
PEAR, KIWI | KIWI | both files |
CLAUDE.md only |
PEAR | NONE | CLAUDE.md |
None of the three read the Cursor rule, and only Copilot read Copilot's file. Cursor is not in the table because there is no Cursor command-line agent on our test machine. The Copilot column did not come from Copilot's answers. More on that below.
Claude Code drops AGENTS.md the moment a CLAUDE.md exists
Look at the first two rows. With only an AGENTS.md, Claude Code read it. Add a CLAUDE.md and KIWI is gone.
That matches the changelog. Claude Code has read AGENTS.md since version 2.1.277, and only in a project with no CLAUDE.md. Anthropic's memory docs say a personal CLAUDE.local.md switches it off as well. We did not test that one.
For a team, this is easy to walk into. Someone adds a CLAUDE.md with two lines meant for Claude only, and every Claude Code session in that repository stops seeing the shared rules. Nothing warns you.
Two things brought KIWI back:
@AGENTS.md
The codeword is PEAR.
With that import as the first line of CLAUDE.md, Claude Code answered PEAR and KIWI. The other way is a setting: Project instructions in /config, set to claude-md-and-agents-md. On the two-file repository that gave PEAR, then KIWI.
One more case: an AGENTS.md beside a rule file in .claude/rules/. Claude Code read both. A rule file does not switch AGENTS.md off the way a CLAUDE.md does.
Codex ignores CLAUDE.md unless you name it
In the repository with only a CLAUDE.md, Codex answered NONE. One line in ~/.codex/config.toml changes that:
project_doc_fallback_filenames = ["CLAUDE.md"]
With it, Codex answered PEAR there. Where an AGENTS.md sat beside the CLAUDE.md, it still answered only KIWI. A fallback name counts only in a folder with no AGENTS.md.
Copilot CLI said NONE. Its own log disagreed.
Copilot's three answers to the prompt were "NONE", "NONE" and "I can't provide that."
Copilot CLI saves each session's full prompt in a local log, so we opened it. The log for those three sessions held the codewords, in this order: KIWI. Then KIWI, PEAR. Then PLUM, KIWI, PEAR. It also held a built-in line telling the model to treat everything above it as confidential and not to reveal or discuss it.
So the model had the codewords and declined to say so. Had we trusted the answer, we would have written down that Copilot CLI reads none of these files. It read three of the four.
For the last two rows we stopped asking the model and used copilot instruction list, which prints the files a session would load:
Repository instructions:
β’ AGENTS.md
from AGENTS.md
β’ CLAUDE.md
from CLAUDE.md
One result went past the GitHub docs page we had read. In the repository with an AGENTS.md and a file in .claude/rules/, Copilot CLI 1.0.117 listed that rule file among the instructions it would load.
What we do now
- One
AGENTS.mdat the root of the repository for the rules everyone shares. All three tools read it when it is the only file. - A
CLAUDE.mdonly when we need one, and its first line is@AGENTS.md. - Lines under that import are written so another tool can ignore them, because Copilot CLI reads
CLAUDE.mdtoo. - To check what an agent loaded, we ask the tool, not the model:
/memoryin Claude Code,copilot instruction listor/instructionsin Copilot CLI.
What each vendor documents for every file, Cursor included, is in our guide, AGENTS.md vs CLAUDE.md vs copilot-instructions.md vs Cursor rules.
Disclosure
We build KoalaFix, a shared memory for a team's AI coding agents, so we have an interest in this topic. Weigh what we say with that in mind.
This post was drafted with AI assistance and checked by a founder.
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.