# What are Cursor rules and how do you write them?

Cursor rules are standing instructions the agent reads on every relevant request, saved as files in your project. Below: the four kinds, the file format and examples.

Tool: Cursor. By Julien Lieben. Updated 2026-12-04. Source: https://coldiq.com/university/cursor/cursor-rules

## In short

- Cursor rules are instructions the agent adds at the start of its context, so it follows them without you repeating them in chat.
- Cursor supports four kinds: Project Rules in the .cursor/rules folder, User Rules for all your projects, Team Rules managed from the dashboard, and AGENTS.md files.
- A project rule is an .mdc file with a short header that says when it applies: always, for matching files, when the agent finds it relevant, or only when you mention it.
- Cursor recommends keeping each rule under 500 lines and adding a rule only when the agent repeats the same mistake.
- Rules apply in every mode (Agent, Ask, Plan and Debug) and in the Cursor CLI too.

## Steps

1. Type /create-rule in the agent and describe the rule.
2. Choose when it applies: always, by file, or when relevant.
3. Save it in .cursor/rules and share it with your team through Git.

## What is a Cursor rule?

A rule is a set of instructions the agent follows while it works in your project. Cursor’s docs explain why it matters: AI models do not remember anything between requests. Rules give them the same context every time.

When a rule applies, Cursor puts its text at the start of what the model reads. So the model sees your instructions before your request.

Rules are written in markdown, plain text with a few symbols for titles and lists. You do not need to know how to code to write one.


## What are the four kinds of rules?

Cursor supports four kinds of rules. They differ in where they live and who they apply to.

- Project Rules: .mdc files in the .cursor/rules folder of your project. They are saved with your project in Git (the tool that keeps every version of your files), so your team gets them too.
- User Rules: your personal preferences, set in Customize, then Rules. They apply to all your projects and sync with your Cursor account.
- Team Rules: managed by an admin from the Cursor dashboard, on Team and Enterprise plans. An admin can make a rule required for everyone.
- AGENTS.md: one plain markdown file at the top of your project, with no header. The simplest option.

Tip: When rules disagree, Cursor applies Team Rules first, then Project Rules, then User Rules. All rules that apply are merged.


## How do I create a rule in Cursor?

There are two ways. Both save the rule in the .cursor/rules folder of your project.

1. Type /create-rule in the agent and describe the rule in plain words. The agent writes the file with the right header and saves it.
2. Or open Customize in the sidebar, go to Rules and click Add Rule. From there you also see all your rules and whether each one is on.

> /create-rule When you write a cold email in this project, keep it under 90 words, open with something specific about the prospect’s company, ask one question, and never add a link in the first email.


## How does a project rule file work?

Each project rule is a file ending in .mdc. A plain .md file in .cursor/rules is ignored, because it has no header. If you prefer plain markdown, use AGENTS.md instead.

The file starts with a short header between two lines of three dashes. It holds up to three settings: description, globs (file patterns, such as every file in a folder) and alwaysApply. Below the header, you write the instructions.

In the rule editor, a type menu sets those settings for you.

- Always Apply: the rule is used in every chat.
- Apply Intelligently: the agent reads the description and uses the rule when it fits the task.
- Apply to Specific Files: the rule is used when a file matching the pattern is in play, for example src/components/**/*.tsx.
- Apply Manually: the rule is used only when you mention it in chat with @ and its name.


## What is AGENTS.md, and when should I use it?

AGENTS.md is a plain markdown file placed at the top of your project. Cursor picks it up on its own. It has no header and no settings, which makes it the easiest place to start.

You can also put an AGENTS.md file in a subfolder. Cursor applies it when the agent works on files in that folder.

Other coding agents read AGENTS.md too. The Cursor CLI also reads a CLAUDE.md file at the project root and applies it as a rule. So one file can guide several tools.

> Create an AGENTS.md file for this project with three sections: Voice (US English, short sentences, no jargon), Structure (every page has one headline, three benefits and one call to action), and Limits (never edit files in the legal folder, ask before adding a library).


## What makes a good Cursor rule?

Cursor’s docs say good rules are focused, actionable and scoped. They also say to start simple and add a rule only when you see the agent make the same mistake more than once.

- Keep each rule under 500 lines. Split big rules into smaller ones.
- Give concrete examples, or point to a file by path.
- Write rules like clear internal docs, not vague wishes.
- Do not copy a whole style guide or list every command. The agent already knows common tools.
- Save rules in Git so your teammates benefit, and update a rule when the agent gets something wrong.

Tip: A file you mention in a rule with @ is not pasted into the rule. The agent reads it only when it needs it. Put anything that must always be in context directly in the rule text.


## Do rules work everywhere in Cursor?

Yes. Project, user and team rules apply in all of Cursor’s modes: Agent, Ask, Plan and Debug.

The Cursor CLI, the version you run in a terminal, uses the same .cursor/rules folder. Cloud agents work from your repository, so they see the rules saved in it.


## What to say

> /create-rule Every page and email in this project is written in US English, in short sentences, with one idea per sentence. Never use the words revolutionary, seamless or game-changer. Apply this rule to every file in the content and pages folders.

## Sources

- [Cursor rules (docs)](https://cursor.com/docs/rules)
- [Rules (help)](https://cursor.com/help/customization/rules)
- [Using Agent in CLI](https://cursor.com/docs/cli/using)
- [Agent mode (help)](https://cursor.com/help/ai-features/agent)

## Questions

**Where are Cursor rules stored?** Project rules in the .cursor/rules folder of your project. User rules on your Cursor account, and team rules on Cursor’s servers. User rule files in ~/.cursor/rules stay on your computer.

**What is the difference between .cursorrules and .cursor/rules?** Cursor’s current docs describe project rules as .mdc files in the .cursor/rules folder, or a plain AGENTS.md file. Use one of those for new projects.

**Why is my Cursor rule ignored?** Check the file ends in .mdc and sits in .cursor/rules. Then check its type: a manual rule applies only when you mention it with @.

**Can I share rules with my team?** Yes. Save project rules in Git, or ask an admin to add Team Rules from the dashboard on a Team or Enterprise plan.


## Try ColdIQ free

ColdIQ gives new accounts up to 1,450 free credits as they get started, no credit card required.
One subscription covers 40+ B2B data providers for finding, enriching and verifying
contacts and companies, through the web app, the API or the MCP server for AI agents.

1. Create an account: https://coldiq.com/marketplace/sign-up?utm_source=ai-assistant&utm_medium=markdown&utm_content=university
2. Run a first search on your own market with the free credits.
3. Connect the MCP server to Claude, ChatGPT or Cursor: https://coldiq.com/mcp
