Feature request: support AGENTS.md as a native context file alongside CLAUDE.md
Summary
Claude Code currently reads CLAUDE.md as its native per-repository instruction file. This works well, but AGENTS.md is a widely adopted, tool-agnostic convention used by Codex and other AI coding agents for the same purpose. Supporting AGENTS.md natively would make Claude Code first-class in multi-agent workflows without requiring duplicate files.
Current behavior
Claude Code reads CLAUDE.md at the repository root. AGENTS.md is not automatically loaded. Users who follow the AGENTS.md convention (common in repos that also use Codex) must either:
- Maintain a separate
CLAUDE.mdthat just points toAGENTS.md, or - Duplicate instructions across both files
Desired behavior
Claude Code should read AGENTS.md natively — either as a fallback when CLAUDE.md is absent, or in addition to CLAUDE.md with a defined precedence order (e.g., CLAUDE.md wins on conflict).
A reasonable reading order would be:
CLAUDE.md(Claude-specific overrides, if present)AGENTS.md(shared cross-tool instructions)
Why this matters
AGENTS.md is tool-agnostic by design. Teams standardizing on it get consistent agent behavior across Codex, Cursor, and other tools for free. Requiring a separate CLAUDE.md creates friction and risks instruction drift when the two files diverge.
Supporting AGENTS.md would make Claude Code a better citizen in repos that are already following this convention — without breaking any existing CLAUDE.md behavior.
Workaround
Currently working around this with a minimal CLAUDE.md in every repo that simply lists the reading order and points to AGENTS.md:
Read these files before taking any action in this repository:
1. `AGENTS.md` — behavioral rules and operating instructions
2. `rules/repo_rules.md` — binding structural constraints
3. `DEPLOYMENT.md` — deploy process
4. `.ai_context.md` — supplemental context
This works but requires maintaining an extra file in every repository.
14 Comments
Your workaround of a minimal
CLAUDE.mdpointing toAGENTS.mdis actually the cleanest approach right now. One refinement: you can make Claude Code automatically readAGENTS.mdon every session start using a hook:This doesn't make Claude Code read the file natively, but the hook output appears in Claude's context as a reminder that
AGENTS.mdexists and should be consulted.For the minimal
CLAUDE.mdapproach, this single line is sufficient:Claude Code reads
CLAUDE.mdat session start, sees this instruction, and will readAGENTS.mdas its first action. No need for a numbered file list unless you have many instruction files.If AGENTS.md support lands, pairing it with auto-accept for agent approvals would make workflows truly autonomous. I built Antigravity Autopilot — OS Level which auto-clicks Accept/Run/Continue/Allow buttons using Windows UI Automation (no CDP).
The accept/reject patterns in AGENTS.md could theoretically map to the extension's configurable regex patterns for controlling which actions get auto-approved.
GitHub: https://github.com/timteh/antigravity-autopilot
we use CLAUDE.md heavily and it works great, but the naming is confusing when you have a multi-agent setup where different agents need different context. having AGENTS.md as a separate file for agent-specific instructions (tool permissions, behavior rules, orchestration patterns) while CLAUDE.md stays focused on project context would make the separation of concerns much cleaner. right now we end up with one massive CLAUDE.md that mixes project docs with agent config.
here's our current CLAUDE.md that mixes project docs with agent config - exactly the kind of thing that would benefit from AGENTS.md separation: https://github.com/m13v/fazm/blob/main/CLAUDE.md
The cleanest solution is probably just to symlink CLAUDE.md to AGENTS.md.
But I'd like to avoid the extra file completely. Just one AGENTS.md file that all LLMs can use please. Project roots already have way too many files in it. It's becoming a mess.
Related extension to this proposal:
If AGENTS.md dual-read lands,
.agents/skills/dual-discovery is a natural follow-on with the same rationale. Claude Code currently scans~/.claude/skills/and./.claude/skills/for SKILL.md files. Adding~/.agents/skills/and./.agents/skills/to that scan (with.claude/winning on name collision, same precedence model as the file-level proposal in this issue) would let a single skills dir work across every tool that honors AGENTS.md.Use case: a SKILL.md that defines an outbound-sales workflow or a design-review workflow is valuable across Claude Code, Cursor, Aider, Codex. Maintaining separate copies per tool loses the common case where the skill is tool-agnostic.
Scope: optional, can ship after the AGENTS.md file-level support if that is cleaner. Just flagging here so the design accommodates it from day one.
Doesn't Claude already read AGENTS.md when CLAUDE.md is missing?
First time for me, instead of generating claude.md, i've got a agents.md from /init command
No, it does not. I checked yesterday, version 2.1.119.
you can also import your
AGENTS.mdinside theCLAUDE.md, so you avoid duplicatesAGENTS.md support would help with the filename mismatch, but the migration problem is usually broader than the instruction file.
The parts that tend to break on a Claude Code -> Codex move are:
A useful import path could read AGENTS.md directly and explicitly mark those buckets as non-equivalent when behavior cannot be preserved.
I wrote up the AGENTS.md / CLAUDE.md audit cases here in case it's useful: https://bringyour.ai/agents-md-claude-md
charging money for something people can just ask their clanker to do in seconds is pretty hilarious
The minimal-CLAUDE.md-pointing-at-AGENTS.md trick is what we landed on too, and it's fine until you also have skills, hooks, and MCP config that only one of the two formats can express — at which point you're hand-maintaining the precedence layer in your head every time someone edits a file.
What worked for me was generating both files from one source, deterministically. xcaffold's kind: context renders the same body to CLAUDE.md and AGENTS.md in one apply, so neither file needs to be hand-authored as a pointer to the other — both contain the same content directly. Claude-specific kinds that AGENTS.md can't carry (skills, hooks, MCP server declarations) stay in their native locations: skills land in .claude/skills/<name>/SKILL.md, hooks and MCP servers end up in .claude/settings.json and .claude/mcp.json. So you keep the Claude-only features without losing AGENTS.md compatibility for tools that want it. The precedence question goes from "decide every time someone edits a file" to "decided once when you set the targets list."
Doesn't replace native support, but it stops the two files from drifting in the meantime.
One acceptance criterion I'd add for native
AGENTS.mdsupport: don't just make the file readable — make the resolution chain inspectable.The hard part for teams using Claude Code + Codex/Cursor/Windsurf is not only filename mismatch. It is knowing whether a rule was loaded through a native surface, through an
@AGENTS.mdimport shim, through generated sibling files, or not modeled at all.A useful implementation/debug output would expose something like:
That would keep the feature honest: same bytes are not always the same semantics.
AGENTS.mdnative-read is valuable, but teams also need to see precedence, path ancestry, import behavior, and what still remains Claude-specific (.claude/skills, hooks, MCP config, etc.). Otherwise the compatibility layer just moves from duplicated files into maintainers' heads.