{
  "id": 21920168,
  "title": "CLAUDE.md, AGENTS.md or Cursor rules: which file should you write?",
  "url": "https://urgent.news/2026/11/26/claude-md-agents-md-or-cursor-rules-which-file-should-you-write",
  "topic": "ai",
  "section": "AI",
  "published": "2026-11-26T03:44:19.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/tidybytetools/claudemd-agentsmd-or-cursor-rules-which-file-should-you-write-1om3"
  },
  "original_language": "en",
  "account": "Different coding agents use distinct instruction files, and loading multiple agents can result in redundant files, incurring additional costs and causing information to become outdated. To maintain a clean setup, each agent reads a specific file—CLAUDE.md for Claude, AGENTS.md for Codex and Cursor, and .cursor/rules for Cursor. CLAUDE.md is loaded every session, while AGENTS.md is accessed by Codex, Cursor, and other tools during individual tasks. Cursor rules (.cursor/rules) are always applied unless their globs or description aligns with the current scenario.\n\nWhen managing multiple tools, it's best to store the actual rules in AGENTS.md, with CLAUDE.md importing it via @AGENTS.md. Cursor rules should only be utilized for file-specific settings using globs, and nested AGENTS.md files can be employed in subfolders to apply rules only within specific project areas.\n\nFile size is crucial; Codex will cease adding AGENT.md files once the file size reaches 32 KiB by default, but smaller files are preferable. For Claude Code, aim to keep CLAUDE.md under 200 lines. For more complex workflows, consider splitting them into separate skills. Short files are not only cost-effective but also more likely to be fully read by the agents.\n\nThe content in these files should include essential build, test, and run commands. Additionally, include rules that aren't evident from the codebase, such as naming conventions, restricted folders, and commit guidelines. Document any lessons learned from past mistakes as concise, standalone lines. Avoid including outdated meeting notes, extensive style guides, or information accessible through the code itself.\n\nSeveral resources can aid in maintaining these files. The Agent Cost Saver (free on Gumroad) provides a cost_audit.py tool to identify redundancy, oversize files, and always-on rules in CLAUDE.md and AGENTS.md. The AGENTS.md Starter Pack offers pre-formatted AGENT.md files tailored for common project types. For further guidance, refer to the guides on testing Claude Code skill packs and the related articles on Tidy Byte Tools.",
  "summary": "Each coding agent reads a different instruction file. If you use more than one agent, you can end up with three files that say the same thing. That costs tokens and drifts out of date. Here is a simple way to keep it tidy. Who reads what File Read by When it loads CLAUDE.md Claude Code Every session AGENTS.md Codex, Cursor and other tools Every task. Codex starts at the project root and walks…",
  "key_points": [
    "CLAUDE.md loaded per session, AGENTS.md accessed task-wise",
    "Cursor rules (.cursor/rules) applied unless specific to scenario",
    "Keep AGENT.md files under 32 KiB, CLAUDE.md under 200 lines"
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}