Skip to main content

AI coding · Workflow

Rules File

Also called: Project rules, CLAUDE.md, AGENTS.md, .cursor/rules

Long-term agreements that live in your project and are given to the AI automatically in every conversation, like the tech stack, code style, and things not to do.

In detail

A rules file is like team guidelines pinned up at your desk. Every new colleague (every new conversation) sees them first, so you don't have to repeat yourself. Common forms are Cursor's .cursor/rules folder, the CLAUDE.md that Claude Code reads, and AGENTS.md, which many tools recognize. They usually go in the project root.

Good things to put in: the framework and component library, the package manager, folder conventions, naming style, "don't" items like "don't modify this file" or "don't add a new UI library," and the check commands to run after changes.

How it differs from a Prompt: a prompt covers this one task; a rules file covers long-term agreements for the whole project. Keep it short and specific, since a long one eats into the context window. When you notice the AI making the same mistake again and again, write the correction into the rules file.

Developer info
Term ID
ai-rules-file
DOM selectors
No DOM cues. This concept isn't detected directly on a page.
Priority
1 · when several match at the same level, the higher priority wins
Version
v1 · updated Sep 29, 2026