To share Cursor rules with a team, commit them to the repository as project rules in .cursor/rules/ (or a plain AGENTS.md), and use Team Rules from the Cursor dashboard for rules that apply to every repository. Rules are instructions. For what the team has decided and learned, which changes week to week, add a shared ledger over MCP that every teammate's Cursor, and any other agent, reads before a change.
The four kinds of Cursor rules
From Cursor's rules docs, checked on 30 October 2026:
| Kind | Where | Shared with the team? |
|---|---|---|
| Project rules | .cursor/rules/*.mdc in the repo |
Yes, through git |
AGENTS.md |
The repo root and any subfolder | Yes, through git; Claude Code and Codex read it too |
| Team Rules | The Cursor dashboard (Team and Enterprise plans) | Yes, every repository; admins can enforce them |
| User Rules | Your Cursor settings | No, only you |
When rules disagree, Team Rules come first, then project rules, then user rules.
A project rule the whole team gets
Project rules must use the .mdc extension; a plain .md file in .cursor/rules is ignored. The front matter decides when a rule applies:
---
description: Conventions for the checkout service
globs: src/checkout/**/*.ts
alwaysApply: false
---
- Validate every request body with zod at the route.
- Prices are integers in cents; never use floats for money.
- Read @src/checkout/README.md before changing the payment flow.
alwaysApply: true: in every chat.globsonly: when a matching file is in context.descriptiononly: when the agent judges it relevant.- Neither: only when someone @-mentions the rule.
If your team doesn't all use Cursor
.cursor/rules is read only by Cursor. If some of the team use Claude Code, Codex or another agent, put the shared rules in AGENTS.md: Cursor reads it (including nested ones in subfolders), Codex reads it, and Claude Code reads it when the repository has no CLAUDE.md. Keep Cursor-specific, file-scoped rules in .cursor/rules.
What rules don't do well
Rules are static text that someone has to edit. They're a poor fit for:
- Why a decision was made. The rule says "no captcha on checkout"; the reason, and the numbers behind it, don't fit in a rule.
- What was tried and reverted. Writing every lesson into a rule makes it long and less likely to be followed.
- Work in progress. Which tasks are open, and which agent has taken one.
- Things learned today. A teammate's agent finds out the staging database is read-only; until someone edits a rule, nobody else's agent knows.
Add a shared ledger to every teammate's Cursor
RepoMemory is an MCP server with one ledger per project. On the Team plan, every key on the account reads and writes the same ledgers. Add it to the project's .cursor/mcp.json, with each person's key coming from their own environment so no key is committed:
{
"mcpServers": {
"repomemory": {
"url": "https://api.repomemory.dev/mcp",
"headers": {
"X-API-Key": "${env:REPOMEMORY_KEY}"
}
}
}
}
Cursor fills in ${env:NAME} in url and headers from the environment. Then add an always-applied rule, .cursor/rules/project-memory.mdc:
---
alwaysApply: true
---
## Project memory (RepoMemory, project "acme/shop")
- At the start of a session, call `brief` for the project: it returns every guardrail, the open tasks and the latest decisions. Never break a guardrail. If a guardrail contradicts the repository's rules or what you were asked, don't pick one quietly: say so and ask.
- Before planning a change, removing code that looks unneeded or retrying an approach, call `recall` with words about the change. Follow what it returns.
- When a change is reverted, a fix took real digging, or you choose one approach over another, call `record_entry` (kind lesson or decision) saying what happened, why, and what to do instead, with your name in `agent`.
Now a lesson one teammate's agent records reaches everyone's next session, and a rule nobody should break can be a guardrail, which brief hands every agent at the start of a session.
When a guardrail and a rule disagree
RepoMemory doesn't read your rules, so brief can't spot a clash. The agent sees both; ledger entries come back as notes the user's instructions outrank. The rule above has the agent name the clash and ask; a person then edits the rule or supersedes the guardrail.
Limits to know
RepoMemory's recall matches words, not meaning, so agents should recall with the words of the change ("captcha checkout"). It's hosted only. The Team plan is $50 a month for 20,000 new entries; recall is free. See pricing and the docs.
First published on repomemory.dev. I build RepoMemory, so weigh my take on it accordingly.
Comments
Join the discussionTeam Rules outrank project rules, which outrank user rules, but what happens when a guardrail in the ledger contradicts a rule someone committed, I cannot tell you. Does brief just hand it over, or does it flag the clash and let a human settle it? Whether the ledger is a fourth layer or a second source of truth depends on the answer.
You're right, and it was a gap. brief just hands the guardrail over. RepoMemory doesn't read .cursor/rules, Team Rules or AGENTS.md, so it can't spot a clash. The agent sees both.
On precedence: rules are instructions, while ledger entries come back marked as notes from earlier sessions, with a notice that the user's instructions come first. So it's not meant to be a second source of truth. Rules say what to do; the ledger keeps the why, what was tried, and work in progress.
But my own example rule undercut that. "Never break a guardrail" lifted guardrails up to rule level. Prompted by your comment, I've changed the default rule every agent gets from the MCP server to:
Never break a guardrail. If a guardrail contradicts the repository's rules or what you were asked, don't pick one quietly: say so and ask.
So the agent flags the clash and a person settles it: edit the rule, or record a new guardrail with supersedes, which retires the old one with a pointer to the new one. npx @plexsicity/repomemory init (0.1.1) writes the same rule, and I've added a "When a guardrail and a rule disagree" section to the post above.
So: a fourth layer, below your rules, that tells you when the two disagree rather than settling it on its own. Thanks for pushing on it.