Share Cursor rules across a team and many repos
Share Cursor rules with your team: .cursor/rules in git, AGENTS.md, Team Rules, a team plugin marketplace, or synced files across repos. The tradeoffs.
To share Cursor rules with a team, commit them as .mdc files in .cursor/rules: every clone of the repo gets them.
For rules that should reach every repo, Cursor's Team and Enterprise plans offer Team Rules in the dashboard and team
marketplaces that ship rules as plugins. On other plans, sync the files yourself with a template repo, a git
submodule or a script, or move the knowledge into a shared memory server.
What Cursor reads
The Cursor rules docs list four kinds of rules:
| Kind | Where it lives | Who sees it |
|---|---|---|
| Project Rules | .mdc files in .cursor/rules, in git | Everyone with the repo |
AGENTS.md | Project root and subdirectories, in git | Everyone with the repo |
| User Rules | Customize, Rules in Cursor | Only you, all projects |
| Team Rules | The Cursor dashboard (Team and Enterprise plans) | The whole team, all repos |
Rules apply in the order Team Rules, Project Rules, User Rules. When guidance conflicts, the earlier source wins.
Project Rules in .cursor/rules
A project rule is an .mdc file with frontmatter. A plain .md file in .cursor/rules is ignored, because it has
no frontmatter. You can sort rules into subfolders.
---
description: Conventions for API route handlers
globs: src/api/**/*.ts
alwaysApply: false
---
- Validate input with the shared schema helpers.
- Return errors in the standard error shape.The three fields give four modes:
- Always Apply:
alwaysApply: true, added to every chat. - Apply Intelligently: the agent decides from the
description. - Apply to Specific Files: added when a file matches
globs. - Apply Manually: added when you
@-mention the rule, for example@api-routes.
Cursor suggests keeping each rule under 500 lines and splitting large ones. Files a rule mentions with @ are not
inlined; the agent reads them when needed. Put what must always be there in the rule itself. You can create a rule
with /create-rule in the agent chat.
AGENTS.md
Cursor also reads AGENTS.md, a plain Markdown file with no metadata, in the project root and
in subdirectories. Nested files combine with their parents, and the more specific one wins.
AGENTS.md is the better place for rules other agents should read too, since Codex and Claude Code read it as well.
Keep .cursor/rules for rules that need globs or a manual trigger. See
CLAUDE.md vs AGENTS.md.
User Rules
User Rules are your own preferences in Customize, Rules. They apply across all your projects, but they are not
shared: each teammate sets their own.
Team Rules
On Team and Enterprise plans, admins create Team Rules in the dashboard (cursor.com/dashboard/team-content). A Team
Rule is free-form text that goes into the agent's context across all repos and projects of the team. Rules without
globs apply to every conversation; glob patterns are supported.
Two switches matter:
- Enable this rule immediately: active now, or saved as a draft.
- Enforce this rule: members cannot turn it off. Rules that are not enforced can be toggled off under
Team RulesinCustomize.
Team Rules solve the many repos problem for one team in Cursor. They are text in a dashboard, not files in git, so changes skip code review, and other agents do not see them.
Team marketplaces
Cursor rules are not imported from GitHub on their own. You package them in a
plugin, which can also carry MCP servers, skills, commands and hooks. A plugin
repo has .cursor-plugin/plugin.json; a repo with several plugins adds .cursor-plugin/marketplace.json.
Team marketplaces are on Teams (one marketplace) and Enterprise (unlimited) plans. Admins add one under
Dashboard, Plugins & MCPs, Add Marketplace, Import from Repo, with a GitHub, GitLab, Bitbucket or Azure DevOps
URL. Each plugin gets an install mode: Default Off, Default On (members can opt out) or Required (cannot be
uninstalled).
With Auto Refresh on (it needs the Cursor GitHub App on the repo), plugins update on pushes to the tracked branch, at most once every 10 minutes. This gives you rules in git, reviewed in pull requests, and pushed to every member. A running cloud agent keeps the plugin version it started with.
Syncing rule files across repos yourself
Without a Team plan, or when the rules must sit in each repo, copy the files. Three common ways:
Template repo. Start new repos from a template that has .cursor/rules and AGENTS.md. Easy, but it copies
once. Later changes do not reach old repos.
Git submodule. Keep shared rules in their own repo and add it as a subfolder of .cursor/rules:
git submodule add https://github.com/your-org/cursor-rules .cursor/rules/sharedEvery repo pins a commit, so updates are explicit (git submodule update --remote). The cost: everyone needs
--recurse-submodules on clone, and a forgotten update leaves a repo on old rules.
Sync script or CI job. A script copies the shared files into each repo and opens a pull request. It keeps review per repo, but someone owns the script, and repos drift between runs.
All three keep rules as files in git, which is free and reviewed. None of them covers lessons from chat: when a teammate corrects the agent, the fix stays in that session unless someone edits the files.
A shared memory over MCP
Cursor supports MCP servers in .cursor/mcp.json per project or
~/.cursor/mcp.json for every project, over stdio, SSE or Streamable HTTP, with OAuth for remote servers. Team
admins can also distribute MCP servers through a team marketplace. One memory server can then serve every repo and
every teammate.
Over MCP alone, the agent has to decide to search, and it rarely searches for what it does not know it is missing. See MCP memory servers compared.
axs brain adds hooks and an MCP server to Cursor. Its hooks push your always-on rules at session start, the memories of a project on the first work there, and matching memories on every prompt. When you correct the agent, it saves the lesson as a short memory. Rules can block a command or ask first. The same memory works in Claude Code and Codex, so a lesson saved in Cursor reaches teammates on other agents.
The tradeoff: it is a paid service (from €12 a month, 14 days free, see Plans and billing), and the memories live outside git.
Setup with axs brain
Install the axs CLI, then:
axs login
axs install cursorThis adds the hooks to ~/.cursor/hooks.json and the MCP server to ~/.cursor/mcp.json. Then connect axs brain in
Cursor's MCP settings and sign in. See Connect your agents.
Your existing .cursor/rules, .cursorrules and AGENTS.md can be imported, one memory per
rule or fact. Nothing is written before you agree, and your files stay as they are.
FAQ
Are Cursor rules shared through git?
Project Rules in .cursor/rules and AGENTS.md are, since they are files in the repo. User Rules stay with each
person. Team Rules live in the Cursor dashboard.
How do I share Cursor rules across all repos?
On Team or Enterprise plans, use Team Rules or a team marketplace plugin. Otherwise, use a template repo, a git submodule, a sync script, or a shared memory server.
Can admins force a rule on everyone?
Yes, on Team and Enterprise plans. Turn on Enforce this rule for a Team Rule, or set a marketplace plugin to
Required.
Should I use .mdc or .md in .cursor/rules?
.mdc. Cursor ignores plain .md files there because they have no frontmatter. AGENTS.md is the plain Markdown
option.
Can Cursor, Claude Code and Codex share one set of rules?
For project rules, write them in AGENTS.md. For knowledge beyond one repo, see
Shared memory for AI coding agents.
Codex memory: AGENTS.md, memories and MCP
How OpenAI Codex remembers across sessions: AGENTS.md in ~/.codex and your repo, local memories, codex resume, and a shared memory server over MCP.
MCP memory servers compared: axs brain, Mem0, Zep and more
Compare MCP memory servers for Claude Code, Codex and Cursor. Hosting, team sharing, how memories reach the agent, rules, pricing and license.