Blog
We checked 3,905 CLAUDE.md and AGENTS.md files on GitHub
Published · Updated
On October 18, 2026 we at Harbor (gethrbr.com) pulled 3,905 CLAUDE.md and AGENTS.md files from public GitHub repositories and ran the same checks on each one. Four results stand out.
- In about 1 in 6 repos that keep both files at the root (16 percent), the CLAUDE.md never mentions the AGENTS.md, so Claude Code never loads it. In another 15 percent, a sentence asks Claude to read it, which works only if Claude decides to open the file.
- In 7 percent, the two files started as copies and have drifted apart, so Claude and Codex follow different rules in the same repo.
- About 1 in 5 CLAUDE.md files (19 percent) is longer than the 200 lines Anthropic suggests. The median is 81 lines.
- About 30,000 AGENTS.md files on GitHub (2.6 percent) are larger than the 32 KiB Codex reads by default, so the end of each one never reaches the model.
How we sampled
GitHub code search counts 839,680 CLAUDE.md files and 1,142,784 AGENTS.md files in public repositories, forks excluded. A search returns at most 1,000 results, in GitHub's own relevance order, so we split each file name into ten size bins, from under 500 bytes up to 384 KB, the largest file GitHub indexes.
From each bin we took the first 100 results and 100 more from a random narrow size window inside it. We fetched every file at the commit GitHub had indexed and weighted each bin by GitHub's count for it. The percentages here are those weighted estimates. GitHub's counts are themselves estimates, so read every figure to the nearest point or two.
Pairs were read from the AGENTS.md side. For each AGENTS.md at a repository root, we fetched the CLAUDE.md beside it at the same commit, when there was one: 745 repos. Search almost never returned a symlinked file, yet nearly a quarter of the CLAUDE.md files beside an AGENTS.md were symlinks, so starting from CLAUDE.md would have missed them.
Does Claude Code read AGENTS.md when the repo also has a CLAUDE.md?
Not by default. Anthropic's memory docs say that with a CLAUDE.md, .claude/CLAUDE.md or CLAUDE.local.md in the folder you start in or above it, Claude reads your CLAUDE.md files only. That case is common: 36 percent of the AGENTS.md files at a repository root have a CLAUDE.md beside them. This is what those CLAUDE.md files do with it.
| The CLAUDE.md beside it | Repos | Does AGENTS.md reach Claude? |
|---|---|---|
| Imports it with @AGENTS.md | 25% | Yes |
| Is a symlink to AGENTS.md | 23% | Yes |
| Copies its lines | 7% | Yes, as a second copy |
| Copied it once, then drifted | 7% | Partly |
| Asks Claude in a sentence to read it | 15% | Only if Claude opens it |
| Never mentions it | 16% | No |
| Holds it all; the AGENTS.md is a stub under five lines | 5% | Nothing to miss |
| Imports other files, so we could not tell | 2% | Unknown |
Some of the 16 percent is deliberate: a few of those AGENTS.md files say they are written for Codex, Cursor and the rest, with Claude covered by its own file. Deliberate or not, Claude and Codex then work from different rules in the same repo, and a rule added to one file reaches only some of the agents.
The sentence case is the one people expect to work. A line such as “Read AGENTS.md before starting any task” is text, not an import. The docs say that in this setup Claude sees AGENTS.md only if it decides to open the file.
A copy that drifted fails more slowly. Both files began as one, someone edited one of them, and nothing in either file says which is current. We counted a pair as drifted when the CLAUDE.md held some of the AGENTS.md's lines but was missing at least five, and not more than 90 percent of them.
The fix is one line: @AGENTS.md on its own line at the top of CLAUDE.md, with anything Claude-specific below it. A symlink also works, but Anthropic notes that a Windows clone without core.symlinks checks it out as a one-line text file. The modes and traps are in does Claude Code read AGENTS.md.
How long is a typical CLAUDE.md?
The median CLAUDE.md is 81 lines, and 1 in 10 is longer than 309. 19 percent are past the 200 lines Anthropic's docs set as the target, and 4 percent are past 500. Anthropic's reason is adherence: a longer file uses more context and is followed less.
AGENTS.md files run shorter, with a median of 63 lines, though 18 percent are past 200. What to cut first is in how long should CLAUDE.md be.
How many AGENTS.md files are too big for Codex?
This one needs no sample. GitHub's count is 30,080 AGENTS.md files over 32 KiB, 2.6 percent of all of them, and 51,840 over 24 KiB, where one more nested file pushes a repo past the limit.
Codex joins AGENTS.md files from the root down and stops adding them at 32 KiB by default (project_doc_max_bytes). The rest never reaches the model, and in our tests the terminal said nothing. Cut the file, or raise the limit in ~/.codex/config.toml. The details are in why Codex ignores AGENTS.md.
What else is in them?
- A directory tree: 17 percent of CLAUDE.md files and 11 percent of AGENTS.md files. The agent can list the folder itself, the tree goes stale with the first move, and the largest study so far found repository overviews did not help agents find the relevant files.
- HTML comments: 6 percent of CLAUDE.md files. Claude Code strips block-level comments before the file reaches Claude, which suits notes for maintainers and silently drops an instruction written inside one.
- A sentence pointing at AGENTS.md instead of an import: 6 percent of all CLAUDE.md files, whether or not an AGENTS.md sits beside them.
The study on overviews is covered in is AGENTS.md useful.
How this compares with other studies of context files
Four research papers study the same files. They ask what is in them, how they change, or whether they help. This study asks a narrower question: does the file reach the agent at all. From their abstracts, none of the four checks whether a CLAUDE.md beside an AGENTS.md loads it, or how many files pass Codex's size limit.
| Study | Sample | What it measured |
|---|---|---|
| Chatlatanagulchai et al., arXiv:2509.14744 (Sep 2025) | 253 CLAUDE.md files, 242 repos | Structure and content: shallow headings, mostly commands, implementation notes and architecture |
| Mohsenimofidi et al., arXiv:2510.21413 (MSR 2026) | 466 projects with AGENTS.md | What developers write and how it evolves; no settled content structure yet |
| Chatlatanagulchai et al., arXiv:2511.12884 (v2, Aug 2026) | 2,303 context files, 1,925 repos | Content across 16 instruction types: tests 75.9%, security 14.8%, performance 14.5% |
| Lulla et al., arXiv:2601.20404 (v2, Mar 2026) | 10 repos, 124 pull requests | Agents with and without AGENTS.md: median runtime 28.64% lower, output tokens 16.58% lower |
| This study (Harbor, Oct 2026) | 3,905 files, 745 root pairs | Whether each file reaches the agent: CLAUDE.md and AGENTS.md pairs, length, the 32 KiB Codex limit |
The samples differ in size, source and date, so the percentages are not comparable across rows. Whether a context file helps an agent at all is a separate question, covered in is AGENTS.md useful.
Limitations
- Public repositories only, forks excluded. Private company repos, where team rules matter most, may look different.
- GitHub's search returns results in its own relevance order and its counts are estimates, so each figure is a weighted estimate, good to a point or two.
- One snapshot: files as GitHub had indexed them on October 18, 2026. A file fixed the next day still counts.
- The pair labels are rules a script applies. "Drifted" means the CLAUDE.md holds some of the AGENTS.md lines but misses at least five; a reworded line counts as missing.
- It measures whether instructions reach the agent, not whether the agent follows them or writes better code.
The data, and how to cite it
Every figure on this page is in one CSV, with the sample or count behind it: claude-md-agents-md-study-2026-10-18.csv. It holds the aggregates only, with no repository names. The method is the one under how we sampled, and a re-run moves the weighted figures by a point or two because each bin draws a new random window.
To cite it: Harbor, “We checked 3,905 CLAUDE.md and AGENTS.md files on GitHub”, October 18, 2026, https://gethrbr.com/blog/claude-md-agents-md-github-study.
Check your own file
The main checks in this study take a minute by hand, from the repository root:
head -1 CLAUDE.mdandls -l CLAUDE.md. If the first line is not@AGENTS.mdand the file is not a symlink to it, Claude Code does not load yourAGENTS.mdby default.diff AGENTS.md CLAUDE.md, if one began as a copy of the other. Every line that differs is a rule one agent gets and the other does not.wc -l CLAUDE.md. Past 200 lines is past Anthropic's target.wc -con everyAGENTS.mdfrom the root down to where you start Codex. Past 32,768 bytes together, Codex cuts the rest.
Questions
Are there research studies of AGENTS.md and CLAUDE.md files?
Yes, four on arXiv as of November 2026: 253 CLAUDE.md files (2509.14744), 466 projects with AGENTS.md (2510.21413), 2,303 context files (2511.12884), and a test of agents with and without AGENTS.md on 124 pull requests (2601.20404). They study content and effect; this one checks whether the file reaches the agent.
Does Claude Code read AGENTS.md if the repo also has a CLAUDE.md?
Not by default. With a CLAUDE.md, .claude/CLAUDE.md or CLAUDE.local.md in the folder you start in or above it, Claude Code reads the CLAUDE.md files only. Put @AGENTS.md on its own line in CLAUDE.md, or make CLAUDE.md a symlink to AGENTS.md.
How many CLAUDE.md and AGENTS.md files are on GitHub?
On October 18, 2026, GitHub code search counted 1,142,784 AGENTS.md files and 839,680 CLAUDE.md files in public repositories, forks excluded. GitHub's counts are estimates, and its index skips files over 384 KB.
How long is a typical CLAUDE.md file?
In our weighted sample of public repos, the median CLAUDE.md is 81 lines and 1 in 10 is longer than 309. About 19 percent are past the 200 lines Anthropic suggests as a target.
How many AGENTS.md files are too big for Codex?
GitHub's index counts about 30,000 AGENTS.md files over 32 KiB, 2.6 percent of the 1.14 million it holds. Codex stops adding project instructions at 32 KiB by default, so the end of those files never reaches the model.
How was the sample drawn?
From GitHub code search on October 18, 2026, split into ten size bins per file name. From each bin we took up to 200 files, ran the same checks on each one, and weighted each bin by GitHub's count for it.