Shared Claude Code & OpenAI Codex instructions.
Ivan Reshetnikov · 21 Aug 2026
Store in AGENTS.md, reference from CLAUDE.md.
AGENTS.md
CLAUDE.md → @AGENTS.md
/tests/
AGENTS.md
CLAUDE.md → @AGENTS.md
One caveat in the mechanics. Both merge nested instructions with the root file, but they discover them differently:
• Claude Code discovers nested CLAUDE.md on demand when working with files in that directory.
• Codex loads the AGENTS.md chain from the project root to the current working directory at session start.
Official docs:
Claude Code → https://code.claude.com/docs/en/memory#how-claude-md-files-load
OpenAI Codex → https://learn.chatgpt.com/docs/agent-configuration/agents-md#how-codex-discovers-guidance