Post

Claude Code reads AGENTS.md only if no CLAUDE.md or CLAUDE.local.md exists in your working dir or any parent, ~/CLAUDE.md included. ~/.claude/CLAUDE.md is exempt from that check. https://importstatic.com/ai/agents-md-vs-claude-md

importstatic.comClaude Code skips AGENTS.md if any CLAUDE.md sits above your repoAGENTS.md vs CLAUDE.md: Claude Code skips AGENTS.md if any CLAUDE.md sits above your repo. Which files Codex, Copilot, Cursor and Gemini CLI read, in one table.

1 repost4 likes

The parent walk is the quiet trap. My repo had only AGENTS.md and it still never loaded, a leftover ~/CLAUDE.md from an old setup counted as a parent. /memory lists every memory file in play, user level included, that pinned it down fast. Removed it, AGENTS.md loads fine now.

Simplest fix I've found: keep AGENTS.md as the single source and make CLAUDE.md one line, @AGENTS.md. Claude Code pulls it in as an import, Codex reads the original, and the two never drift apart.

That fallback catches people out: a stray ~/CLAUDE.md quietly sidelines the AGENTS.md they thought was in charge. How did you find out, a rule that suddenly stopped being followed?

/memory only tells you after the fact, which is late if the stray file has been steering things for a week. Worth checking before you trust any instruction you've added.

the checker in the post walks from your working dir up to / and shows which file Claude Code should load, with no session needed. Or skip the fallback: a repo CLAUDE.md that just says @AGENTS.md loads it whatever sits above the repo indeed

claude.mdOverview - Claude Code DocsClaude Code is an agentic coding tool that reads your codebase, edits files, runs commands, and integrates with your development tools. Available in your terminal, IDE, desktop app, and browser.

Finding out a week late is the real cost there. What would you want as the early warning: a list of every instruction file loaded at the start of each session, or a flag when a new one appears?