<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Cursorrules vs Claude.md vs Agents.md on RockB</title><link>https://baeseokjae.github.io/tags/cursorrules-vs-claude.md-vs-agents.md/</link><description>Recent content in Cursorrules vs Claude.md vs Agents.md on RockB</description><image><title>RockB</title><url>https://baeseokjae.github.io/images/og-default.png</url><link>https://baeseokjae.github.io/images/og-default.png</link></image><generator>Hugo</generator><language>en-us</language><lastBuildDate>Fri, 17 Apr 2026 21:00:16 +0000</lastBuildDate><atom:link href="https://baeseokjae.github.io/tags/cursorrules-vs-claude.md-vs-agents.md/index.xml" rel="self" type="application/rss+xml"/><item><title>.cursorrules vs CLAUDE.md vs AGENTS.md 2026: Which AI Config File Should You Use?</title><link>https://baeseokjae.github.io/posts/cursorrules-vs-claude-md-vs-agents-md-2026/</link><pubDate>Fri, 17 Apr 2026 21:00:16 +0000</pubDate><guid>https://baeseokjae.github.io/posts/cursorrules-vs-claude-md-vs-agents-md-2026/</guid><description>Compare AI coding config formats: .cursorrules, CLAUDE.md, AGENTS.md, .cursor/rules. Which format best fits your team in 2026?</description><content:encoded><![CDATA[<p>If your AI coding agent keeps making the same mistakes — using the wrong import style, ignoring your test conventions, or not knowing which files to avoid — the fix is a config file, not a better prompt. In 2026, three formats dominate: <code>.cursorrules</code> for Cursor-only teams, <code>CLAUDE.md</code> for Claude Code users who want the most features, and <code>AGENTS.md</code> for teams using multiple AI tools. Here is how to choose.</p>
<h2 id="the-ai-coding-config-landscape-in-2026">The AI Coding Config Landscape in 2026</h2>
<p>The AI coding configuration landscape in 2026 has fragmented into nine distinct formats across six major tools — a direct result of every AI coding product independently solving the same problem of how to give the AI persistent, project-specific context. The formats are: <code>.cursorrules</code> (Cursor, deprecated but still supported), <code>.cursor/rules/*.mdc</code> (Cursor&rsquo;s current format with four activation modes), <code>CLAUDE.md</code> (Claude Code with five-layer hierarchy), <code>AGENTS.md</code> (multi-tool universal standard, Linux Foundation stewardship), <code>copilot-instructions.md</code> (GitHub Copilot), <code>.windsurfrules</code> (Windsurf), <code>GEMINI.md</code> (Google Gemini CLI), <code>.github/instructions/*.instructions.md</code> (GitHub Copilot organization-level, GA April 2026), and <code>AGENTS.override.md</code> (Codex CLI local overrides). All converge on the same core concept — Markdown files in your repository that give the AI instructions it reads before every session — but they differ significantly in hierarchy depth, cross-file imports, activation modes, tooling ecosystem, and maintenance trajectory. If you use one AI tool, pick its native format. If you use three or more, AGENTS.md is the closest thing to a universal standard, adopted by 60,000+ open-source projects and backed by the Linux Foundation&rsquo;s Agentic AI Foundation.</p>
<h2 id="cursorrules--the-original-simple-popular-but-cursor-only">.cursorrules — The Original: Simple, Popular, but Cursor-Only</h2>
<p><code>.cursorrules</code> is the format that popularized the concept of AI coding configuration files, and it still has the largest community ecosystem in 2026 with over 2,000 community-contributed rule files in the awesome-cursorrules collection. The format is a single flat Markdown file placed in your project root that Cursor reads at the start of every session. It has no hierarchy, no cross-file imports, no global configuration, and no formal specification — just plain Markdown prose that the AI reads as context. The simplicity that made it popular is also its structural limitation: if you work on five projects, you maintain five separate <code>.cursorrules</code> files with no shared base, and if you switch to a different AI tool, none of your rules transfer. More significantly, Cursor itself deprecated <code>.cursorrules</code> in favor of <code>.cursor/rules/*.mdc</code> files with four activation modes — the old format still works but is no longer the recommended approach. Despite these limitations, <code>.cursorrules</code> remains a valid choice for solo developers who use only Cursor and want to get started in minutes without learning hierarchy systems. For teams or multi-tool users, it is the wrong foundation to build on in 2026.</p>
<h3 id="cursorrulesmdc--the-cursor-evolution">.cursor/rules/*.mdc — The Cursor Evolution</h3>
<p>Cursor&rsquo;s current format replaces the single <code>.cursorrules</code> file with multiple <code>.mdc</code> files inside a <code>.cursor/rules/</code> directory, each with a YAML frontmatter block that specifies its activation mode. The four modes are: <strong>Always On</strong> (loaded every session regardless of context), <strong>Auto Attached</strong> (loaded when files matching a glob pattern are in context), <strong>Model Decision</strong> (the AI decides whether to load the rule based on the current task), and <strong>Manual</strong> (loaded only when explicitly referenced with <code>@ruleName</code>). This activation system solves the context window problem: instead of loading your entire rule library on every task, you load only the rules relevant to the current work. A backend developer editing Django models loads the Django rules; a frontend developer editing React components loads the React rules. The practical downside is fragmentation — <code>.cursor/rules/*.mdc</code> files are Cursor-proprietary, so switching to Claude Code or Windsurf means starting your config from scratch.</p>
<h2 id="claudemd--the-deepest-feature-set">CLAUDE.md — The Deepest Feature Set</h2>
<p>CLAUDE.md is Claude Code&rsquo;s native configuration format and has the most sophisticated feature set of any AI coding config format in 2026. It supports a five-layer hierarchy that merges configuration from multiple locations: <code>~/.claude/CLAUDE.md</code> (global, applies to all projects), <code>./CLAUDE.md</code> (project root), <code>subdirectory/CLAUDE.md</code> files (apply only when that directory is in context), explicit <code>@import</code> statements that pull in additional files, and user-specific local overrides. This hierarchy means you can define organization-wide conventions once in your global CLAUDE.md, project-specific patterns in the repo root, and component-specific rules in subdirectory files — all automatically merged without duplication. Claude Code reads the merged result before every session and loads it into its context window. The feature that distinguishes CLAUDE.md most from competitors is its integration with Claude Code&rsquo;s hooks system: while CLAUDE.md handles advisory instructions (what the AI should do), <code>.claude/settings.json</code> hooks handle deterministic enforcement (what the system will do regardless of AI decisions, such as running a linter before every commit or refusing git push without passing tests). Major projects using CLAUDE.md include Next.js (138K GitHub stars), LangChain (128K), Excalidraw (118K), and Deno (106K).</p>
<h3 id="the-import-system-for-large-projects">The @import System for Large Projects</h3>
<p>CLAUDE.md&rsquo;s <code>@import</code> syntax allows you to split your configuration across multiple files and import them into a master CLAUDE.md, which is critical for large projects where a single monolithic config file becomes unwieldy. A common pattern is to maintain a base <code>AGENTS.md</code> with tool-agnostic universal conventions, then have your <code>CLAUDE.md</code> import it and add Claude-specific enhancements:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-markdown" data-lang="markdown"><span style="display:flex;"><span># CLAUDE.md
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>@import AGENTS.md
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">### Claude Code-Specific Instructions
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span>
</span></span><span style="display:flex;"><span>When using bash tools, prefer the Bash tool over running shell commands inline.
</span></span><span style="display:flex;"><span>Always use TodoWrite to track multi-step tasks.
</span></span></code></pre></div><p>This approach means your universal rules live in one place (<code>AGENTS.md</code>), your Claude-specific rules augment them in <code>CLAUDE.md</code>, and you avoid duplicating content across two files. HumanLayer uses this pattern and keeps their entire CLAUDE.md under 60 lines by importing shared conventions rather than repeating them.</p>
<h2 id="agentsmd--the-universal-standard">AGENTS.md — The Universal Standard</h2>
<p>AGENTS.md is the closest thing to a universal AI coding configuration standard in 2026. It is stewarded by the Linux Foundation under the Agentic AI Foundation, supported by 60+ tools including Codex CLI, Cursor, Claude Code, GitHub Copilot, Windsurf, Aider, Gemini CLI, Zed, Warp, Devin, and JetBrains Junie, and adopted by 60,000+ open-source projects. The format is intentionally simple: a Markdown file placed in your project root (or in subdirectories for scoped rules) that every supporting tool reads before starting work. Major projects that chose AGENTS.md over CLAUDE.md include n8n (178K GitHub stars), awesome-go (167K stars), LangFlow (145K stars), llama.cpp (97K stars), and Bun (82K stars) — notably these are projects with large contributor bases that need instructions to work regardless of which AI tool each contributor uses. The AGENTS.md community has 300+ example configurations available. OpenAI&rsquo;s own Codex repository uses 88 separate AGENTS.md files distributed across its directory structure, demonstrating that the format scales to complex monorepos. The tradeoff versus CLAUDE.md is features: AGENTS.md has no <code>@import</code> syntax, no hooks integration, and no global configuration outside the repository. What it has is universality.</p>
<h3 id="agentsmd-discovery-and-hierarchy">AGENTS.md Discovery and Hierarchy</h3>
<p>AGENTS.md supports a simple directory hierarchy: the AI tool walks from the repository root down to the current working directory, loading any AGENTS.md files it finds along the way and merging them in order. More specific (deeper) rules take precedence over more general (root-level) rules. Codex CLI extends this with <code>AGENTS.override.md</code> for local per-developer overrides that are not committed to the repository, and it enforces a 32 KiB (32,768 byte) per-file limit to prevent context window abuse. The discovery algorithm — walk the tree, load and merge — is simple enough that tool authors implement it consistently across 60+ tools, which is the key to its cross-tool reliability.</p>
<h2 id="head-to-head-comparison">Head-to-Head Comparison</h2>
<p>Choosing between these formats is fundamentally a question of coverage versus features. AGENTS.md wins on coverage — 60+ tools, 60,000+ open-source project adoptions, and Linux Foundation stewardship make it the safest long-term bet for any team that might add a second AI tool. CLAUDE.md wins on features — five-layer hierarchy, <code>@import</code>, hooks integration, and global configuration make it the most capable format for Claude Code teams who want maximum control over AI behavior. <code>.cursorrules</code> wins on nothing in 2026: its community ecosystem is large but it is deprecated in favor of <code>.cursor/rules/*.mdc</code>, and Cursor&rsquo;s new format with four activation modes is strictly superior for Cursor users.</p>
<table>
  <thead>
      <tr>
          <th>Feature</th>
          <th>.cursorrules</th>
          <th>CLAUDE.md</th>
          <th>AGENTS.md</th>
          <th>.cursor/rules</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>Tool support</td>
          <td>Cursor only (deprecated)</td>
          <td>Claude Code native</td>
          <td>60+ tools</td>
          <td>Cursor only</td>
      </tr>
      <tr>
          <td>Hierarchy</td>
          <td>None</td>
          <td>5 layers + @import</td>
          <td>Directory tree</td>
          <td>Per-file activation</td>
      </tr>
      <tr>
          <td>Global config</td>
          <td>No</td>
          <td>Yes (~/.claude/)</td>
          <td>No</td>
          <td>No</td>
      </tr>
      <tr>
          <td>Community examples</td>
          <td>2,000+</td>
          <td>500+</td>
          <td>300+</td>
          <td>Growing</td>
      </tr>
      <tr>
          <td>Linux Foundation backing</td>
          <td>No</td>
          <td>No</td>
          <td>Yes</td>
          <td>No</td>
      </tr>
      <tr>
          <td>Hooks/enforcement</td>
          <td>No</td>
          <td>Yes (.claude/settings.json)</td>
          <td>No</td>
          <td>No</td>
      </tr>
      <tr>
          <td>Formal spec</td>
          <td>No</td>
          <td>Partial</td>
          <td>Yes</td>
          <td>Partial</td>
      </tr>
      <tr>
          <td>Status</td>
          <td>Deprecated</td>
          <td>Active, recommended</td>
          <td>Active, recommended</td>
          <td>Active, recommended</td>
      </tr>
      <tr>
          <td>Best for</td>
          <td>Cursor solo devs</td>
          <td>Claude Code teams</td>
          <td>Multi-tool teams</td>
          <td>Cursor teams</td>
      </tr>
  </tbody>
</table>
<h2 id="the-instruction-budget-problem">The Instruction Budget Problem</h2>
<p>The most underappreciated constraint in AI coding configuration is the instruction budget. Frontier LLMs can reliably follow approximately 150–200 distinct instructions before adherence degrades — additional instructions compete with each other for attention and the probability of any single rule being followed reliably decreases. Claude Code&rsquo;s own system prompt consumes roughly 50 of those slots before your CLAUDE.md is even read. This means a 600-line CLAUDE.md does not give you 600 instructions — it gives you perhaps 100–150 reliable ones, with the remaining lines reducing the reliability of everything else. The practical implication: ruthless prioritization is more important than comprehensive coverage. A CLAUDE.md with 40 high-priority, non-obvious rules will produce better AI behavior than one with 200 rules covering everything. HumanLayer&rsquo;s approach of keeping CLAUDE.md under 60 lines is not minimalism for its own sake — it is calibration to the instruction budget. The recommended ceiling for most projects is 200–300 lines, with larger projects using <code>@import</code> to modularize rather than cramming everything into one file.</p>
<h3 id="token-visibility-and-context-costs">Token Visibility and Context Costs</h3>
<p>Beyond the instruction budget, config files consume token context on every session — and context is not free. A 500-line CLAUDE.md costs approximately 2,000–3,000 input tokens on every Claude Code session, which adds up to meaningful API cost at team scale. The token cost consideration pushes toward the same conclusion as the instruction budget: shorter is better. tokencentric.app&rsquo;s benchmark of 100–200 lines per config file reflects both constraints simultaneously.</p>
<h2 id="real-world-adoption-how-major-projects-choose">Real-World Adoption: How Major Projects Choose</h2>
<p>The split between CLAUDE.md and AGENTS.md adoption in major open-source projects reveals a clear pattern: projects with a single dominant contributor base using specific tools tend toward CLAUDE.md; projects with large, diverse contributor bases needing tool-agnostic instructions tend toward AGENTS.md. Next.js (138K stars, primarily Vercel team contributors using Claude Code) chose CLAUDE.md. n8n (178K stars, 700+ contributors using diverse AI tools) chose AGENTS.md. Deno (106K stars, small core team with Claude Code preference) chose CLAUDE.md. llama.cpp (97K stars, community-driven with contributors across all editors and tools) chose AGENTS.md. The decision logic: if your team is small and aligned on one AI tool, pick that tool&rsquo;s native format for maximum features. If your project has diverse contributors who use different tools, AGENTS.md ensures everyone&rsquo;s AI tool reads the same base conventions.</p>
<h2 id="hooks-vs-instructions-deterministic-vs-advisory">Hooks vs Instructions: Deterministic vs Advisory</h2>
<p>One of the most important conceptual distinctions in AI coding configuration is the difference between hooks (deterministic enforcement) and instructions (advisory guidance). CLAUDE.md instructions tell the AI what to do — but the AI can choose to deviate, especially under ambiguous conditions or when the instruction conflicts with another instruction. Hooks in <code>.claude/settings.json</code> are executed by the system, not the AI — they run regardless of AI decisions and cannot be overridden by the AI&rsquo;s judgment. The rule: use instructions for stylistic preferences and workflow conventions; use hooks for anything that must be enforced without exception. Examples: &ldquo;prefer functional components over class components&rdquo; belongs in CLAUDE.md as an instruction. &ldquo;Run ESLint before every commit&rdquo; belongs in <code>.claude/settings.json</code> as a hook. &ldquo;Never push to main&rdquo; belongs as a hook. &ldquo;Write tests for new functions&rdquo; is advisory enough to be an instruction.</p>
<h2 id="the-linter-principle-what-not-to-put-in-your-config-file">The Linter Principle: What NOT to Put in Your Config File</h2>
<p>A principle that experienced AI coding practitioners converge on independently: never use AI config files to enforce what a linter or formatter can enforce deterministically. If your project uses Prettier for code formatting and ESLint for code style, those tools enforce their rules on every file save and every CI run with 100% reliability. Adding the same rules to your CLAUDE.md gives you maybe 80% reliability (AI adherence) instead of 100%, while consuming instruction budget slots that could be used for non-automatable conventions. The test for whether a rule belongs in your config file: &ldquo;Can a tool enforce this automatically?&rdquo; If yes, use the tool. If no (architectural constraints, domain-specific conventions, non-obvious gotchas, workflow patterns), put it in your config file. This principle dramatically reduces config file size and increases the reliability of the rules that remain.</p>
<h2 id="migration-paths-cursorrules--claudemd--agentsmd">Migration Paths: .cursorrules → CLAUDE.md → AGENTS.md</h2>
<p>For teams evolving their AI toolchain, here are the practical migration steps.</p>
<p><strong>From .cursorrules to CLAUDE.md:</strong></p>
<ol>
<li>Copy <code>.cursorrules</code> content to <code>CLAUDE.md</code> in project root</li>
<li>Add <code>## Bash Commands</code> section with project-specific shell commands</li>
<li>Add <code>## Code Style</code> section for conventions not covered by your linter</li>
<li>Remove any rules that Prettier/ESLint already enforces</li>
<li>Create <code>~/.claude/CLAUDE.md</code> for cross-project personal conventions</li>
<li>Keep <code>CLAUDE.md</code> under 200 lines; use <code>@import</code> for larger projects</li>
</ol>
<p><strong>From CLAUDE.md to AGENTS.md (adding multi-tool support):</strong></p>
<ol>
<li>Extract tool-agnostic rules from <code>CLAUDE.md</code> into a new <code>AGENTS.md</code></li>
<li>Update <code>CLAUDE.md</code> to <code>@import AGENTS.md</code> at the top</li>
<li>Move Claude Code-specific instructions (hooks references, tool names) back to <code>CLAUDE.md</code></li>
<li>Test that both files load correctly in Claude Code</li>
<li>Verify AGENTS.md is read by your secondary AI tool (Cursor, Copilot, etc.)</li>
</ol>
<p><strong>From .cursorrules to AGENTS.md directly:</strong></p>
<ol>
<li>Rename <code>.cursorrules</code> to <code>AGENTS.md</code></li>
<li>Remove Cursor-specific syntax if any</li>
<li>Add your secondary AI tool&rsquo;s specific instructions to its native config file (<code>CLAUDE.md</code>, <code>.windsurfrules</code>, etc.)</li>
<li>Each tool-specific file should <code>@import AGENTS.md</code> (where supported) or duplicate the universal rules</li>
</ol>
<h2 id="multi-tool-strategy-avoiding-the-15-config-file-problem">Multi-Tool Strategy: Avoiding the 15-Config-File Problem</h2>
<p>A developer using three AI tools (Cursor, Claude Code, GitHub Copilot) across five projects faces a potential 15-config-file maintenance burden — nine if you are disciplined, fifteen if you are not — when each project requires separate configuration for each tool. According to tokencentric.app&rsquo;s analysis of multi-tool developer workflows, config file fragmentation is the top complaint among developers who use three or more AI coding tools in parallel, with the average developer spending 45 minutes per week synchronizing instructions across tool-specific config files. The solution is a canonical source-of-truth architecture that prevents this explosion while preserving tool-specific capabilities.</p>
<p>A developer using three AI tools (Cursor, Claude Code, GitHub Copilot) across five projects faces a potential 15-config-file maintenance burden if each project has separate configs for each tool. The solution is a single canonical source of truth (AGENTS.md) plus thin tool-specific adapters. The canonical AGENTS.md contains universal rules: project architecture, key commands, test patterns, workflow conventions. Each tool-specific file contains only what cannot be in AGENTS.md: tool-specific syntax, tool-specific features, and tool-specific performance tuning. Any rule change that applies universally is made in AGENTS.md once; changes that are truly tool-specific go in the adapter. This reduces the 15-file maintenance burden to 5 canonical files plus lightweight adapters that rarely change.</p>
<h2 id="faq">FAQ</h2>
<p>Choosing between <code>.cursorrules</code>, <code>CLAUDE.md</code>, and <code>AGENTS.md</code> is a genuine architectural decision that affects every developer on your team and every AI tool in your workflow. The questions below address the most common decision points, based on the adoption data and feature comparisons from the research underlying this guide. The format landscape is still evolving rapidly — Cursor&rsquo;s deprecation of <code>.cursorrules</code> in favor of <code>.mdc</code> files, GitHub Copilot&rsquo;s organization-level instructions going generally available in April 2026, and the Linux Foundation&rsquo;s stewardship of AGENTS.md all happened within the last six months. The right answer in 2026 may look different in 2027 as the category converges, but the core decision framework — tool coverage, hierarchy needs, team size, and enforcement requirements — will remain stable regardless of which specific format wins. When in doubt, start with AGENTS.md as your base and layer tool-specific files on top.</p>
<h3 id="is-cursorrules-still-worth-using-in-2026">Is .cursorrules still worth using in 2026?</h3>
<p>Not for new projects. Cursor deprecated <code>.cursorrules</code> in favor of <code>.cursor/rules/*.mdc</code> files with four activation modes, which gives you more control over when rules apply. Existing <code>.cursorrules</code> files still work, but you should migrate to <code>.mdc</code> format to access activation modes and stay on the supported path. If you use only Cursor, <code>.cursor/rules/*.mdc</code> is the right choice. If you use multiple tools, AGENTS.md should be your base.</p>
<h3 id="should-i-maintain-both-claudemd-and-agentsmd">Should I maintain both CLAUDE.md and AGENTS.md?</h3>
<p>Yes, if you use Claude Code alongside other AI tools. The recommended pattern: <code>AGENTS.md</code> contains universal, tool-agnostic rules; <code>CLAUDE.md</code> imports <code>AGENTS.md</code> with <code>@import AGENTS.md</code> and adds Claude-specific instructions (hooks references, Claude Code-specific workflow steps). This way universal rules are maintained once and Claude Code gets its full feature set without duplication.</p>
<h3 id="how-long-should-my-ai-config-file-be">How long should my AI config file be?</h3>
<p>Target 200 lines or fewer for the effective range. Frontier LLMs reliably follow 150–200 instructions; Claude Code&rsquo;s system prompt uses ~50 slots before your file is loaded, leaving roughly 100–150 reliable instruction slots. HumanLayer keeps theirs under 60 lines. The ceiling for most projects is 300 lines. Use <code>@import</code> to modularize larger projects rather than exceeding this limit.</p>
<h3 id="what-should-i-never-put-in-my-ai-config-file">What should I never put in my AI config file?</h3>
<p>Anything a linter or formatter enforces automatically. If ESLint catches it, Prettier formats it, or your CI pipeline rejects it, do not duplicate that rule in your AI config file — you get lower reliability (AI adherence vs tool enforcement) while wasting instruction budget. Config files should contain non-automatable knowledge: project-specific architectural decisions, non-obvious conventions, domain context, workflow patterns, and gotchas that aren&rsquo;t visible from the code itself.</p>
<h3 id="which-format-will-win-long-term">Which format will win long-term?</h3>
<p>AGENTS.md has the strongest structural position: Linux Foundation stewardship, 60+ tool support, and adoption by 60,000+ open-source projects give it the network effects of an emerging standard. The analogy is <code>.editorconfig</code> — once enough tools supported it, the question shifted from &ldquo;will editors adopt it?&rdquo; to &ldquo;which version of the spec are we on?&rdquo; CLAUDE.md will remain the superior choice for Claude Code teams who need its advanced features (hooks, <code>@import</code>, five-layer hierarchy). The most likely outcome is both coexist: AGENTS.md as the universal base, CLAUDE.md and <code>.cursor/rules/*.mdc</code> as feature-rich tool-specific layers above it.</p>
]]></content:encoded></item></channel></rss>