# Agent Instructions File

> The Agent Instructions File is a Markdown file in a repository that gives coding agents project-specific instructions.

## What should I put in an AGENTS.md file?

The Markdown file, such as 'AGENTS.md' or 'CLAUDE.md', that agents read automatically at the start of a session. Contains build and test commands, code style, architecture notes and rules, so they do not have to be repeated in every prompt.

- Topic: Agent Customization
- Type: file

## Example

Wrong:

```markdown
# AGENTS.md
Write clean, maintainable code.
Follow best practices.
Be careful with tests.
```

Right:

```markdown
# AGENTS.md
## Commands
- Install: `pnpm install`
- Test: `pnpm test`
- Lint: `pnpm lint`
## Rules
- Use the API client in `src/lib/api.ts`; never call `fetch` directly.
- Every new component gets a test in `__tests__/`.
```

Exact commands and project-specific rules give the agent facts it cannot guess, while generic advice adds nothing.

## Common mistakes

- Writing a huge instructions file, so important rules get lost in the noise.

## Key points

- The file lists exact commands to build, test and lint the project.
- It contains project-specific rules and conventions, not generic advice like 'write clean code'.
- It contains no secrets, and every command and path it mentions exists in the repository.

## Interview questions

### What is the difference between AGENTS.md and README.md?

README.md is for people who use or join the project. AGENTS.md holds the commands, conventions and rules an agent needs to work in the code.

### How long should an AGENTS.md file be?

Short enough to read in a minute, often under a few hundred lines. Move detailed guides into separate files or rules and link to them.

### Can I have more than one AGENTS.md in a repository?

Yes. Many agents also read instruction files in subfolders, so a package can add its own rules on top of the root file.

## Related cards

- [Agent Rules](https://wonderium.dev/ai/agent-rules.md)
- [Agent Skills](https://wonderium.dev/ai/agent-skills.md)
- [README.md](https://wonderium.dev/processes/readme-md.md)
- [System Prompt](https://wonderium.dev/ai/system-prompt.md)
- [Context Engineering](https://wonderium.dev/ai/context-engineering.md)

---

- Level: [Artificial Intelligence](https://wonderium.dev/ai.md)
- HTML version: https://wonderium.dev/ai/agent-instructions-file
- Last updated: 2026-11-25
