A JOURNAL OF ARTIFICIAL INTELLIGENCE
my ai daily

AGENTS.md vs CLAUDE.md vs Cursor Rules: One Config Guide

Teams running Claude Code, Cursor, Codex, and Qwen Code inside the same repository face instruction drift across competing Markdown files—here is which files each agent actually reads and how a single-line @AGENTS.md import keeps one canonical rulebook.

AI-generated editorial illustration of a central brass-bound ivory blueprint folio on dark slate sending luminous cyan alignment threads to three precision mechanical drafting instruments.
AI-generated illustration / my ai dailyIllustrative image.

THE STORY IN THREE POINTS

  • AGENTS.md has emerged as the tool-neutral repository instruction standard read natively by OpenAI Codex, Cursor, OpenCode, and Qwen Code, while Cursor marks legacy root .cursorrules files as deprecated in favor of scoped .cursor/rules/*.mdc files and AGENTS.md.
  • In Anthropic’s Claude Code, CLAUDE.md remains the authoritative instruction file: even where fallback lookup sees AGENTS.md when CLAUDE.md is absent, any CLAUDE.md present in the working directory chain takes precedence and suppresses AGENTS.md.
  • To eliminate config drift without symlinks breaking on Windows, maintain every shared build command, test rule, and architecture constraint in root AGENTS.md and place a plain-text single line @AGENTS.md inside CLAUDE.md (never wrapped in backticks).

Which coding agent reads AGENTS.md, CLAUDE.md, or .cursor/rules/*.mdc?

As engineering organizations mix Claude Code and Cursor alongside OpenAI Codex, Qwen Code, and OpenCode inside one monorepo, duplicated rule files quickly drift out of sync. Across the major 2026 harnesses, native file discovery splits along clear lines: OpenAI Codex, OpenCode, Qwen Code, and Cursor read root AGENTS.md natively; Anthropic’s Claude Code prioritizes CLAUDE.md (alongside per-project auto-memory indices under ~/.claude/projects/<project>/memory/MEMORY.md); Google’s Gemini CLI reads GEMINI.md; and Cursor layers path-scoped .cursor/rules/*.mdc files with YAML glob frontmatter on top of AGENTS.md.

Two legacy assumptions trip up teams auditing older repositories. First, Cursor officially designates root .cursorrules files as legacy and advises migrating glob-specific language or framework guidance into .cursor/rules/*.mdc while keeping universal repository rules in AGENTS.md. Second, standalone Windsurf rule configurations have largely consolidated into enterprise pipelines following Windsurf’s June 2, 2026 merger into Devin Desktop, making AGENTS.md the safest portable baseline for cross-tool teams.

Does Claude Code read AGENTS.md? Precedence rules and the @AGENTS.md bridge

Confusion over whether Claude Code reads AGENTS.md persists because tutorials conflate fallback discovery with precedence behavior. As GetUnblocked’s audit of Anthropic’s documentation and Claude Code’s memory specification clarify, CLAUDE.md is Anthropic’s native first-class configuration target—and whenever a CLAUDE.md file exists in the repository or parent directory chain, Claude Code loads CLAUDE.md and ignores AGENTS.md unless explicitly referenced.

The cleanest zero-duplication bridge for multi-tool teams is Claude Code’s native @-import directive. Keep all shared repository instructions—test commands, lint checks, directory conventions, and forbidden edits—inside root AGENTS.md, then commit a minimal root CLAUDE.md containing plain text @AGENTS.md on its own line followed only by Claude-specific hook or permission notes. Never wrap @AGENTS.md inside Markdown backticks or fenced code blocks, because Claude Code’s parser skips code spans and silently drops the import. On Unix-only repositories, ln -s AGENTS.md CLAUDE.md works as an alternative, though plain @AGENTS.md avoids Windows Git symlink headaches.

Structuring a single-source AGENTS.md without bloating agent context

Every instruction file loads at session start before the first user prompt, meaning bloated 2,000-line manuals burn input tokens and dilute attention across both MCP tool calls and file edits. Keep root AGENTS.md concise—focused on exact build, test, and verification commands, architecture boundaries, naming conventions, and high-risk prohibitions—while delegating deep subsystem specs to scoped subdirectory AGENTS.md files or Cursor .cursor/rules/*.mdc globs that trigger only when an agent edits matching paths.

Finally, keep secret tokens and local environment overrides completely out of tracked AGENTS.md and CLAUDE.md files: place machine-specific preferences inside untracked CLAUDE.local.md and route API credentials strictly through runtime environment variable expansion inside .mcp.json so shared instruction files stay portable across every developer and CI runner.

Sources: AGENTS.md Open Specification for Coding Agents|AGENTS.md ↗ Manage Claude’s Memory (CLAUDE.md, @-Imports & Auto Memory)|Claude Code Docs ↗ Project Rules (.cursor/rules/*.mdc & Legacy .cursorrules)|Cursor Docs ↗ CLAUDE.md vs AGENTS.md vs Cursor Rules: Unifying AI Configs|GetUnblocked ↗

THE BROADER CONTEXT · CLAUDE DOSSIER

Explore full product specifications, pricing analysis, and continuous coverage in the Claude Desk Hub. Independent benchmarks available on the AI Intelligence Index and Coding Agents Leaderboard.

02The next story

News

How to Install Claude Code on Windows (Native & WSL2)

Anthropic has deprecated npm install for Claude Code in favor of standalone native installers—yet native Windows lacks OS command sandboxing. Here is when to choose PowerShell vs. WSL2, exact setup commands, and fixes for PATH and Git Bash errors.

Aider vs Claude Code: Git-First CLI vs Subagent Runtime

Both Aider and Claude Code live inside the terminal—yet one treats Git commits as its core contract with any cloud or local model, while the other ships hooks, MCP, and parallel subagents tuned strictly for Anthropic’s top-ranked Claude checkpoints.

Claude vs ChatGPT: Speed, Coding, Writing & Context Limits

As US search interest in Claude surged +347% YoY, Claude 5.5/Fable 5.2 and ChatGPT (GPT-6.2 Astra/Sol) have diverged cleanly: pick ChatGPT for sub-2-second everyday speed, Intelligent UI canvases, and Space collaboration; pick Claude for 1M-token coding and prose discipline.

Follow your curiosity.

EXPLORE THE ARCHIVESOURCES & CONTEXT INCLUDED