AGENTS.md or CLAUDE.md. The first file found is loaded and prepended to the system prompt.
How It Works
When an agent runs for the first time, it:- Starts from the current working directory
- Walks up the directory tree toward the filesystem root
- Looks for
AGENTS.mdorCLAUDE.mdat each level - Loads the first file found and prepends its content to the system prompt
Disabling Instructions
This behavior is enabled by default. Setinstructions: false to disable it:
Use Cases
- Project conventions — coding style, test requirements, deployment rules
- Safety guardrails — directories the agent should never modify, commands to avoid
- Context — project architecture notes, key dependencies, known issues