AI & Agents · T143

How long should AGENTS.md be?

Published

AGENTS.md is a file of project instructions for an AI coding agent. Give it concrete commands, locations and constraints, then check whether they help on real tasks.

Explanation & code
The important bit
There is no universal ideal line count. These paths belong to our video project. Instructions guide behavior; they do not enforce access or execution rules.

Understand it. Then fix it.

Explain the next action

Replace a vague wish with a command and the directory where it should run. In this project, the video lint command runs ESLint and TypeScript checks.

cd video && npm run lint

Keep project-specific rules

Name shared code and generated output so the agent knows where to work. Adapt these paths to your repository.

Reuse shared scenes in video/src/episode/.
Do not edit generated files in site/dist/.

Link longer guides with a reading trigger

A path is more useful when it says when the agent should read it. Keep the detailed deployment procedure in its own guide.

Before website deployment, read site/README.md.

Test the instructions

Try representative tasks and inspect the actual checks, edited paths and use of shared code. Remove repeated or outdated advice. A prompt is not a sandbox.

Code blocks are teaching excerpts. Keep the surrounding error handling and application requirements.

Save the code excerpts ↓
Read the full transcript

How long should AGENTS dot M D be? Mine has chapters. It's a file of project instructions for AI coding agents. In Codex, keep it short and specific. There is no magic line count. Write good code leaves the next step unclear. Run npm run lint from the video folder gives a command and a place. Also say where shared code lives and which files need special care. Here, reuse shared scenes. Leave generated files alone. What about my twenty-page deployment guide? Keep it separate. Tell the agent when to read it, and give the path. Here, read the website guide before deploying. Then try real tasks. Check whether the agent follows the rules. Keep useful instructions. Remove repeated or outdated ones. So I wrote a novel. Yes. The bug is still the main character.

Go to the source

Next episode ↓Back to all episodes