# We checked 3,905 CLAUDE.md and AGENTS.md files on GitHub

> Source: <https://gethrbr.com/blog/claude-md-agents-md-github-study>
> Published: 2026-10-18 00:00:00+00:00

Blog

# We checked 3,905 CLAUDE.md and AGENTS.md files on GitHub

Published: October 18, 2026

On October 18, 2026 we pulled 3,905 `CLAUDE.md` and `AGENTS.md` files from public GitHub repositories and ran each one through the same checks as our free [rule-file checker](https://gethrbr.com/check). 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](https://code.claude.com/docs/en/memory) 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](https://gethrbr.com/blog/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](https://gethrbr.com/blog/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](https://gethrbr.com/blog/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](https://gethrbr.com/blog/is-agents-md-useful).

## Check your own file

The [rule-file checker](https://gethrbr.com/check) runs every check in this study on a file you paste, and says which agents load it. It runs in your browser, and nothing you paste leaves the page.

## Questions

### 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 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 as the free rule-file checker, and weighted each bin by GitHub's count for it.
