<?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: wilzap</title>
    <description>The latest articles on DEV Community by wilzap (@imwilzap).</description>
    <link>https://dev.to/imwilzap</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4217520%2Fbda8c80a-9e05-4e39-aec6-2eb759ac05c2.png</url>
      <title>DEV Community: wilzap</title>
      <link>https://dev.to/imwilzap</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/imwilzap"/>
    <language>en</language>
    <item>
      <title>Which instruction file does your coding agent actually read? AGENTS.md, CLAUDE.md, Cursor and Copilot</title>
      <dc:creator>wilzap</dc:creator>
      <pubDate>Fri, 30 Oct 2026 14:48:32 +0000</pubDate>
      <link>https://dev.to/imwilzap/which-instruction-file-does-your-coding-agent-actually-read-agentsmd-claudemd-cursor-and-18nn</link>
      <guid>https://dev.to/imwilzap/which-instruction-file-does-your-coding-agent-actually-read-agentsmd-claudemd-cursor-and-18nn</guid>
      <description>&lt;p&gt;&lt;em&gt;Disclosure: this article was drafted with an AI assistant and edited and fact-checked by me against each tool's documentation on Oct 30, 2026. I made the free files linked below and I also sell a larger set; that is mentioned once, at the end. These tools change often, so re-check the linked pages before you rely on a detail.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The problem
&lt;/h2&gt;

&lt;p&gt;You add an &lt;code&gt;AGENTS.md&lt;/code&gt;. A teammate adds a &lt;code&gt;CLAUDE.md&lt;/code&gt;. Someone else adds &lt;code&gt;.cursor/rules&lt;/code&gt;. A month later nobody knows which file the agent actually used, and two of them say different things.&lt;/p&gt;

&lt;p&gt;Here is what each tool's documentation says today.&lt;/p&gt;

&lt;h2&gt;
  
  
  Claude Code
&lt;/h2&gt;

&lt;p&gt;From the &lt;a href="https://code.claude.com/docs/en/memory" rel="noopener noreferrer"&gt;memory docs&lt;/a&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If your repo has an &lt;code&gt;AGENTS.md&lt;/code&gt; and &lt;strong&gt;no&lt;/strong&gt; &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 the working directory or any directory above it, Claude Code reads your &lt;code&gt;AGENTS.md&lt;/code&gt;. This needs v2.1.277 or later.&lt;/li&gt;
&lt;li&gt;If any of those &lt;code&gt;CLAUDE.md&lt;/code&gt; files exist, Claude reads the &lt;code&gt;CLAUDE.md&lt;/code&gt; files &lt;strong&gt;only&lt;/strong&gt; by default.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;CLAUDE.local.md&lt;/code&gt; counts for that check. A personal, uncommitted &lt;code&gt;CLAUDE.local.md&lt;/code&gt; can quietly stop Claude from reading the team's &lt;code&gt;AGENTS.md&lt;/code&gt; for you.&lt;/li&gt;
&lt;li&gt;If your &lt;code&gt;CLAUDE.md&lt;/code&gt; contains &lt;code&gt;@AGENTS.md&lt;/code&gt;, the file is imported once, so nothing loads twice.&lt;/li&gt;
&lt;li&gt;The "Project instructions" setting in &lt;code&gt;/config&lt;/code&gt; can be changed to read both files.&lt;/li&gt;
&lt;li&gt;Run &lt;code&gt;/memory&lt;/code&gt; (or &lt;code&gt;/context&lt;/code&gt;) to see which instruction files were loaded.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The docs also say to aim for under about 200 lines per &lt;code&gt;CLAUDE.md&lt;/code&gt;, and that these files are context, not enforcement. If something must happen every time, use a hook.&lt;/p&gt;

&lt;p&gt;A &lt;code&gt;CLAUDE.md&lt;/code&gt; that shares the rules and adds Claude-only notes:&lt;br&gt;
&lt;/p&gt;

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

&lt;span class="gu"&gt;## Claude Code&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; Use plan mode for changes that touch more than two files.
&lt;span class="p"&gt;-&lt;/span&gt; Run /clear between unrelated tasks.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Cursor
&lt;/h2&gt;

&lt;p&gt;Cursor's &lt;a href="https://cursor.com/docs/context/rules" rel="noopener noreferrer"&gt;rules docs&lt;/a&gt; describe project rules as &lt;code&gt;.mdc&lt;/code&gt; files in &lt;code&gt;.cursor/rules&lt;/code&gt;. The frontmatter fields decide when a rule is included:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;code&gt;alwaysApply&lt;/code&gt;&lt;/th&gt;
&lt;th&gt;&lt;code&gt;description&lt;/code&gt;&lt;/th&gt;
&lt;th&gt;&lt;code&gt;globs&lt;/code&gt;&lt;/th&gt;
&lt;th&gt;What happens&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;true&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;n/a&lt;/td&gt;
&lt;td&gt;n/a&lt;/td&gt;
&lt;td&gt;Always included&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;n/a&lt;/td&gt;
&lt;td&gt;set&lt;/td&gt;
&lt;td&gt;Attached when a matching file is in context&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;set&lt;/td&gt;
&lt;td&gt;not set&lt;/td&gt;
&lt;td&gt;The agent reads the description and decides&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;not set&lt;/td&gt;
&lt;td&gt;not set&lt;/td&gt;
&lt;td&gt;Only when you &lt;code&gt;@&lt;/code&gt;-mention the rule&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Two details that trip people up: a plain &lt;code&gt;.md&lt;/code&gt; file in &lt;code&gt;.cursor/rules&lt;/code&gt; is ignored (it must be &lt;code&gt;.mdc&lt;/code&gt;), and Cursor also reads &lt;code&gt;AGENTS.md&lt;/code&gt;, including nested ones in subdirectories. Cursor's own advice is to keep each rule under 500 lines and split big ones into focused rules.&lt;/p&gt;

&lt;h2&gt;
  
  
  GitHub Copilot
&lt;/h2&gt;

&lt;p&gt;The &lt;a href="https://docs.github.com/en/copilot/how-tos/configure-custom-instructions/add-repository-instructions" rel="noopener noreferrer"&gt;Copilot docs&lt;/a&gt; list three kinds of repository instructions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;.github/copilot-instructions.md&lt;/code&gt; for the whole repository.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;.github/instructions/NAME.instructions.md&lt;/code&gt; with an &lt;code&gt;applyTo&lt;/code&gt; glob, for specific paths.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;AGENTS.md&lt;/code&gt; anywhere in the repo (the nearest one wins), or a single &lt;code&gt;CLAUDE.md&lt;/code&gt; or &lt;code&gt;GEMINI.md&lt;/code&gt; at the repo root.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Path-specific files are currently supported only for the Copilot cloud agent and Copilot code review on GitHub.com, so check which Copilot surface you use.&lt;/p&gt;

&lt;h2&gt;
  
  
  A structure that avoids drift
&lt;/h2&gt;

&lt;p&gt;This is the structure the free files below use, not the only way:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;One &lt;code&gt;AGENTS.md&lt;/code&gt;&lt;/strong&gt; as the shared source of truth.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;CLAUDE.md&lt;/code&gt; = &lt;code&gt;@AGENTS.md&lt;/code&gt; plus Claude-only lines&lt;/strong&gt;, as above.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cursor and Copilot files&lt;/strong&gt; kept consistent with the same content. Generating them from one source stops the files disagreeing; copying by hand does not.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If the overlap bothers you, the other honest option is to keep only the file for the single tool your team uses.&lt;/p&gt;

&lt;h2&gt;
  
  
  What belongs inside
&lt;/h2&gt;

&lt;p&gt;Three kinds of lines earn their place; cut the rest:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Facts about the repo.&lt;/strong&gt; Exact commands (&lt;code&gt;pnpm test&lt;/code&gt;, &lt;code&gt;uv run pytest&lt;/code&gt;), where things live.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Guards against mistakes agents are known to make&lt;/strong&gt;, taken from official docs rather than vibes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Verification steps.&lt;/strong&gt; "Run typecheck, lint and tests, and say which ones ran."&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Cursor's docs make a similar point: do not copy whole style guides (use a linter), and do not document every command the agent already knows.&lt;/p&gt;

&lt;p&gt;Example guards for Next.js 16, from the &lt;a href="https://nextjs.org/docs/app/guides/upgrading/version-16" rel="noopener noreferrer"&gt;upgrade guide&lt;/a&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;params&lt;/code&gt;, &lt;code&gt;searchParams&lt;/code&gt;, &lt;code&gt;cookies()&lt;/code&gt;, &lt;code&gt;headers()&lt;/code&gt; and &lt;code&gt;draftMode()&lt;/code&gt; must be awaited. Synchronous access was removed in 16.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;middleware.ts&lt;/code&gt; is renamed &lt;code&gt;proxy.ts&lt;/code&gt;, with an exported &lt;code&gt;proxy&lt;/code&gt; function. &lt;code&gt;proxy&lt;/code&gt; runs on the Node.js runtime only, so a project that needs the Edge runtime keeps &lt;code&gt;middleware&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;next lint&lt;/code&gt; was removed, and &lt;code&gt;next build&lt;/code&gt; no longer lints. Run ESLint or Biome directly.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One line each. If the agent already follows a line without being told, delete it.&lt;/p&gt;

&lt;h2&gt;
  
  
  What this does not do
&lt;/h2&gt;

&lt;p&gt;I have not benchmarked any of this against specific models, and I am not claiming it makes an agent better by some percentage. Rules are context. An agent can still ignore them. Tests, CI and code review stay the real gate. If you want to know whether a line earns its place, run the same few tasks with and without it and compare test results, not impressions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Free files, and a paid set
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Free to use, no signup (MIT licensed):&lt;/strong&gt; a Next.js 16 + TypeScript pack and a Python + FastAPI pack, each as &lt;code&gt;AGENTS.md&lt;/code&gt;, &lt;code&gt;CLAUDE.md&lt;/code&gt;, &lt;code&gt;.cursor/rules/*.mdc&lt;/code&gt; and &lt;code&gt;.github/copilot-instructions.md&lt;/code&gt;: &lt;a href="https://github.com/imwilzap/agent-rules-kit-lite" rel="noopener noreferrer"&gt;github.com/imwilzap/agent-rules-kit-lite&lt;/a&gt;. Corrections welcome as issues.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Disclosure:&lt;/strong&gt; I also sell a six-stack version (adds Go, Rust, Django and React Native) with a playbook PDF and a QA checklist for CAD 3.33: &lt;a href="https://wilzap.gumroad.com/l/ofhjr" rel="noopener noreferrer"&gt;Agent Rules Kit on Gumroad&lt;/a&gt;. It has a 7-day money-back guarantee. You do not need it to use anything above.&lt;/li&gt;
&lt;/ul&gt;

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