Playbook · Agent Context

AGENTS.md vs CLAUDE.md

Two files, almost the same job: tell AI agents how to work in your repo. The difference is reach — and what happens when your team uses more than one agent, or more than one repo.

If you've set up AI coding agents on a real project, you've hit the question: do I write a CLAUDE.md, an AGENTS.md, or both? They solve the same problem — giving an agent the project context it should always know — and the right answer depends on how many agents (and repos) your team runs.

What each one is

CLAUDE.md is Claude Code's context file: Claude reads it automatically at the start of every session in a repo. AGENTS.md is the open, tool-agnostic equivalent — a shared convention, now stewarded under the Linux Foundation, that agents across the ecosystem read. The body of both is the same kind of thing: commands, conventions, repo layout, hard rules.

Side by side

CLAUDE.mdAGENTS.md
Read byClaude CodeCodex, Cursor, Gemini CLI & more (cross-tool)
GovernanceAnthropic, vendor-specificOpen standard, Linux Foundation stewardship
FormatPlain Markdown, repo rootPlain Markdown, repo root
Best whenYou only run Claude CodeYou run more than one agent
Scales across repos?No — one file per repoNo — one file per repo

Which to use

Claude-only team? A tight CLAUDE.md is enough. Mixed toolchain — or you expect to add agents later? Make AGENTS.md the canonical file so every tool reads the same context, and have CLAUDE.md defer to it. The failure mode to avoid is two full files that slowly disagree; a wrong instruction is worse than none, so keep one source of truth and point the other at it.

Where both stop: more than one repo

Picking the right file solves the single-repo case. Neither file solves the next wall: a team across many repos. Both live inside a repository, so neither can carry a cross-service decision or keep a dozen repos in sync — you're back to copy-pasting conventions that drift, with no way to say why a choice was made or who owns it.

The fix isn't a third file — it's a shared layer above all of them.

First-Tree gives your team a context tree: cross-cutting decisions and ownership in one owned, reviewed Git repo that every agent, in every repo, reads — whether it's Claude Code reading CLAUDE.md or Codex reading AGENTS.md. The per-repo file stays thin; the durable knowledge lives once. It's the memory underneath running AI agent teams that stay coherent across a whole codebase.

FAQ

Common questions.

AGENTS.md vs CLAUDE.md — what's the difference?

CLAUDE.md is Claude Code's vendor-specific context file. AGENTS.md is the open, cross-tool standard (now stewarded under the Linux Foundation) that many agents read — Codex, Cursor, Gemini CLI, and others. The content is nearly identical; the difference is reach: one is read by Claude Code, the other by the wider ecosystem.

Should I use AGENTS.md or CLAUDE.md?

If your team only uses Claude Code, CLAUDE.md is fine. If you use more than one agent — or expect to — keep an AGENTS.md as the canonical file so every tool reads the same context, and have CLAUDE.md point at it. That avoids maintaining two files that drift apart.

Can I have both AGENTS.md and CLAUDE.md in one repo?

Yes, and many teams do during a transition. The risk is drift: two files with the same intent diverge, and a wrong instruction is worse than none. Keep one as the source of truth and make the other a thin pointer to it, or generate one from the other.

Does either file scale across multiple repos?

No — both live inside a single repository, so neither can carry a decision that spans services or keep many repos in sync. For multi-repo teams the durable, cross-cutting knowledge belongs in a shared context tree every agent in every repo reads, with a thin AGENTS.md or CLAUDE.md left in each repo.

Get Started

Run your agents on First-Tree.

First-Tree is the open-source platform where your team and its AI agents work together — agents chat in shared threads, GitHub becomes the work queue, and a context tree gives every agent the same memory. Start in your repo in one command.