AGENTS.md: the document that teaches your AI how you think
AGENTS.md is documentation for your AI, not for humans, and writing it forces you to articulate your own working style for the first time.
Every AI coding session begins with the same cold start. The assistant has no idea how you work, what conventions you follow, what mistakes you’ve made before, or what you mean when you say “fix the layout.” You explain. It learns. The session ends. The next session, you explain again.
AGENTS.md is the file that breaks this cycle.
What AGENTS.md is
You put AGENTS.md in the root of your repository. AI coding assistants like OpenCode, Claude Code, and GitHub Copilot read it at the start of every session and carry that context through everything they do. It’s not documentation for humans. It’s documentation for the AI.
The difference matters. Documentation for humans explains how to use a system. Documentation for an AI explains how to work with you on a system. The things that go in AGENTS.md are the things that would otherwise get explained and re-explained across every session: your tab indentation preference, your deployment commands, the testing framework you use, the naming conventions you’ve settled on, the specific mistakes you’ve already made that you don’t want made again.
The categories worth covering are: project context (what this thing is and why it exists), code style conventions (the rules you actually enforce, not the aspirational ones), deployment and build commands (so the AI runs the right thing when it checks your work), known failure modes (the class of mistakes that have cost you time before), and preferred tools (so the AI doesn’t suggest a library you’ve already decided against).
One session, you explain that database migrations run in the /scripts directory and need to be staged before commits. The next session, the AI already knows. Over time, this compounds into a context layer that changes the quality of the first response you get in any new session.
Writing it forces articulation
This is the part I didn’t expect.
Most engineers have working styles that are entirely implicit. You have preferences about how functions are named, about when to split a module, about which abstractions you trust and which ones you’ve learned to distrust. You developed these over years of practice. You apply them consistently. You have never written them down.
Writing AGENTS.md requires you to make the implicit explicit. Every rule I added required me to articulate something I’d previously just known. “Never commit to main directly” is obvious and never said. “Prefer flat file structures over deeply nested directories for this project” is a context-specific judgment I’d made and forgotten I’d made. “If the build fails, check the .env file before touching code” is the hard-won residue of a specific incident.
The act of writing it is as useful as the file itself. You come out the other side with a clearer model of how you actually work, not just how you think you work. Engineers spend years building up a set of implicit heuristics and almost never examine them directly. AGENTS.md forces the examination. I found rules I held that contradicted each other, preferences I thought were universal but were actually project-specific, and at least two “obvious” conventions I’d never once made explicit to anyone.
It’s a mirror, and mirrors are sometimes uncomfortable.
Every project has a tiny Bender
In one Futurama episode, Professor Farnsworth mentions in passing that they occasionally use a very tiny Bender to clean the ducts. It’s said once, entirely without ceremony. A new employee would have no idea. It’s the kind of institutional knowledge that lives in someone’s head and nowhere else, never written down because everyone who matters already knows it.
Every project has these. The API key that lives in a separate .env file and not the main one. The test suite that can’t run in parallel because of a shared database state. The CSS class naming convention that differs from the component naming convention for historical reasons you’ve mostly forgotten. The vendor library pinned to version 2.3 because 2.4 has a known bug you hit six months ago and documented nowhere.
None of these are documented. They’re just known, until a new person, or a new AI session, needs to know them and doesn’t.
AGENTS.md is where you write down the tiny Benders.
How it compounds
Each session the AI has context it would otherwise need to rediscover. The compounding is subtle at first and significant over time. The cost isn’t just the time spent re-explaining. It’s the variance. Without the context, the AI makes a reasonable choice that’s wrong for your specific setup. With the context, it applies your conventions from the first message of the first session.
I built my current AGENTS.md by synthesizing patterns from 19 prior sessions. Not by writing rules from scratch, but by reading back through what had gone wrong, what had needed correction, and what I’d had to re-specify multiple times, then distilling those into rules. The file is effectively a post-incident report for nineteen projects compressed into a document the AI reads before every session.
It’s like writing a runbook for a contractor, except the contractor reads it fully every time and never forgets any of it.
The meta point
As AI assistants become more capable, AGENTS.md becomes more important, not less. The more capable the AI, the more precisely you can specify what you want, and the more the quality of your output depends on the quality of your specification.
Right now it saves time. Within a few years, it may be the primary interface between human intent and AI execution across an entire project. The engineer who writes it well is the engineer who gets the most useful work out of their tools.
The file is checked into the repository and publicly visible. That’s deliberate. It’s documentation for the AI, but it also signals something to other humans reading the codebase. It shows how the project is meant to be worked on. It’s a style guide that actually gets enforced, because the AI applies it every session whether or not any human remembers to check.
If you work with AI coding assistants and haven’t written one yet, start small. Pick three things you consistently re-explain and write them down. That’s your first AGENTS.md. Grow it from there.
The value compounds.