using AGENTS.md as single source including for Claude

I use multiple vendors when generating software: Claude Code, Cursor, OpenAI Codex.

I want to define Agent rules in one place for all. 

But Claude looks for CLAUDE.md, not AGENTS.md. OpenAI and Cursor read AGENTS.md (not CLAUDE.md). 
Additionally, Cursor uses its own cursor rules files where we have defined specific rules.

AGENTS.md is for certain information only. Cursor rules and Skills have their own purposes.

My solution is use AGENTS.md as the single source of truth, not CLAUDE.md. I put a reference to the agents file in CLAUDE.md like so: "@AGENTS.md"
  • In CLAUDE.md. @AGENTS.md is also expanded before Claude code sees anything. From the memory docs: "Imported files are expanded and loaded into context at launch alongside the CLAUDE.md that references them". No tool call, no pointer, no decision on Claude's part.

An easy way to see this is after first starting Claude run "/context" and scroll down to Memory files section. It shows CLAUDE.md loaded and also the referenced AGENTS.md file loaded.

You can also just ask in Claude code if the context includes such and such AGENTS.md.


aside:
AGENTS.md/CLAUDE.md best practices
- keep short (< 300 lines)
- always on project context and core commands
- don't repeat info AI can find elsewhere

Skills are for on demand tasks, "how tos" if you will.

Cursor rules path targeted constraints e.g. ts file specific rules 

Comments

Popular posts from this blog

angular js protractor e2e cheatsheet

angularjs ui-router query string parameter support

Notes on interview with Kent Beck about AI and why it's like a "genie"