<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: RulePaste</title>
    <description>The latest articles on DEV Community by RulePaste (@rulepaste).</description>
    <link>https://dev.to/rulepaste</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F99mvlsfu5tfj9m7ku25d.png</url>
      <title>DEV Community: RulePaste</title>
      <link>https://dev.to/rulepaste</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rulepaste"/>
    <language>en</language>
    <item>
      <title>AGENTS.md vs CLAUDE.md vs .mdc: which file does your AI coding tool actually read?</title>
      <dc:creator>RulePaste</dc:creator>
      <pubDate>Fri, 30 Oct 2026 16:48:58 +0000</pubDate>
      <link>https://dev.to/rulepaste/agentsmd-vs-claudemd-vs-mdc-which-file-does-your-ai-coding-tool-actually-read-j5</link>
      <guid>https://dev.to/rulepaste/agentsmd-vs-claudemd-vs-mdc-which-file-does-your-ai-coding-tool-actually-read-j5</guid>
      <description>&lt;p&gt;If you use more than one AI coding tool, you have probably ended up with a small zoo of instruction files: &lt;code&gt;AGENTS.md&lt;/code&gt;, &lt;code&gt;CLAUDE.md&lt;/code&gt;, &lt;code&gt;.cursorrules&lt;/code&gt;, a few files in &lt;code&gt;.cursor/rules/&lt;/code&gt;, maybe &lt;code&gt;.github/copilot-instructions.md&lt;/code&gt;. They all say roughly the same thing, and they slowly drift apart.&lt;/p&gt;

&lt;p&gt;The annoying part is not writing the rules. It is knowing which file each tool actually loads. Write your conventions into the wrong file and the agent ignores them without telling you.&lt;/p&gt;

&lt;p&gt;Here is what the official docs say, checked in October 2026.&lt;/p&gt;

&lt;h2&gt;
  
  
  Which tool reads which file
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;File&lt;/th&gt;
&lt;th&gt;Cursor&lt;/th&gt;
&lt;th&gt;Claude Code&lt;/th&gt;
&lt;th&gt;Codex&lt;/th&gt;
&lt;th&gt;GitHub Copilot (GitHub.com)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;AGENTS.md&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Yes, root and subfolders&lt;/td&gt;
&lt;td&gt;Only if there is no &lt;code&gt;CLAUDE.md&lt;/code&gt; / &lt;code&gt;CLAUDE.local.md&lt;/code&gt; (v2.1.277+)&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Yes, nearest file wins&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;CLAUDE.md&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Yes, same as &lt;code&gt;AGENTS.md&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Only via &lt;code&gt;project_doc_fallback_filenames&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Yes, a single file in the repo root&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;.cursor/rules/*.mdc&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Only as &lt;code&gt;/init&lt;/code&gt; migration input&lt;/td&gt;
&lt;td&gt;Not documented&lt;/td&gt;
&lt;td&gt;Not documented&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;.cursorrules&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Legacy, "will be deprecated"&lt;/td&gt;
&lt;td&gt;Only as &lt;code&gt;/init&lt;/code&gt; migration input&lt;/td&gt;
&lt;td&gt;Only via fallback config&lt;/td&gt;
&lt;td&gt;Not documented&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Sources, per column:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Cursor:&lt;/strong&gt; the &lt;a href="https://cursor.com/docs/context/rules" rel="noopener noreferrer"&gt;Rules docs&lt;/a&gt; cover &lt;code&gt;.mdc&lt;/code&gt; project rules and &lt;code&gt;AGENTS.md&lt;/code&gt; in the root and subdirectories. The &lt;a href="https://cursor.com/help/customization/rules" rel="noopener noreferrer"&gt;Rules help page&lt;/a&gt; says "Cursor reads &lt;code&gt;CLAUDE.md&lt;/code&gt; files the same way it reads &lt;code&gt;AGENTS.md&lt;/code&gt;", that these files are always applied regardless of &lt;code&gt;alwaysApply&lt;/code&gt;, and that &lt;code&gt;.cursorrules&lt;/code&gt; "is legacy and will be deprecated".&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Claude Code:&lt;/strong&gt; the &lt;a href="https://code.claude.com/docs/en/memory" rel="noopener noreferrer"&gt;memory docs&lt;/a&gt; say that by default Claude reads &lt;code&gt;AGENTS.md&lt;/code&gt; only when there is no &lt;code&gt;CLAUDE.md&lt;/code&gt;, &lt;code&gt;.claude/CLAUDE.md&lt;/code&gt; or &lt;code&gt;CLAUDE.local.md&lt;/code&gt; in your working directory or above it. You can change that with the &lt;em&gt;Project instructions&lt;/em&gt; setting (&lt;code&gt;claude-md-and-agents-md&lt;/code&gt;). Older versions read &lt;code&gt;CLAUDE.md&lt;/code&gt; only.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Codex:&lt;/strong&gt; the &lt;a href="https://developers.openai.com/codex/guides/agents-md" rel="noopener noreferrer"&gt;AGENTS.md guide&lt;/a&gt; explains that Codex walks from the project root to your working directory, takes at most one file per directory (&lt;code&gt;AGENTS.override.md&lt;/code&gt;, then &lt;code&gt;AGENTS.md&lt;/code&gt;, then any names you list in &lt;code&gt;project_doc_fallback_filenames&lt;/code&gt;), and stops at 32 KiB by default.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Copilot:&lt;/strong&gt; GitHub's &lt;a href="https://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/add-custom-instructions/add-repository-instructions" rel="noopener noreferrer"&gt;repository instructions docs&lt;/a&gt; accept one or more &lt;code&gt;AGENTS.md&lt;/code&gt; files, or "a single &lt;code&gt;CLAUDE.md&lt;/code&gt; or &lt;code&gt;GEMINI.md&lt;/code&gt; file stored in the root of the repository".&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The independent &lt;a href="https://rulefiles.dev/matrix/" rel="noopener noreferrer"&gt;rulefiles.dev matrix&lt;/a&gt; (last reviewed 2026-10-16) tracks the same cells with a source and check date for each one. It is a handy bookmark.&lt;/p&gt;

&lt;p&gt;A quiet gotcha worth spelling out: &lt;strong&gt;in Claude Code, adding a personal &lt;code&gt;CLAUDE.local.md&lt;/code&gt; to a repo that relies on &lt;code&gt;AGENTS.md&lt;/code&gt; stops Claude from reading &lt;code&gt;AGENTS.md&lt;/code&gt;&lt;/strong&gt;, because the local file counts as a &lt;code&gt;CLAUDE.md&lt;/code&gt; (&lt;a href="https://code.claude.com/docs/en/memory" rel="noopener noreferrer"&gt;docs&lt;/a&gt;).&lt;/p&gt;

&lt;h2&gt;
  
  
  The Cursor pitfall: &lt;code&gt;.md&lt;/code&gt; in &lt;code&gt;.cursor/rules&lt;/code&gt; is ignored
&lt;/h2&gt;

&lt;p&gt;This one catches a lot of people. You drop &lt;code&gt;api-guidelines.md&lt;/code&gt; into &lt;code&gt;.cursor/rules/&lt;/code&gt;, and nothing happens. Cursor's docs are explicit: project rules "must use the &lt;code&gt;.mdc&lt;/code&gt; extension. A plain &lt;code&gt;.md&lt;/code&gt; file in &lt;code&gt;.cursor/rules&lt;/code&gt; is ignored by the rules system because it has no frontmatter to specify &lt;code&gt;description&lt;/code&gt;, &lt;code&gt;globs&lt;/code&gt;, and &lt;code&gt;alwaysApply&lt;/code&gt;" (&lt;a href="https://cursor.com/docs/context/rules" rel="noopener noreferrer"&gt;source&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;A working rule looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="nn"&gt;---&lt;/span&gt;
&lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;React component conventions for the dashboard&lt;/span&gt;
&lt;span class="na"&gt;globs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;src/components/**/*.tsx&lt;/span&gt;
&lt;span class="na"&gt;alwaysApply&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
&lt;span class="nn"&gt;---&lt;/span&gt;

&lt;span class="p"&gt;-&lt;/span&gt; Use named exports, not default exports
&lt;span class="p"&gt;-&lt;/span&gt; Co-locate styles in a CSS module next to the component
&lt;span class="p"&gt;-&lt;/span&gt; Keep components under 200 lines
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The three fields decide when the rule loads (&lt;a href="https://cursor.com/docs/context/rules" rel="noopener noreferrer"&gt;same page&lt;/a&gt;):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;alwaysApply: true&lt;/code&gt;: always included. &lt;code&gt;globs&lt;/code&gt; and &lt;code&gt;description&lt;/code&gt; are ignored.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;alwaysApply: false&lt;/code&gt; with &lt;code&gt;globs&lt;/code&gt;: attached when a matching file is in context.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;alwaysApply: false&lt;/code&gt; with only a &lt;code&gt;description&lt;/code&gt;: the agent pulls it in when it decides the rule is relevant.&lt;/li&gt;
&lt;li&gt;None of them: only used when you &lt;code&gt;@&lt;/code&gt;-mention the rule.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you still have a &lt;code&gt;.cursorrules&lt;/code&gt; file, Cursor's migration advice is to copy its content into a new rule set to &lt;em&gt;Always Apply&lt;/em&gt;, then delete the old file (&lt;a href="https://cursor.com/help/customization/rules" rel="noopener noreferrer"&gt;help page&lt;/a&gt;).&lt;/p&gt;

&lt;h2&gt;
  
  
  Keeping the files in sync from one source
&lt;/h2&gt;

&lt;p&gt;The setup that drifts least is one canonical file plus thin adapters:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Make &lt;code&gt;AGENTS.md&lt;/code&gt; the source of truth.&lt;/strong&gt; Cursor, Codex and Copilot read it directly.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Give Claude Code a one-line &lt;code&gt;CLAUDE.md&lt;/code&gt; that imports it.&lt;/strong&gt; Anthropic documents exactly this pattern (&lt;a href="https://code.claude.com/docs/en/memory" rel="noopener noreferrer"&gt;docs&lt;/a&gt;):
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;   @AGENTS.md

   ## Claude Code
   Use plan mode for changes under &lt;span class="sb"&gt;`src/billing/`&lt;/span&gt;.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A symlink (&lt;code&gt;ln -s AGENTS.md CLAUDE.md&lt;/code&gt;) also works. The docs warn that Windows clones may check a committed symlink out as a plain text file, so the import is the safer choice for mixed teams.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Use &lt;code&gt;.mdc&lt;/code&gt; only for scoped rules.&lt;/strong&gt; Put things that only matter for &lt;code&gt;src/api/**&lt;/code&gt; or test files into &lt;code&gt;.cursor/rules/*.mdc&lt;/code&gt; with &lt;code&gt;globs&lt;/code&gt;, and keep &lt;code&gt;AGENTS.md&lt;/code&gt; for project-wide facts.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Delete &lt;code&gt;.cursorrules&lt;/code&gt;&lt;/strong&gt; once its content is migrated, so there is one fewer file to drift.&lt;/li&gt;
&lt;/ol&gt;




&lt;p&gt;If you'd rather not wire this up by hand, we built a small free tool, RulePaste, that converts between these formats and keeps &lt;code&gt;AGENTS.md&lt;/code&gt; and &lt;code&gt;CLAUDE.md&lt;/code&gt; aligned: &lt;a href="https://rulepaste.com/agents-md-vs-claude-md" rel="noopener noreferrer"&gt;RulePaste's AGENTS.md vs CLAUDE.md sync page&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>cursor</category>
      <category>productivity</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
