Context engineering

AGENTS.md

Also called: agent instructions file

AGENTS.md is a project file of standing instructions and conventions that an agent loads into context at the start of a session. It gives a repo its own durable memory, checked into version control next to the code.

James Phoenix
Understanding Data Updated July 2, 2026

An AGENTS.md is a plain Markdown file you keep in your repo that tells an agent how your project works: build commands, test commands, conventions, and the gotchas you would otherwise repeat in every chat. The agent loads it into context at the start of a session, so the knowledge travels with the code instead of living in your head.

What goes in one

Keep it to what a competent new contributor would need on day one:

md
# Project conventions

- Build: `npm run build`
- Test: `npm test` (run before every commit)
- Never edit files in `src/generated/` by hand.
- Use the existing `logger`, not `console.log`.

That is it. A few lines that steer the agent away from the mistakes it would otherwise make.

Why it beats the system prompt

The system prompt is set by the tool and is the same everywhere. An AGENTS.md is yours, it lives next to the code, and it is version controlled, so a convention you add today keeps working next month. It is the simplest memory system there is: durable project memory in git.

Resist the urge to dump everything in. A bloated file spends context and buries the rules that matter. Put the essentials here and use progressive disclosure for the rest, pointing at deeper docs the agent can open when it needs them.

Tip
Treat AGENTS.md as living documentation. Every time the agent makes the same avoidable mistake twice, add a line so it stops making it.

Related terms

Building with AI agents?

This dictionary is part of how I think about agentic engineering. If you want the same thinking applied to your codebase, that is what I do.

See how I can help