CLAUDE.md vs AGENTS.md vs Skills: Where Rules Belong

AI Tutor Code··13 min read

Last updated: November 2026

If Claude should know something in every session on a project, it goes in that project's CLAUDE.md. If other AI tools work in the same repository, write AGENTS.md instead and let Claude Code read it, directly or through a one-line import. If it is a procedure you only need for one kind of task, make it a skill, because a skill's full instructions load only when the task calls for them. Personal preferences belong in your user-level file, a CLAUDE.local.md or Claude's own memory, never in the file your team shares, and instructions that only apply to certain files belong in a path-scoped rule. Here is how to tell which situation you are in, and the one case where none of the five is the right answer.

How I tested this, and what I have not

My team and I teach these files every week, and most of what follows comes from watching working professionals put an instruction in the wrong place and live with it for a lesson or two. My own setup for this site uses most of these mechanisms at once: a project CLAUDE.md, a personal one in my home folder, project skills, and the notes Claude Code keeps for itself. I have put something in the wrong one more than once.

What I have not done: run a team repository where several people point different agents at one AGENTS.md for months, so that section rests on the documentation more than on long experience. I have not tested managed policy files, which belong to IT departments. And Claude Code is what my team and I teach, so I am more fluent in its files than anyone else's. Weigh that.

Every mechanism below was checked against Anthropic's documentation in October 2026: the memory page for CLAUDE.md, AGENTS.md, rules and auto memory, the skills page, the extension overview and the settings page, plus the AGENTS.md project site. Version numbers move fast here, and one changed an answer I gave in an earlier post.

If it is a fact Claude needs in every session

Then it goes in the project CLAUDE.md, and the test for "every session" is stricter than most people apply.

A CLAUDE.md file is read at the start of every session and stays in context for every request after that. Anthropic's guidance is to keep it to facts Claude should hold all the time and to target under 200 lines per file, because longer files consume more context and reduce adherence. The project file sits at the root (or inside .claude/) and is committed, so everyone who clones the project gets it. If you have none yet, /init generates a starting file from your project; treat it as a draft.

Two mechanical details matter here. Files are added together, not swapped: Claude Code loads the CLAUDE.md in the folder you start in, every folder above it and your personal file, and concatenates them, so nothing in a project file switches off something in your personal one. And you can split a long file with @path imports, up to four hops deep, but the documentation is blunt that imports help organisation without reducing cost, because imported files load at launch too.

So the question for every line is not "is this true about the project" but "would Claude go wrong on an ordinary task without it". Which folder holds finished drafts: yes. A twelve-step procedure for the quarterly review: no, that is a task. The full argument for what earns a line is in what goes in a CLAUDE.md file.

That test is also the honest answer to "is a CLAUDE.md even worth having?" A 2026 study of coding agents found that context files such as AGENTS.md did not generally improve task success and raised the cost of running the agent by over 20% on average. The agents followed the instructions well; the repository overviews just did not help. The authors still found the files useful for non-standard practices, which is exactly the kind of line that passes the test.

Verdict: project CLAUDE.md, because it is the file built to sit in every request, and your whole team gets it.

If the repository is shared with other AI tools

Then write AGENTS.md and let Claude Code read it, because this is the one situation where the answer has changed since I last wrote about it.

AGENTS.md is an open format for guiding coding agents: plain Markdown, no required fields, now stewarded by the Agentic AI Foundation under the Linux Foundation. Its site lists Codex, Cursor, Gemini CLI, GitHub Copilot's coding agent and many others as tools that read it. For Codex it plays the role CLAUDE.md plays for Claude: OpenAI's documentation says Codex reads AGENTS.md files before doing any work.

Earlier versions of Claude Code did not read AGENTS.md on their own, and the workaround was a CLAUDE.md whose first line imports it. My Codex and Claude Code comparison said exactly that when I wrote it in September, and I have since corrected it. From version 2.1.277, Claude Code reads AGENTS.md as your project instructions with no import and no setting, on one condition: there is no CLAUDE.md or CLAUDE.local.md in your working folder or any folder above it. If there is, by default Claude reads the CLAUDE.md files only.

That condition hides a trap. A CLAUDE.local.md counts, so if your team relies on AGENTS.md and you add a local file for your own notes, Claude quietly stops reading the shared file for you. There are two fixes: in /config, set Project instructions to the option that reads both files, or put an @AGENTS.md import at the top of a CLAUDE.md with anything Claude-specific underneath, which the documentation says never causes the file to be read twice. On Windows, prefer the import to a symlink, because Git can check a committed symlink out as a one-line text file.

If the other tool keeps its rules somewhere else, such as a Copilot instructions file or Cursor rules, /init reads those and folds the relevant parts into the CLAUDE.md it generates. That is a copy, not a link, so decide which file you will keep current. Procedures travel better: Claude Code skills follow the open Agent Skills standard, which Codex, Cursor, GitHub Copilot and Gemini CLI also support, so a skill is not tied to Claude the way CLAUDE.md is.

To confirm what loaded, run /memory and look for the AGENTS.md path. Versions are as of October 2026, so check claude --version on an older install.

Verdict: AGENTS.md as the single source, with a CLAUDE.md that imports it only when you need Claude-specific additions.

If it is a procedure for one kind of task

Then it is a skill, and this is the situation I see handled wrong most often, because the procedure usually starts life as a line in CLAUDE.md.

A freelance designer I teach had written a rule into her project's CLAUDE.md telling Claude to always re-read her brief and call her out whenever she drifted. For drafting, that was exactly right. Then she asked for a research step, and Claude dragged it back toward the brief, treating the research as "a step away from directly answering the brief". Her verdict: "it just creates bulk for me." Nothing was broken. An always-on rule did what always-on means, on a task it was never written for. The fix we agreed was to narrow the rule to drafting, or move it into a skill that loads when she is writing against the brief.

That is the core difference. At session start, Claude Code loads only each skill's name and description. The full body loads when you invoke it with /name or Claude judges that your request matches. Anthropic's own test for making one: you keep pasting the same instructions, checklist or procedure into chat, or a section of CLAUDE.md has grown into a procedure rather than a fact.

A skill is also not only text. When a student asked me whether a skill was "only text? And also maybe with some algorithm", I told her it was a text file. That was a simplification, and her instinct was closer. A skill is a folder with a SKILL.md at its centre, and the documentation says skills can bundle and run scripts in any language, which Claude executes rather than reads into context. A procedure that ends in "now turn these into a spreadsheet" can carry the script that does the turning.

Installing is not using, though. One student installed five design tools from a single short video. Two lessons later, when we asked Claude what it had actually applied, the design skills had not yet been used for any design work. A skill whose description does not match how you phrase requests sits there and never fires, and /skill-doctor flags the ones that have never been invoked. The full install and verify routine is in loading Claude Code skills before you build anything.

Verdict: a skill, because it costs one line of description until the task that needs it arrives.

If it is about you rather than the project

Then keep it out of the shared file, and choose between your personal CLAUDE.md, a local file and Claude's own memory.

The three reach different distances. Your user-level file at ~/.claude/CLAUDE.md applies to every project on your machine. A CLAUDE.local.md at the project root applies to you in that one project, kept out of version control. Auto memory, on by default, is Claude writing its own notes about your preferences and corrections. It stores them per project on your machine and loads the first 200 lines of an index file, MEMORY.md, at the start of every session.

The scope question is where people get hurt. A student of mine stopped using CLAUDE.md altogether after an instruction he wrote for one project started applying everywhere. His conclusion was that telling Claude what to do makes it worse. Mine was that the instruction sat at the wrong level. A rule about a project lives in that project, and only things genuinely true of you on every project, like the date format you want or never pushing anything without asking, earn a place in the user-level file. The same goes for skills. As I put it to him, the project where you are building an application "should never know how to make a good website", because that knowledge confuses it and wastes context.

One detail settles the memory question. When you ask Claude to remember something, the documentation says it saves it to auto memory, not to CLAUDE.md. Memory stays on that machine, so it never reaches a colleague's copy of the project. If you want the team to get an instruction, say "add this to CLAUDE.md" in those words, and run /memory now and then to read what Claude has kept.

Verdict: your user-level file for what is true of you everywhere, CLAUDE.local.md or memory for what is true of you here, and never the shared project file.

If it only applies to some of the files

Then use a rule in .claude/rules/ with a paths line, which is the least-known option of the five and often the right one.

A rule is a Markdown file in the project's .claude/rules/ folder. Without a path, it loads at launch with the same priority as .claude/CLAUDE.md, which mainly helps you split a long file into topics. With paths in its frontmatter, a short list of file patterns, it loads only when Claude reads, writes or edits a matching file. Formatting rules for your reports folder, conventions for one kind of data export, the style for one language in a mixed project: each applies hard to some files and not at all to the rest.

The distinction from a skill is worth stating precisely. A rule is scoped by which files Claude touches. A skill is scoped by what you asked for. "Whenever you edit anything in the proposals folder, use the client template" is a rule. "When I ask for a proposal, follow these nine steps" is a skill. Skills can take a paths line too, which limits when Claude loads them automatically, but that narrows a procedure rather than turning it into a standing rule.

A CLAUDE.md inside a subfolder is the coarser version: Claude Code loads it once Claude works with a file there, which suits a project with genuinely separate parts.

Verdict: a path-scoped rule, because it loads only when Claude touches the files it is about.

The five side by side

LoadsWritten byShared withBest for
Project CLAUDE.mdEvery session, in fullYou and your teamEveryone who clones the projectFacts every task needs
AGENTS.mdEvery session, when no CLAUDE.md is present or you set it to read bothYou and your teamEvery agent that reads the formatRepositories shared across AI tools
SkillDescription at start, full body when usedYou, or whoever published itWherever it is installedProcedures for one kind of task
Path-scoped ruleWhen Claude touches a matching fileYou and your teamMatching files in this projectInstructions for some files only
Auto memoryFirst 200 lines of its index, every sessionClaudeYou, this project, this machineYour corrections and preferences

Accurate as of October 2026. Now the case where none of the five is the answer. Anthropic describes all of them as context Claude reads and tries to follow, not configuration it enforces. If something must hold every time, such as never editing a particular file, that is a hook or a permission rule in your settings, which apply regardless of what Claude decides.

What I tell my students

Expect your first customisation to make things worse. The student who gave up on CLAUDE.md put the pattern better than I can: every time, his first improvements perform worse than Claude with no customisation at all, and only tuning gets him past where he started. "The first step is down," he said. I have felt the same with skills I wrote myself. The mistake is reading the dip as the verdict. Run the same task in a fresh session with and without the skill, which is the comparison Anthropic's skill-creator plugin is designed to run, and change one thing at a time.

Start small and scoped. The cleanest setup I saw this autumn belonged to a student who, before Claude wrote a line of her new site, asked it which skills the build needed and installed them for that project only: design critique, UX copy and several SEO skills. The site was live about half an hour after her first prompt, and none of those skills will follow her into the next project. What piling skills into your global setup costs instead is covered in Claude Code best practices that actually matter.

Read before you install. A skill is instructions a model with tool access will follow, and some carry scripts. Discussing whether a popular repository could be trusted, a student asked the question I now teach: "how difficult is it to falsify?" A fair worry: a study of GitHub data from 2019 to 2024 flagged about six million suspected fake stars, most of them promoting short-lived phishing malware repositories. So clone it, open it, and have Claude read it with you before anything installs: is there anything here that could do harm, what does it change outside this project folder, and how would Claude score it. Be especially wary of anything that writes into the .claude folder in your home directory, because that reaches every project on the machine.

Sorting a setup into these five homes is one of the first things we do in one-to-one Claude Code tutoring, because it fixes problems people had been blaming on the model.

Frequently Asked Questions

Does Claude Code read AGENTS.md?

Yes, from version 2.1.277, as long as there is no CLAUDE.md or CLAUDE.local.md in your working folder or above it. If there is, Claude reads only the CLAUDE.md files unless you change Project instructions in /config. An @AGENTS.md import at the top of a CLAUDE.md works too.

What is the difference between CLAUDE.md and SKILL.md?

Timing. CLAUDE.md loads in full at the start of every session. A SKILL.md sits in its own skill folder, and only its name and description load at the start, with the body arriving when the task calls for it. Facts go in the first, procedures in the second.

Is Claude's memory the same as CLAUDE.md?

No. You write CLAUDE.md and Claude writes auto memory. Memory stays on your machine for that project, while a project CLAUDE.md is committed and shared. Asking Claude to "remember" something sends it to memory, so say "add this to CLAUDE.md" when the team needs it.

Does Claude always use CLAUDE.md?

It reads it every session, but it does not always follow it. The project file loads at launch and is re-read from disk after /compact, yet it arrives as context, not enforced configuration. That also settles what happens when CLAUDE.md and a skill disagree: neither reliably wins, and the documentation says Claude may pick one arbitrarily. Remove the conflict instead (/doctor prompt-audit looks for contradictions across your instruction files), and if something must hold every time, make it a hook. The other fixes are in why Claude ignores a CLAUDE.md.

Working out where each of your instructions belongs takes about fifteen minutes once someone has seen your actual files, and it beats another week of correcting the same mistake. If you want a second pair of eyes on yours, bring them to a free Discovery Call.

Written by Michael Murr for AI Tutor Code: private 1-on-1 online tutoring for professionals learning Python, AI tools, Data Science, ML, and LLM engineering. 200+ students taught, 3,000+ hours delivered.

Related articles

Keep reading on related topics.

Enjoyed this article?

You can master this and more with a dedicated 1-on-1 tutor.

Book a Free Discovery Call