TLDR
CLAUDE.md is a Claude-specific convention (read automatically by the Claude CLI and Claude Code at session start). AGENTS.md is an emerging cross-tool pattern recognized by OpenAI Codex, Cursor, and others. Neither is a ratified standard - portability is partial and tool-dependent. The CCA-F anti-pattern: assuming CLAUDE.md is automatically honored by non-Anthropic agents in a multi-agent pipeline.
Where CLAUDE.md ends and AGENTS.md begins
| File | Read by | Status | Use when |
|---|---|---|---|
| CLAUDE.md | Claude CLI, Claude Code | Anthropic-specific | Your repo targets Anthropic tooling only. |
| AGENTS.md | OpenAI Codex, Cursor, several others (and Claude as a fallback) | Cross-tool emerging convention | Your repo is touched by multiple agentic IDEs or CLIs. |
| Both | Each tool reads its own; common content can live in AGENTS.md and be referenced from CLAUDE.md | Pragmatic dual-spec | Mixed-runtime teams where Claude-specific directives matter but cross-tool coverage is required. |
The conventions both files agree on
- Project-root placement - both files are discovered by the runtime walking up from the working directory.
- Markdown prose - both are read as markdown, parsed conservatively, and surfaced to the model as context.
- Instruction priority hierarchy - both honor section ordering as an implicit priority signal.
A well-structured AGENTS.md can be adopted by multiple runtimes with minimal editing as long as it sticks to these three conventions and avoids tool-specific directives.
Four steps to make instruction files portable
- Use tool-agnostic markdown for the bulk of the file. Plain prose, code fences, lists - nothing runtime-flagged.
- Isolate tool-specific sections under clearly labeled H2s (e.g.,
## Claude-only directives) so other runtimes can ignore them by convention. - Version-control the file and test initialization behavior per tool you target. Do not assume; verify each runtime actually reads what you wrote.
- Document which directives are no-ops outside Claude so future maintainers do not assume cross-tool effect that does not exist.
The agent-instruction-file vs system-prompt distinction
For the CCA-F, you must distinguish agent instruction files (persistent, file-system-resident context loaded at session start) from system prompts (runtime-injected, often per-request, sometimes dynamic). Portability breaks down precisely at this boundary - tools differ in how they inject or override file-based instructions, and confusing the two leads to D1 design errors.
Instruction files are the persistent layer. System prompts operate on top of them. A change to CLAUDE.md follows every future session for the project; a change to the system prompt applies only to the next call. Mixing the two in your head is the most common D1 conceptual error.
The silent-instruction-loss failure mode
This is the canonical CCA-F D1 anti-pattern. In a multi-agent pipeline where a non-Anthropic runtime takes over part of the workflow, CLAUDE.md is silently ignored. The agent runs without the conventions you thought were binding, and the failure mode is invisible because no error is raised. Behaviors drift, conventions decay, and the cause is buried.
Mitigation: use AGENTS.md as the cross-tool baseline, and explicitly test each runtime against your instructions before relying on them in production.