Instruction files have emerged as a standard way to instruct agents how to behave in a new folder or codebase. It is a markdown file that is located in a well-known location and is read automatically by agent harnesses and passed into the context automatically.
Example instruction files for different agent harnesses:
- Claude:
./CLAUDE.md - GitHub Copilot:
.github/copilot-instructions.md - Generic:
./AGENTS.md
AGENTS.md has emerged as a standard among most agent harnesses, used in over 60k+ projects.
It serves as a type of long term memory for the LLM which is typically stateless. In the instruction file you can instruct the model on your technology stack, coding practices, testing practices, etc. Instead of putting all rules to follow and explaining the context of your codebase into every prompt, these details can be stored in the AGENTS.md and passed in automatically with every inference call.
Pro tip: Don't consider your AGENTS.md static. Whenever your agent tooling does something wrong, reflect on whether you can “teach” it via the instruction file.
Example
# General
- Prefer simple solutions
- Ask if unsure
- Keep answers concise
- Break solutions into small incremental steps
- Do one step at a time
# Tech stack
- .NET 8
- C# / F#
- Entity Framework Core
- xUnit for testing
# Build and test
- Run build and test before and after every change
- Build: `dotnet build`
- Test: `dotnet test`
- Clean: `dotnet clean`
# Structure
This is a .NET web application with the following structure:
- `src/` - Main source code
- `tests/` - Test projects
- `docs/` - Documentation