NeuralOS
GuideIntermediate

One file to govern all your agents · master AGENTS.md

There comes a day when your project has rules — how it's started, what command tests it, what NOT to touch, how commits are written — and more than one artificial brain passes through it: you build with one, review with another, and tomorrow you switch models to burn fewer credits. The problem is that this knowledge lives in your head, and every new agent starts from zero: you explain everything, close the session, and a week later you repeat it all over again (or repeat it to a different AI). AGENTS.md kills that toll. It's an open standard — a \"README for agents\" — read today by more than 25 tools (OpenAI Codex, Cursor, GitHub Copilot, Gemini CLI, Aider, Zed, Windsurf, Devin, Claude Code…) and used by more than 60,000 projects. A plain Markdown file, no weird config, in your project's root: you write your rules ONCE and every agent obeys them, today and tomorrow. Here you'll understand why you need it, what goes inside, the AGENTS.md vs CLAUDE.md nuance without duplicating anything, and the prompt that generates it perfectly by actually looking at your code. Zero fluff.

Jul 19, 202613 min
Who is this for?
For anyone already building with AI who uses more than one agent — or plans to — and is tired of repeating the same rules every session. If you've ever explained to the AI how your project is tested, what NOT to touch, and how to write a commit… and a week later had to explain it all over again (or to a different AI), this is your cure. It's the natural sequel to [Claude in VS Code](/recursos/claude-en-vscode-ramas-paralelas): there you put several AIs to work; here you give them one single law that they all obey.

The exact moment you need it

The need shows up the day your project has rules and more than one artificial brain passes through it. Maybe you use Claude Code to build, another tool to review, and every so often you open Cursor or Copilot for something one-off. Or maybe tomorrow you switch agents to save credits. In every one of those cases there's knowledge that doesn't live in the code: how the environment is started, what command runs the tests, which folders are sacred and off-limits, how you want the save messages written. Today that knowledge lives in your head — and every new agent starts from zero, knowing none of it.

Picture it like this · the job handbook
When a new employee joins a serious company, you don't explain everything out loud and pray they remember. You give them the job handbook: this is how you clock in, the coffee is over there, don't touch this, this is how things are done. AGENTS.md is exactly that, but for the AIs working on your project. A file at the door that any agent reads before touching anything — and every one of them, whatever the brand, walks in knowing the same things.

The pain it's born from · context that evaporates

The pain is silent and it's paid in installments. Today's session with your AI knows exactly how your project works because you spent hours explaining it. But that knowledge isn't saved anywhere: when you close the conversation, it evaporates. Tomorrow you open a new session — or switch models to spend less — and you're back at square one, repeating "remember the tests run with this command", "don't touch the payments folder", "commits go in this format".

Why does this happen? Because every agent starts out blind: it only sees your code, not your rules or your habits. And since each tool used to store its instructions its own way — Claude in one file, Cursor in another, Copilot in another — you had to keep the same knowledge written three or four times. A mess that desyncs on its own: you change a rule in one file and forget it in the rest.

What happens if you DON'T do it · an accident, not an apocalypse
Without this file nothing collapses — you just go slower and with more friction. The AI runs the tests with the wrong command and reports fake errors. It touches a file you thought was untouchable because nobody told it not to. It writes commits any old way and your history turns into a mess. None of those things is a catastrophe; they're frictions that pile up. Multiply them by every new session and every different agent, and the toll is huge. AGENTS.md turns all that volatile knowledge into something that's written once and obeyed by everyone.

What is AGENTS.md? (in plain terms)

AGENTS.md is a README for agents. Just as the good old README tells a human what your project is about, AGENTS.md tells any coding AI how to behave inside it. It's a plain-text (Markdown) file you drop in the root of your project, and that's it. No weird config, no code, no ceremony.

What makes it powerful isn't the format — it's that it became an open standard read today by more than 25 different tools: OpenAI Codex, Cursor, GitHub Copilot, Gemini CLI, Google Jules, Aider, Zed, Windsurf, Devin, JetBrains Junie, Warp, goose and more. Over 60,000 open source projects already use it. You write your rules ONCE, and they work with the AI you use today and the one you use tomorrow. You stop being married to a single tool.

Who backs it · not some stray invention
AGENTS.md isn't one company's whim. It came out of a collaboration between OpenAI (Codex), Google (Jules), Cursor, Amp and Factory, and today it's stewarded by the Agentic AI Foundation, under the Linux Foundation umbrella — the same foundation that governs Linux. In other words: it's a neutral, community standard, designed so that no single agent owns your rules. That's exactly what you want for something as important as your project's handbook.
agentsmd/agents.md
REPO

The AGENTS.md open standard — the "README for agents" read today by 25+ AI coding tools. Guide, examples and the full spec. Stewarded by the Agentic AI Foundation (Linux Foundation). ~23k★.

TypeScriptMITView on GitHub

The real anatomy · what's inside

Here's the best news: there's no rigid format to learn. AGENTS.md is plain, ordinary Markdown — titles with #, lists with dashes, text. It doesn't need that technical header full of colons and braces (what programmers call YAML frontmatter): none of that is required. You write in sections named however you like, and the agent reads whatever you put there. Period.

That said, there are five blocks that nearly every good AGENTS.md includes — because they're exactly the knowledge that evaporates between sessions. Think of them as the five drawers of the job handbook:

The 5 drawers of a good AGENTS.md
Set up the environment — how the project is started from scratch. What to install, what command spins everything up. So the AI doesn't guess.
How it's tested — the exact command for the tests and for the type/error check. That way the AI verifies its own work before declaring victory (instead of reporting fake errors).
Style rules — how you want the code to look and the language it's written in. Quotes, indentation, names. The stuff that would make you frown in a review.
Commit and PR convention — how a save message is written and how a change is proposed. So your history doesn't turn into a Frankenstein.
The limits · what NOT to touch — the most important drawer. The sacred folders and files (payments, config, secrets) that no agent should modify without permission. Your no-touch surfaces.
The monorepo · one general law and local laws
If your project is large and has several parts (one folder for the web, another for the server…), you can put an AGENTS.md in each folder. Agents automatically read the one closest to the file they're touching. It's like a national constitution (the root AGENTS.md) plus each city's ordinances (the ones in each subfolder): the local rule outranks the general one on its own turf. You don't have to do anything special — just put the file where it belongs.

The habit · write it once, keep it alive

This resource isn't one of those you apply every day — it's one you do well once and touch up now and then. The consistency here isn't in the frequency, but in two specific moments where you can't forget about it:

The two moments you touch your AGENTS.md
When you start a project (or when you read this, if you already have one running): sit down for 15 minutes and write the file. It's the most profitable investment of your week.
When a rule changes — you discover there's a new command to run, you decide a certain folder is now off-limits, you change your commit format. That's the moment to update the file, not your memory. If the rule isn't in AGENTS.md, for the AI it doesn't exist.
The dead-file trap
The only possible failure with AGENTS.md is letting it age. A file that says "tests run with such-and-such command" when that command already changed is worse than having no file at all: you're sending the AI off a cliff with an old map. The rule: every time you explain something new to your agent in chat and you notice "I'm going to need this again", that's the signal it belongs in AGENTS.md. If you say it twice, write it once.

The nuance almost nobody explains · AGENTS.md vs CLAUDE.md vs .cursorrules

This is where people get tangled up, so let's be clear. Before the standard existed, every tool invented its own rules file: Claude Code reads a CLAUDE.md, Cursor read a .cursorrules, and so on. The obvious problem: if you used three tools, you maintained three files with the same knowledge, desyncing on their own. AGENTS.md was born precisely to end that mess: a single source of truth that all of them read.

The golden rule to avoid duplication
The elegant trick is this, and it's the one we recommend: AGENTS.md as the single source of truth. If your main tool has its own file (like Claude Code with CLAUDE.md), don't copy the rules twice — make that file point to AGENTS.md with an import line. That way you write the rules ONCE in AGENTS.md, and CLAUDE.md just says "read that." Nothing gets duplicated, nothing desyncs.
markdown
# CLAUDE.md

# Project rules live in AGENTS.md (single source of truth).
# Claude Code loads them with this import line:

@AGENTS.md

# Below, only the Claude Code-specific stuff that does NOT apply
# to the other agents (if there's anything at all).

When to use which? Easy: AGENTS.md for everything you want any agent to obey (95% of your rules). A tool's own file (CLAUDE.md, .cursorrules) only for what's exclusive to that tool — a command only it understands, a setting only it can use. When in doubt, it goes in AGENTS.md. The mental rule: write for everyone by default; write for just one by exception.

Point & counterpoint · what if the spec already says what to build?

If you come from the idea of writing a specification before building (the what you want built), AGENTS.md is the other half of the pair — and they don't overlap, they complement each other. The spec governs WHAT gets built: the feature, the goal, the result. AGENTS.md governs HOW any agent behaves while building it: with which commands, what rules, what not to touch. One is the blueprint of the building; the other, the site's safety rules. You need both.

Picture it like this · the blueprint and the site rules
The blueprint (the spec) says what gets built: three floors, windows here, staircase there. The site rules (AGENTS.md) say how work is done on site: hard hats mandatory, this zone off-limits, this is how each delivery is signed off. You can have the best blueprint in the world, but if every worker does as they please, the site is chaos. And you can have the best rulebook, but with no blueprint you don't know what to build. AGENTS.md is your site rulebook — and it applies to every worker, no matter which crew they came from.

The master prompt · generate your perfect AGENTS.md

Here's the shortcut. You don't have to write the file by hand or think through every section: you give this prompt to your coding agent inside your project, and it drafts it for you by looking at how your code is actually built. You just review and adjust. Copy it as-is, fill the brackets with what you know, and let it work:

Paste it to your agent · create your project's AGENTS.mdtexto
I want to create an AGENTS.md file in the root of my project: the "README for agents" from the open standard (agents.md) that AI coding tools read. It's plain Markdown, WITHOUT a YAML header. Guide me in simple language, assuming I'm not a programmer.

First, EXPLORE my project for real (look at the folder structure, the package.json or equivalent, and how it's organized) so you DON'T make anything up. Then draft an AGENTS.md with these sections, in clean Markdown:

1. Project overview — 2 or 3 sentences on what it is and what technologies it uses (deduce it from the code).
2. Set up the environment — the real commands to install and start the project from scratch.
3. How it's tested — the exact command for the tests and for the error/type check, so any agent verifies its work before calling it good.
4. Style rules — the code's language and the conventions you detect (quotes, names, formatting).
5. Commits and PRs — this is my commit message format: [describe it, or tell me if I don't have one and propose a good one].
6. Limits · what NOT to touch — mark these sacred folders/files as UNTOUCHABLE without explicit permission: [list the sensitive stuff here: payments, secrets, config, migrations… whatever you have]. Make it clear that an agent must STOP and ask before modifying them.

Rules for drafting it:
- Only state things you can verify by looking at my code. If you don't know something, put a [TO CONFIRM] marker instead of inventing it.
- Keep it concise and actionable, not a novel. An agent reads the whole thing before working.
- If my main tool already has its own rules file (for example CLAUDE.md), do NOT duplicate the content: make that file import AGENTS.md with a single line, and leave AGENTS.md as the single source of truth.

When you're done, show me the whole file and explain in one sentence what you put in each section, so I can review it.
Don't learn anything · you just review
Notice the detail: the prompt orders the AI to explore your code before writing and to put [TO CONFIRM] when it's unsure — no fluff, no invented rules. Your job comes down to reading the draft and correcting whatever doesn't match how you work. From expert to reviewer: exactly the role that suits you.

The easiest path · by chat vs. by hand

As in the whole series, there are two ways to do this and neither forces you to touch the terminal if you don't want to:

Your two paths
By chat (recommended): you paste the master prompt above to your agent, inside your project. It explores, drafts and shows you the file. You review and approve. Zero commands.
By hand (if you like control): you create a file named AGENTS.md in your project's root folder, and write the five sections yourself by copying the template below. That works too — it's just text.

If you go the manual route, here's the minimal template, ready to copy and fill in. Change it to your taste: remember there's no mandatory format.

markdown
# AGENTS.md

## Project overview
[What it is and what it's built with. 2-3 sentences.]

## Set up the environment
[Commands to install and start from scratch.]

## How it's tested
- Tests: [exact command]
- Error/type check: [exact command]
> Run this and get it green before calling a change done.

## Style rules
[Code language, naming/formatting conventions.]

## Commits and pull requests
[Your commit message format. Example of a good one.]

## Limits · do NOT touch without permission
- [Sacred folder or file 1 — why it's sensitive]
- [Sacred folder or file 2]
> For any of these: STOP and ask before modifying.
Store it right · it goes to version control
One last detail that makes the difference: AGENTS.md is stored with your project on GitHub, like any other file. That way it travels with the code, your whole team sees it (humans and agents), and its change history is kept. If you don't have your project saved on GitHub yet, start there — it's the foundation for everything else.

The golden routine · the summary you take away

The habit, in five lines
One file, all agents: write your rules once in AGENTS.md, in the root. Stop repeating yourself every session.
The five drawers: environment, tests, style, commits, and above all the limits of what NOT to touch.
Single source: if a tool has its own file (CLAUDE.md), have it import AGENTS.md — never duplicate rules.
Keep it alive: when a rule changes, update the file, not your memory. An old AGENTS.md lies.
Store it on GitHub: it travels with your code, everyone sees it, its history is kept.
In NeuralOS · the context that doesn't evaporate
This whole resource attacks a single underlying pain: context lost between sessions and between models. AGENTS.md solves it for your project's code. In NeuralOS, that same obsession with not losing the thread is woven into the interface: every conversation you build with is saved in your library, with its files and its history, ready to reopen right where you left off — even if you switch models along the way. It's the same idea as AGENTS.md, applied to your work with AI: what you built and learned doesn't vanish when you close the window. That continuity is, today, the vision already tangible in the product.
Store everything on GitHub · the foundation for all of this
Your AGENTS.md lives inside your project on GitHub. If you're not saving your code there yet, start with this guide.
Claude in VS Code · several AIs in parallel
When you put several sessions (or several agents) to work at once, a single AGENTS.md governs them all. The perfect combo.
#agents-md#claude-code#open-standard#ai-context#productivity
Ready to build?

Start building in
under 3 minutes

Join 4,200+ builders. No credit card. Build your first app with AI in minutes.