Which instruction file each coding agent actually reads
The rule file each agent reads, checked Nov 8, 2026: Claude Code, Codex, Cursor and GitHub Copilot.
Published here · 5 sources · Resume reading
Using more than one coding agent? Rules in the wrong file are never read. Here is where each one looks, checked Nov 8, 2026.
Claude Code
Reads CLAUDE.md (or .claude/CLAUDE.md), CLAUDE.local.md, and ~/.claude/CLAUDE.md [1].
By default it reads AGENTS.md only when no CLAUDE.md, .claude/CLAUDE.md or CLAUDE.local.md exists in your folder or above it (v2.1.277 or later). The docs say target under 200 lines per file.
Codex
In each folder from the project root down, reads AGENTS.override.md first, then AGENTS.md [2]. One file per folder. It stops adding files at 32 KiB combined (project_doc_max_bytes default).
Cursor
Rules live in .cursor/rules as .mdc files [3]. A plain .md there is ignored. AGENTS.md also works in the root and subfolders. The docs say keep rules under 500 lines.
GitHub Copilot
Reads .github/copilot-instructions.md, plus .github/instructions/NAME.instructions.md files with an applyTo glob [4]. The nearest AGENTS.md wins.
Warning: AGENTS.md is read by the cloud agent, code review, CLI and VS Code chat [5]. Not by Copilot Chat in JetBrains or Visual Studio. On GitHub.com, path-specific files work only for Copilot cloud agent and Copilot code review.
One source for every agent
Put your rules in one place and point each agent to it:
AGENTS.md the rules, read by Codex, Cursor, Copilot agent
CLAUDE.md one line: @AGENTS.md
.cursor/rules/*.mdc Cursor-only rules, never plain .mdYou should see each agent pick up the same rules from AGENTS.md.
Send this to the friend using Claude Code, Codex and Cursor whose rules get ignored by half of them.
Keep this guide
Filed under AI agents, Claude Code
Questions about this guide
Does Claude Code read AGENTS.md?
By default, only when no CLAUDE.md, .claude/CLAUDE.md or CLAUDE.local.md exists in your folder or above it (v2.1.277 or later).
Why does Cursor ignore .md files in .cursor/rules?
Cursor rules must use the .mdc extension. A plain .md file in that folder is ignored.
Sources
- Claude Code docs: memorycode.claude.com
- Codex docs: AGENTS.mddevelopers.openai.com
- Cursor docs: rulescursor.com
- GitHub docs: repository instructionsdocs.github.com
- GitHub docs: custom instructions supportdocs.github.com