Skip to content
STACK IT FAST

AGENTS.md vs CLAUDE.md vs .cursorrules: Which File Each AI Coding Tool Reads (2026)

Published September 25, 2026 From verified production architectures

79%
Key statistic

of the 62 audited open-source repos that ship an AGENTS.md also keep a CLAUDE.md next to it (49 of 62)

AI coding agents no longer agree on a single file name, but they are converging. AGENTS.md is the cross-tool format, CLAUDE.md is still what Claude Code loads first, .cursor/rules/*.mdc is Cursor’s scoped rule system, and .cursorrules is legacy. This guide shows which tool reads which file today, then what 113 source-audited open-source repositories in the STACK IT FAST directory actually ship.

1. Which file each tool reads

ToolReadsNotes
Cursor.cursor/rules/*.mdc, AGENTS.md (root and nested), CLAUDE.md, legacy .cursorrulesRules are merged. Nested AGENTS.md files take precedence for their subtree. CLAUDE.md is always applied.
Claude CodeCLAUDE.md; AGENTS.md only where no CLAUDE.md existsAGENTS.md fallback shipped in v2.1.277 (September 2026). A CLAUDE.md in the folder wins.
OpenAI CodexAGENTS.mdThe format started here and now lives under the Linux Foundation’s Agentic AI Foundation.
GitHub Copilot.github/copilot-instructions.md; AGENTS.md for the coding agentAGENTS.md support for the Copilot coding agent arrived in August 2025.
Other agentsAGENTS.mdGemini CLI, Jules, Windsurf, Zed, Aider, Factory, Amp, Devin and more are listed on agents.md.

Two consequences matter in practice:

  • Claude Code ignores your AGENTS.md if a CLAUDE.md sits next to it. The fallback only applies to folders without a CLAUDE.md. Reports also note the fallback depends on Claude Code’s feature flags, so it may not apply on Bedrock, Vertex or with telemetry disabled.
  • Cursor applies CLAUDE.md to everything. Anything Claude-specific you put there also reaches Cursor sessions, with no way to scope it.

2. What 113 open-source repos actually ship

We checked the root of every repository in the directory at the exact commit its deep dive was audited against.

File at repo rootReposShare
Any agent instruction file7869.0%
AGENTS.md6254.9%
CLAUDE.md6154.0%
.claude/ directory (commands, agents, settings)4438.9%
.cursor/rules/1513.3%
.github/copilot-instructions.md119.7%
.cursorrules (legacy)32.7%
GEMINI.md10.9%

AGENTS.md and CLAUDE.md usually travel together. 49 repos ship both, 13 ship only AGENTS.md (for example Astro, Temporal, Mattermost and Logto), and 12 ship only CLAUDE.md (for example Medusa, Hasura and OpenObserve). The 13 AGENTS.md-only repos are the ones whose instructions Claude Code started reading in September 2026.

In the 49 repos that ship both, maintainers solve the duplication three ways:

How CLAUDE.md relates to AGENTS.mdRepos
Pointer: a symlink or a one-line @AGENTS.md import21
Own content that references AGENTS.md15
Fully separate file13

Projects using the pointer pattern include n8n, Sentry, Grafana, Gitea and Supabase Studio. Cal.com, Twenty and LibreChat keep a separate CLAUDE.md.

Cursor’s own scoped rules are much rarer: 15 repos ship a .cursor/rules/ directory, including PostHog, shadcn/ui, tRPC and Trigger.dev, and only 3 still carry a legacy .cursorrules.

3. The setup we recommend

  1. Write AGENTS.md as the source of truth. Build commands, test commands, code style, directory map and non-negotiables. It is the one file every major agent reads.
  2. Make CLAUDE.md a pointer. Start it with @AGENTS.md, then add only Claude-specific instructions (for example sub-agent or hook conventions). This keeps Claude Code on the same rules even though it prefers CLAUDE.md.
  3. Use .cursor/rules/*.mdc only for scoped rules. Glob-attached rules (for example only for *.sql or apps/api/**) are where Cursor’s format adds something AGENTS.md cannot.
  4. Delete .cursorrules. Move its content into an always-apply .mdc rule or into AGENTS.md.
  5. Nest AGENTS.md in monorepos. A short AGENTS.md per package keeps instructions close to the code; Cursor and Codex apply the nearest file.

4. Migrating from .cursorrules

.cursorrules                      → delete
  project-wide conventions        → AGENTS.md
  rules for specific paths        → .cursor/rules/<name>.mdc  (globs: ["apps/api/**"])
CLAUDE.md (if you have one)       → first line: @AGENTS.md, keep Claude-only notes below

Vendors have started shipping skills too: TypeSafe publishes an official agent skill for its Jev model instead of an MCP server. Every stack rule set on STACK IT FAST already ships in all of these formats: an AGENTS.md, a CLAUDE.md, a Cursor .mdc rule and an installable Agent Skill (SKILL.md), derived from production repositories that use that stack.

5. Methodology

  • Sample: the 113 open-source repositories with a published, source-audited deep dive in the STACK IT FAST directory.
  • Snapshot: the repository root at the commit each deep dive was audited against (September 2026), read through the GitHub contents API. Nested instruction files inside subdirectories were not counted.
  • Pointer detection: a CLAUDE.md of 64 bytes or less that names AGENTS.md (a git symlink or a one-line @AGENTS.md import) counts as a pointer.
  • Tool behaviour: taken from Cursor’s rules documentation (August 2026), the Claude Code v2.1.277 release coverage (September 2026) and the agents.md compatibility list.

Based on 113 verified production architectures in the directory. Explore the directory

One email a month: new deep dives and stack trends

New source-audited architectures, head-to-head comparisons and the monthly stack report. No spam, unsubscribe anytime.

Methodology and questions

Does Cursor use AGENTS.md?

Yes. Cursor reads AGENTS.md from the project root and from subdirectories, with more specific (nested) files taking precedence. It also reads CLAUDE.md and its own .cursor/rules/*.mdc files, and still honours the legacy .cursorrules file.

Does Claude Code read AGENTS.md?

Since Claude Code v2.1.277 (September 2026) it reads AGENTS.md, but only in folders that have no CLAUDE.md. If a CLAUDE.md exists, Claude Code reads that and ignores AGENTS.md, so the common pattern is a CLAUDE.md that imports it with a single @AGENTS.md line.

Does Cursor read CLAUDE.md?

Yes. Cursor picks up CLAUDE.md automatically and applies it to every conversation, with no glob or alwaysApply scoping, so Claude-specific instructions in CLAUDE.md also reach Cursor.

Is .cursorrules deprecated?

Yes. Cursor treats the single .cursorrules file as legacy and recommends moving its content into .cursor/rules/*.mdc files. Only 3 of the 113 open-source repos we audited still ship a .cursorrules file, against 15 with a .cursor/rules directory.

Should I use AGENTS.md or CLAUDE.md?

Use AGENTS.md as the single source of truth because Codex, Cursor, Copilot and most other agents read it, then add a CLAUDE.md that imports it (@AGENTS.md) plus any Claude-specific directives. 21 of the 49 audited repos that ship both files already do this with an import or a symlink.

How many open-source projects use AGENTS.md?

Of 113 source-audited open-source repositories in the STACK IT FAST directory, 62 (54.9%) ship an AGENTS.md at the root, 61 (54.0%) ship a CLAUDE.md, and 78 (69.0%) ship at least one AI agent instruction file.

More benchmarks and trend reports

insights/jev-system-one-model-developers-2026.mdJev for Developers: What 648 Open-Source Repos Built in Two Weeks (2026)Jev, TypeSafe's System One model, returns typed decisions instead of text. What 648 open-source Jev repos use, where it fails, and three app architectures. 648 stacks insights/rust-web-apps-ai-agents-2026.mdBuilding Web Apps in Rust in 2026: DHH, AI Agents and What Open-Source Rust Actually UsesDHH is rewriting HEY in agent-written Rust. What 32 open-source Rust apps actually use (Axum, Tokio, sqlx) and four Rust web stacks with AGENTS.md files. 32 stacks insights/2026-09-stack-trends.mdSeptember 2026 Production Stack Trends: TypeScript Runs 76% of 115 Open-Source ArchitecturesSeptember 2026 stack trends from 115 verified open-source architectures: TypeScript in 76%, PostgreSQL in 57%, Rust in 26%, and 46% AI-assisted delivery. 115 stacks insights/vibe-coding-statistics-2026.mdVibe Coding Statistics 2026: AI Coding Agent Adoption Across 105 Production Open-Source StacksVibe coding statistics 2026: 43.8% of 105 production open-source stacks use AI-assisted or agent-heavy delivery. Data by language, team size, category. 105 stacks insights/top-10-production-tech-stacks.mdTop 10 Production Tech Stacks in 2026: Architecture Breakdown of 105 Open-Source LeadersTop 10 production tech stacks in 2026: In-depth architecture breakdown across 105 verified open-source leaders like Next.js, Supabase, FastAPI, and MinIO. 105 stacks insights/2026-08-stack-trends.mdAugust 2026 Production Stack Trends: PostgreSQL Powers 71% of Open-Source ArchitecturesAugust 2026 stack trends: PostgreSQL powers 71% of open-source architectures. Real data on databases, frameworks, and AI-agent development modes. 48 stacks insights/most-popular-open-source-tech-stacks.mdMost Popular Tech Stacks in Modern Open-Source Software (2026 Breakdown)Most popular tech stacks powering iconic open-source projects like Cal.com, Supabase, Dub, Sentry, and PostHog. Verified 2026 architecture benchmarks. 48 stacks