An AGENTS.md file (or similar rules doc) tells Claude Code how your repository expects to be modified: style, forbidden paths, test commands, and review etiquette. Good rules reduce bad diffs more than clever one-off prompts.

What to include

Keep rules actionable

Vague "write clean code" lines waste tokens. Prefer "Run npm run lint before finishing" or "Do not edit package-lock.json manually."

Team workflow

Store AGENTS.md at the repo root. Reference it in onboarding. Update when architecture shifts — stale rules confuse agents.

Examples

## Testing
Always run `npm test -- --watch=false` after UI changes.

## Scope
Do not modify files under /legacy unless the ticket explicitly says so.

Measure impact

Track review comments before and after adding rules. Fewer style nits and smaller diffs mean the file is working.

Install the agent from our download page, add AGENTS.md, then retry the same ticket — compare diffs.

Ready to install Claude Code? Start on our download page, then use the official installer.

Open download page Official download