Rules file
A plain text file in your project that gives the coding agent standing instructions it reads at the start of every session.
What it is
A rules file is a short text file, usually named AGENTS.md or CLAUDE.md, that lives in your project. The agent loads it at the start of every conversation, before it reads your request. Think of it as the onboarding note you would give a new contractor on day one.
Put in the things you would otherwise repeat: what the app does, which package manager to use, how to start it locally, what to never touch, how you like things named. Keep it short. A long file crowds out the actual task and the agent starts ignoring parts of it.
Different tools look for different filenames, and the format is plain Markdown, so you can read and edit it yourself. Many agents can also write a first draft for you.
A rules file is not a prompt (which is what you ask for right now) and not a spec (which describes a feature). It describes how to work in this project, every time.
How to ask for it
“Every time I start a new chat I have to remind it to use our brand colors and not install random packages. Can you make it remember?”
“Create a rules file (AGENTS.md) at the project root. Include: use pnpm, not npm; our brand colors are in the design tokens file; ask before adding any new dependency; run the tests before saying a task is done. Keep it under 30 lines.”
'Make it remember' could mean memory features, a longer prompt or a database, while 'rules file' names the one file the agent reliably reads each session and the prompt sets its contents and size.
You've seen this in
- GAn AGENTS.md file at the top of an open-source repository on GitHub
- CA CLAUDE.md file in a Claude Code project
- CThe Rules section in Cursor's project settings