SKILL.md vs CLAUDE.md vs AGENTS.md: what's the difference?
These three files get lumped together, but they solve different problems: two load every session, one loads on demand. Here's how SKILL.md, CLAUDE.md, and AGENTS.md actually differ — and why most projects use more than one.
Why these three get confused
Search for AI coding config and you'll hit SKILL.md, CLAUDE.md, and AGENTS.md side by side, as if you must pick one. You don't — they aren't three rivals for the same slot.
The split that matters is about loading:
- CLAUDE.md and AGENTS.md are the same category — always-on project instructions, loaded at the start of every session. (Gemini's GEMINI.md belongs here too.)
- SKILL.md is a different mechanism — an on-demand capability that loads only when a task matches it.
- Session startsCLAUDE.md · AGENTS.md · GEMINI.mdloaded in fullalways-on
- Session startsevery skill's name + description~100 tokens eachalways-on
- A task matches a skillthat SKILL.md's bodyloaded nowon demand
- The instructions need morescripts/ · references/ · assets/only if usedon demand
Once you see that two of them are always on and one is on demand, the "vs" mostly dissolves.
What each one is
SKILL.md
SKILL.md is the entry point of an Agent Skill: a folder with a SKILL.md file — YAML frontmatter with a name and description, then Markdown instructions — plus optional scripts/, references/, and assets/. Anthropic released the format as an open standard on December 18, 2025; it's specified at agentskills.io and read by Claude Code, Codex, Gemini CLI, Antigravity, GitHub Copilot, Cursor, and many more.
It loads through progressive disclosure: only each skill's name and description sit in context up front; the full body loads when the task matches; bundled files open only if the instructions reach for them. So a skill costs almost nothing until it's used — and unlike the other files, it can ship runnable scripts.
CLAUDE.md
CLAUDE.md is Claude Code's instructions file: build and test commands, conventions, "always do X" rules that Claude reads at the start of every session. It can live in the project (./CLAUDE.md or ./.claude/CLAUDE.md), in your home folder (~/.claude/CLAUDE.md), or in an organization-wide managed location. Files in the directories above your working directory load at launch; ones in subdirectories load when Claude starts working there. Anthropic suggests keeping each file under about 200 lines — and it's guidance, not enforcement: use hooks and permissions for hard rules.
AGENTS.md
AGENTS.md is a tool-agnostic open format — a "README for agents" at the repo root. It's now stewarded by the Agentic AI Foundation under the Linux Foundation and used by more than 60,000 open-source projects. Codex, GitHub Copilot's coding agent, Cursor, Jules, Aider, Zed, Warp, VS Code, and many others read it; in a monorepo, the AGENTS.md closest to the edited file wins.
GEMINI.md
GEMINI.md is Gemini CLI's context file — the Gemini equivalent of CLAUDE.md, loaded from ~/.gemini/GEMINI.md and from your workspace and its parent folders. Gemini CLI reads AGENTS.md too if you add it to the context.fileName setting.
Claude Code now reads AGENTS.md
Since v2.1.277, Claude Code reads a repository's AGENTS.md as its project instructions when there's no CLAUDE.md in your working directory or above it. Have both? By default it reads only CLAUDE.md — set Project instructions to load both, or keep an @AGENTS.md import inside your CLAUDE.md.
Comparison table
| Dimension | SKILL.md | CLAUDE.md | AGENTS.md |
|---|---|---|---|
| Loading | On demand — only name + description up front | Always on — every session | Always on — every session |
| Scope | One reusable capability | The whole project, for Claude Code | The whole project, for any agent |
| Read by | Claude Code, Codex, Gemini CLI, Antigravity, Copilot, Cursor, and more | Claude Code | Codex, Copilot, Cursor, Gemini CLI (when configured), Claude Code (when no CLAUDE.md), and more |
| Location | ~/.claude/skills/, ~/.agents/skills/, ~/.gemini/skills/, project folders | ./CLAUDE.md, ./.claude/CLAUDE.md, ~/.claude/CLAUDE.md, managed policy | Repo-root AGENTS.md; nested files in monorepos, closest wins |
| Can bundle scripts | Yes — scripts/, references/, assets/ | No | No |
| Best for | Specialized procedures you need sometimes | Always-needed Claude Code facts and rules | Always-needed repo facts, portable across agents |
Which one when
A quick decision guide:
- Facts every session needs — build commands, conventions, architecture, hard constraints? Use an always-on file. Want it portable across agents? Write AGENTS.md. Claude Code-only team? CLAUDE.md is the native path, and an AGENTS.md now works there too.
- A multi-step procedure you need only sometimes — a release checklist, a migration runbook, a formatter with a helper script? Make it a skill so it loads on demand and costs nothing the rest of the time.
- Long reference material that would bloat every session? Put it in a skill's
references/, not in CLAUDE.md or AGENTS.md. - Something that must never be skipped? None of these files enforce anything. Reach for hooks and permissions.
Anthropic's own guidance puts it well: keep CLAUDE.md to facts Claude should hold in every session, and move procedures into skills.
Use them together
They're complementary, not either/or. A healthy setup looks like:
- AGENTS.md (or CLAUDE.md) for the always-on baseline: how to build, test, and lint; naming conventions; "never touch these files" rules.
- Skills for the specialized jobs: generating a changelog, running a data migration, scaffolding a component — each with its own instructions and optional scripts.
One repo, every agent
Put the baseline in AGENTS.md and your team's skills in .agents/skills/. Codex reads both as-is. Gemini CLI reads the skills folder, and AGENTS.md once you add it to context.fileName. Claude Code reads AGENTS.md when there's no CLAUDE.md, and takes its copy of the skills from .claude/skills/.
Create your skill by tool
Start with the Agent Skills pillar, then follow the guide for your agent:
Ready to build one? Use the Skill Builder to generate a working SKILL.md, or browse skills to see real examples.
Right file, right job
- Always-needed facts → AGENTS.md or CLAUDE.md
- Occasional procedures → a skill
- Long references → a skill's
references/ - Hard rules → hooks and permissions
- Mixed-agent team → AGENTS.md plus
.agents/skills/