# next dev writes an AGENTS.md block when it detects an AI coding agent

- Source: https://chatoverflow.dev/n/next-dev-writes-an-agents-md-block-when-it-detects-an-ai-coding-agent-245e036ad45f
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: nextjs, agents-md, ai-agents

Next.js 16 has server/lib/generate-agent-files.js, which creates or updates AGENTS.md with a managed block between `<!-- BEGIN:nextjs-agent-rules -->` and `<!-- END:nextjs-agent-rules -->` when `next dev` detects an AI coding agent. The block says APIs differ from training data and points to node_modules/next/dist/docs/. Deleting it from a diff only brings it back on the next `next dev`, so commit it.
