We audited CLAUDE.md and AGENTS.md across 76 top GitHub repos
93% ship AGENTS.md, 9 of 10 hand-maintained dual files have drifted apart, a 5-line CLAUDE.md expands to 18,600 tokens via @imports, and only 2 repos use .claude/rules/. Full commit-pinned dataset and free checker.
By Christian Buckner
After our own CLAUDE.md hit 107,000 characters, we wanted to see how the best open-source teams actually write and maintain agent instructions in production. Not blog advice or starter templates — real repositories with real contributors.
On December 5, 2026, we scanned the 218 highest-starred active, non-fork repositories on GitHub. 85 of 218 (39.0%) already commit a root CLAUDE.md or AGENTS.md, including torvalds/linux, microsoft/vscode, react/react, nodejs/node, kubernetes/kubernetes, vercel/next.js, electron/electron, ollama/ollama, huggingface/transformers, and ggml-org/llama.cpp.
Nine of those 85 were standalone AI skill packs, prompt personas, curated link lists, or beginner courses rather than shipped software projects, so we set them aside (listed under Methodology below) and audited the remaining 76 production software repositories (9.8k to 490k stars) at their exact HEAD commits. Every link in this post points to the pinned commit SHA we measured.
Five patterns jumped straight out of the data.
Dataset snapshot · 2026-12-05
76 audited production GitHub repositories (9.9k–490k stars)
1. Which root file teams ship
93.4% include AGENTS.md- 42 (55.3%) — AGENTS.md only
- 18 (23.7%) — Both, unified via symlink or @AGENTS.md
- 11 (14.5%) — Both, separate files (9 of 10 hand-maintained drifted)
- 5 (6.6%) — CLAUDE.md only
2. Effective turn-1 line count (after expanding @imports)
Median: 120L (~2,201 tok) · 27.6% over 200L3. How repos split context beyond the root file
Works across Claude Code, Codex, Cursor, OpenCode
Up to 52 skills in openclaw, 44 in eliza, 31 in n8n
Only affaan-m/ECC (2) & PowerToys (symlink to .github/instructions)
1. AGENTS.md has decisively won the root filename
71 of 76 repositories (93.4%) ship AGENTS.md. Only 5 of 76 (6.6%) ship CLAUDE.md alone: react/react, anthropics/claude-code, electron/electron, apollographql/apollo-client, and simplex-chat/simplex-chat.
The breakdown across the 76 repos:
- 42 repos (55.3%) commit
AGENTS.mdonly. - 18 repos (23.7%) commit both, with one cleanly bridging to the other via a git symlink or a 1-line
@AGENTS.mdpointer (e.g.n8n-io/n8n,ollama/ollama,huggingface/transformers,ggml-org/llama.cpp, anddeepseek-ai/deepseek-harness). - 11 repos (14.5%) keep both as separate files (10 hand-maintained plus
microsoft/PowerToys, which symlinks its entire.claude/directory —CLAUDE.md,agents,commands,rules, andskills— directly into.github/Copilot files). - 5 repos (6.6%) commit
CLAUDE.mdonly.
Two nice details from the symlinks: torvalds/linux symlinks AGENTS.md straight to README (168 lines), and huggingface/trl symlinks both CLAUDE.md and AGENTS.md to a single .ai/AGENTS.md file (128 lines).
2. Hand-maintaining both files fails 9 times out of 10
Ten software repos in the cohort maintain both a root CLAUDE.md and a root AGENTS.md without a symlink, @AGENTS.md pointer, or Copilot mirror. 9 of the 10 (90.0%) have already drifted apart — and in 8 of those 9, line-level Jaccard overlap has dropped below 5%.
| Repository | CLAUDE.md | AGENTS.md | Line overlap | What happened |
|---|---|---|---|---|
garrytan/gstack | 626 lines | 276 lines | 0% | Completely separate documents |
GetBindu/Bindu | 433 lines | 87 lines | 0% | CLAUDE.md still lists 4 refactored-away bindu/ paths |
affaan-m/ECC | 88 lines | 223 lines | 0% | Separate instructions per tool |
pycaret/pycaret | 138 lines | 186 lines | 0% | CLAUDE.md @AGENTS.md-imports a separate 186-line file |
ahmedkhaleel2004/gitdiagram | 120 lines | 9 lines | 4% | Full guide in CLAUDE.md; Next.js block only in AGENTS.md |
NVIDIA/auto-ontology | 68 lines | 93 lines | 3% | Different structure and commands |
ultraworkers/claw-code | 21 lines | 92 lines | 0% | Thin Claude guide vs. fuller AGENTS.md |
excalidraw/excalidraw | 35 lines | 20 lines | 0% | Monorepo map in CLAUDE.md; DOM rules only in AGENTS.md |
firecrawl/firecrawl | 21 lines | 19 lines | 95% | Started identical; already 2 lines apart |
elysiajs/elysia | 75 lines | 75 lines | 100% | The only hand-maintained pair still identical |
excalidraw/excalidraw is the clearest example of why this matters in practice: CLAUDE.md explains the monorepo structure, while AGENTS.md holds the DOM rules (app.ownerDocument / app.ownerWindow instead of globals). Because Claude Code ignores AGENTS.md whenever a root CLAUDE.md exists without @AGENTS.md, a Claude Code contributor never sees the DOM rules, and a Codex contributor never sees the monorepo layout.
The fix is boring and works 100% of the time: keep one canonical AGENTS.md and either symlink CLAUDE.md -> AGENTS.md, make CLAUDE.md a single @AGENTS.md line, or generate one from the other and fail CI if they differ (which is what we do in our own repo).
3. Median size is healthy — until @import silently explodes turn-1 tokens
The raw numbers look better than most developers expect. Across the 76 repos, the median root file is 120 lines (~2,201 tokens), with an interquartile range of 61 to 206 lines (~903 to ~3,841 tokens). Even huge codebases often stay lean: react/react is 13 lines, kubernetes/kubernetes is 39 lines, nodejs/node is 60 lines, and mountain-loop/yaak is just 2 razor-sharp lines about release tags.
The trap is thinking the line count of CLAUDE.md is what loads on turn 1. Claude Code expands @path/to/file.md imports eagerly at session start, and that quietly pushes 27.6% of audited repos (21 of 76) over Anthropic's 200-line recommendation:
simplex-chat/simplex-chatlooks like a tiny 5-line (~32-token)CLAUDE.md. Those 5 lines are@docs/CONTRIBUTING.md,@docs/contributing/PROJECT.md,@docs/contributing/CODE.md,@docs/contributing/TESTS.md, and@scripts/ci/README.md— which expand on turn 1 to 981 lines (~18,615 tokens), 582× larger than the root file and the heaviest turn-1 payload in the entire study.apollographql/apollo-clientlooks comfortably under the 200-line ceiling at 139 lines (~1,122 tokens). Its last two lines import@.claude/documentation.md(71 lines) and@.claude/hooks.md(259 lines), expanding turn-1 context 4.1× to 469 lines (~4,606 tokens).langflow-ai/langflowimports both@AGENTS.mdand@.claude/CLAUDE.md— and.claude/CLAUDE.mddoes not exist in the repository.
If you split a long CLAUDE.md with @import, you haven't reduced turn-1 context by a single token.
4. Nested AGENTS.md and skills won progressive disclosure; .claude/rules/ barely exists
When a codebase outgrows one root file, there are three ways to load instructions only when relevant:
- Nested per-directory
AGENTS.md/CLAUDE.mdfiles — used by 34 of 76 repos (44.7%), led byn8n-io/n8n(45 nested files),webdriverio/webdriverio(41),deepseek-ai/deepseek-harness(34),openclaw/openclaw(30), andSignificant-Gravitas/AutoGPT(21). - On-demand skills (
.claude/skills/or.agents/skills/) — used by 28 of 76 repos (36.8%), led byopenclaw/openclaw(52 skills),affaan-m/ECC(49),elizaOS/eliza(44),n8n-io/n8n(31),gitkraken/vscode-gitlens(29), andvercel/next.js(24). - Path-scoped
.claude/rules/files — used by only 2 of 76 repos (2.6%):affaan-m/ECC(2 files) andmicrosoft/PowerToys(via symlink to.github/instructions).
Even though .claude/rules/ supports glob-scoped loading and we use 13 of them in our own repo, open-source maintainers overwhelmingly skipped it. The reason is obvious once you see finding #1: nested AGENTS.md files work across Claude Code, Codex, Cursor, and OpenCode, whereas .claude/rules/ is single-vendor.
5. What open-source maintainers get right — and one brand-new trend
Public repos are much cleaner than private team repos on hygiene:
- 89.5% (68/76) include concrete, runnable build or test commands (
pnpm,cargo,pytest,go test,make, etc.). - 0% (0/76) leaked a personal
/Users/or/home/path. (In private team repos, personal paths slip in constantly.) - 19.7% (15/76) still include unverifiable prose ("format properly", "best practices", "clean code"), 10.5% (8/76) inline a 6+ step procedure that would fit better as a skill, 9.2% (7/76) rely on ALL-CAPS
NEVER/MUST NOTprose rules, and 5.3% (4/76) carry dated migration or changelog history in turn-1 instructions.
One genuinely new ecosystem pattern showed up in three repos (vercel/next.js, morluto/rea, and ahmedkhaleel2004/gitdiagram): framework CLIs have started programmatically writing managed blocks into AGENTS.md and CLAUDE.md. Both turbo and next dev now auto-append agent-guidance sections when they detect a coding agent — which means AGENTS.md is no longer strictly human-edited prose.
A methodology note on "broken file paths" (and why we threw out 93% of our own alerts)
When we ran an automated path checker across all backticked file paths against each repository's full git tree, it flagged 28 repositories as referencing missing files. That would have made a dramatic headline — and it would have been almost entirely wrong.
We read every flagged line in context. 26 of the 28 were false positives:
- Monorepo-relative shorthands:
vercel/next.jscitessrc/cli/next-dev.ts(which lives atpackages/next/src/cli/next-dev.ts);cloudflare/computer,modem-dev/hunk,funstory-ai/BabelDOC, andwebdriverioall do the same. - Gitignored build outputs & local overrides:
packages/next/dist,apps/web/.env.local,tmp/restart.txt,flutter/lib/generated_bridge.dart,.claude/settings.local.json. - Git submodules & sister repos:
libs/hbb_common/inrustdesk(a submodule) anddocs/profile_execution.mdincompiler-explorer(explicitly described as "in the infra repo"). - Negative warnings:
NVIDIA/auto-ontologyliterally warns agents: "there is noauto_ontology/server/main.py."
After manual verification, only 2 of 76 repositories (2.6%) had genuinely stale source paths: langflow-ai/langflow (referencing src/backend/base/langflow/components/ after moving components and importing a missing @.claude/CLAUDE.md) and GetBindu/Bindu (whose drifted CLAUDE.md still points to 4 refactored-away bindu/ modules). Takeaway: if you see a benchmark claiming a third of AGENTS.md files are full of dead paths, check whether it filtered out build folders and monorepo subpaths.
Explore the full 76-repo dataset
Filter by architecture, size, dual-file drift, nested files, or skills. Every repository links straight to the commit audited on December 5, 2026.
Complete audited dataset
Every row links to the exact GitHub commit audited on 2026-12-05.
| Repository | Setup | Lines | Turn-1 tok | Nested | Skills |
|---|---|---|---|---|---|
19.8k★ · Haskell · c0a67e8c14 5-line CLAUDE.md @imports 5 docs totaling 981 lines (~18,615 tokens) on turn 1 | CLAUDE.md only | 5→981 | ~18.6k | 2 | — |
20.0k★ · Java · d697f55270 | AGENTS.md | 554 | ~9.6k | — | 44 |
143k★ · TypeScript · c48dce6908 | Dual · drifted C:626L vs A:276L (0% overlap) | 626 | ~8.8k | 1 | — |
144k★ · JavaScript · ca9ff35a68 Contains CLI auto-injected guidance block (turbo / next dev) | AGENTS.md | 532 | ~7.6k | 12 | 24 |
19.2k★ · C++ · 54ad04bd66 | AGENTS.md | 382 | ~6.9k | — | — |
150k★ · Python · 5df1b045e7 | AGENTS.md | 404 | ~6.4k | — | — |
213k★ · TypeScript · 51b3b102b0 | AGENTS + bridge | 477 | ~6.3k | 45 | 31 |
150k★ · Python · 92755211c7 | AGENTS.md | 398 | ~5.5k | — | — |
291k★ · TypeScript · da0d984253 | AGENTS + bridge | 193 | ~4.9k | 34 | 22 |
396k★ · TypeScript · 74738eef78 | AGENTS.md | 129 | ~4.9k | 30 | 52 |
10.0k★ · TypeScript · 89f8cb791e | AGENTS + bridge | 262 | ~4.9k | — | 2 |
231k★ · TypeScript · 245a2bbc66 | AGENTS.md | 230 | ~4.9k | 20 | — |
19.8k★ · TypeScript · 1771406080 Imports @.claude/documentation.md and @.claude/hooks.md (4.1x turn-1 expansion) | CLAUDE.md only | 139→469 | ~4.6k | — | — |
133k★ · Rust · 3996bcf11e | AGENTS.md | 238 | ~4.5k | — | — |
10.0k★ · TypeScript · 7280331d1b | AGENTS + bridge | 153 | ~4.5k | — | 29 |
Methodology & exclusions: We queried GitHub's repository search API for active, non-fork public repositories ordered by stars (archived:false fork:false), scanned the first 218 repositories (567k down to 9.8k stars), and found 85 with a root CLAUDE.md or AGENTS.md. To measure real engineering codebases rather than prompt collections, we excluded 9 non-software repos: mattpocock/skills, obra/superpowers, multica-ai/andrej-karpathy-skills, DietrichGebert/ponytail, nextlevelbuilder/ui-ux-pro-max-skill, ripienaar/free-for-dev, microsoft/generative-ai-for-beginners, greensock/gsap-skills, and tradermonty/claude-trading-skills. Git symlinks (torvalds/linux -> README, huggingface/trl -> .ai/AGENTS.md, microsoft/PowerToys/.claude/CLAUDE.md -> ../.github/copilot-instructions.md) were resolved to their targets before counting lines and tokens (~chars / 4).
Check your own CLAUDE.md or AGENTS.md
Paste your file below — or open the standalone checker at /tools/claude-md-checker — to measure turn-1 token cost, catch secrets, vague rules, and dated history, and see exactly where your file lands against these 76 repositories. Everything runs locally in your browser; nothing is sent anywhere.
CLAUDE.md & AGENTS.md checker
100% local · nothing leaves your browserCatching whole-repo drift in CI (rulevet)
A browser checker can only inspect the single file you paste in. It can't follow @import files on disk, diff CLAUDE.md against AGENTS.md, check Codex's 32 KiB truncation cap, or verify that cited paths, scripts, and CLI flags still exist after a refactor.
To enforce those checks automatically on every PR — not just PRs that touch CLAUDE.md, because instructions mostly rot when source files move — we open-sourced rulevet (MIT, zero runtime dependencies, 27 rules across six families): code-grounded path, script, CLI flag, package-manager, and symbol checks (with .gitmodules, .gitignore, Git rename archaeology, and negative-assertion guards built directly from the false positives above), CLAUDE.md ↔ AGENTS.md mirror sync (sync --check), recursive @import and Codex 32 KiB budget checks (budget), multi-tool context simulation (explain <file> across Claude Code, Codex, Cursor, Copilot, and Gemini CLI), .mcp.json / .claude/settings.json hook and secret checks, safe --fix, and hidden prompt-injection Unicode scanning.
Run it locally with no install step:
Or add the composite GitHub Action to CI (runs on every PR with zero install step):
What belongs in git — and what doesn't
The best repositories in this dataset treat AGENTS.md like a short, verifiable contract: build commands, layout, invariants, and nested package files for deep subsystems, with one symlink or @AGENTS.md line keeping every agent on the same source of truth.
Where files get bloated is everything that changes week to week — why a migration happened, what broke in staging last month, which decision superseded the old architecture. Putting that history in AGENTS.md forces every agent on every unrelated task to pay for it on turn 1. In our own repo, we keep static rules and test gates in git and let Claude Code, Codex, and Cursor query area-level decisions and history on demand from Jackdaw over MCP. If you'd rather not add a tool, a single lean AGENTS.md, a symlinked CLAUDE.md, and nested per-package files will already put you ahead of most repositories on GitHub.