AI Transformation13 Oct 202623 min read

Cursor rules, skills, subagents and hooks: a team setup guide

When to use Cursor rules, skills, subagents or hooks: what each costs in context, where its files live, who it applies to, and how to enforce controls.

Cursor rules, skills, subagents and hooks: a team setup guide

Last checked: 21 Oct 2026. The facts below come from Cursor's own documentation for rules, skills, subagents, hooks, plugins and MCP, its release notes and changelog, the Agent Skills specification and the published studies named in the text.

Last updated: 21 Oct 2026.

Use rules for short standing guidance, skills for a repeatable procedure the agent can pull in when it needs it, subagents when a job outgrows one context window or can run in parallel, and hooks for a control that has to run every time. A hook only stops something if it is written to deny the action and, where the control matters, set to fail closed. Plugins package all four, plus MCP servers, for sharing across an organisation. This guide sets out how each one loads, what it costs and where it lives, so an engineering lead can decide who owns it.

The four mechanisms side by side

Cursor's customisation page lists six components: plugins, rules, skills, subagents, hooks and commands (reusable prompts, which this guide leaves aside). The table covers the four that steer or control the agent. Plugins, the packaging layer over them, have their own section below.

MechanismWhen it loadsContext costWhere it livesWho it applies to
RulesDepends on the rule's mode. Only Always Apply rules (and CLAUDE.md) are in every conversationApplied rules sit at the start of the model's context. Cursor says they add up but publishes no token figure.cursor/rules/*.mdc, AGENTS.md, User Rules in Cursor, Team Rules in the dashboardAgent chat only. Not Tab completion, Inline Edit or Bugbot reviews
SkillsThe agent decides from each skill's description, or a person invokes it with /Names and descriptions are listed up front. The full body loads on demand.cursor/skills/ or .agents/skills/, plus Claude and Codex skill foldersEveryone in the repository, or one person for user-level skills
SubagentsWhen the main agent delegates, or you ask it toOwn context window and own token use: five in parallel use roughly five times the tokens.cursor/agents/, or ~/.cursor/agents/ for one personEveryone in the repository, or one person for user-level subagents
HooksWhen their event fires, such as before a shell command or after a file editCursor states no model cost for command hooks. Prompt hooks use a model.cursor/hooks.json, ~/.cursor/hooks.json, or the dashboard and a system path on EnterpriseEnterprise, team, project or user, depending on where it is defined

Rules: short standing guidance

Cursor supports four kinds of rule. Project Rules sit in .cursor/rules and are version-controlled with the code. User Rules follow one person across projects. Team Rules are managed from the dashboard on Teams and Enterprise plans. AGENTS.md is a plain markdown alternative that can sit at the repository root or in subfolders, with the more specific file taking precedence.

Rules are often described as always on, which is true of only one of four modes. A rule can be applied to every chat, applied when the agent judges its description relevant, attached when a file matching a pattern is in context, or used only when someone @-mentions it. CLAUDE.md is the exception: Cursor reads it like AGENTS.md and applies it to every conversation.

Project rule files must use the .mdc extension, and a plain .md file in .cursor/rules is ignored. Typing /create-rule in Agent chat gets the format right: the rules documentation says Agent writes the file with proper frontmatter and saves it to .cursor/rules. A file mentioned inside a rule is not pasted into the prompt, so anything that must always be present has to be in the rule body. And rules only steer Agent chat: Tab completion, Inline Edit and Bugbot pull request reviews ignore them, and Bugbot has its own review rules.

What to put in a rule, and what to leave out

Our advice is to keep rules short and specific, and to treat each one as a cost every conversation pays. Cursor's own guidance points the same way. Its guide to customising agents says rules "add up" and asks teams to add one only when they notice the agent making the same mistake repeatedly. The rules documentation sets an upper bound of 500 lines, and says to use a linter rather than pasting in a style guide, because the agent already knows common conventions. A rule written after the third time the agent ran the wrong test command earns its place. One written in advance, for a problem nobody has seen, does not.

Cursor publishes no token figure for rules, but a context usage report added in June 2026 shows where your own tokens go across the system prompt, tool definitions, rules and skills. A preprint by Gloaguen and colleagues (version 3, 29 Sep 2026), which tested other coding agents on Python tasks, found that AGENTS.md-style context files did not generally improve task success and raised inference cost by over 20% on average, while still helping with non-standard practices. Record what is unusual about your codebase and nothing more.

Skills: repeatable procedures the agent pulls in

A skill is a portable, version-controlled package that teaches the agent a particular task. It is a folder with a SKILL.md file and optional scripts/, references/ and assets/ folders. Skills follow the open Agent Skills specification, so Cursor also loads skills from Claude and Codex folders. Our post on governing Claude Skills across a firm covers the Claude side.

By default the agent sees the list of available skills and decides when one is relevant. A person can also invoke a skill by typing / in Agent chat. Setting disable-model-invocation: true makes a skill manual-only, and a skill can be kept on for a session as a Custom Mode. Because the detail loads only when used, a skill costs less context than an always-on rule. The specification suggests roughly 100 tokens per skill for the name and description, loaded at startup, and a body under 5,000 tokens. Cursor's CLI now warns in /skills when a skill's body goes past about 5,000 tokens or its description past 1,024 characters.

Scoping a skill to the files it is about

The optional paths field takes glob patterns, as a list or a comma-separated string such as "**/*.py, scripts/**/*.py". The skills documentation says the skill is then surfaced only when the agent reads or edits matching files, keeping it out of context for unrelated work. New skills should use paths in place of the older globs. In a monorepo you may need neither: a .cursor/skills/ folder anywhere in the repository is scoped automatically to files in its directory, so a skill under apps/web/ appears only for work there.

Built-in skills, including the ones that write your setup

Cursor ships built-in skills, managed by Cursor and run with / in Agent chat. Four draft configuration for you: /create-rule, /create-skill, /create-subagent and /create-hook. /migrate-to-skills converts Apply Intelligently rules and slash commands into skills, but leaves Always Apply rules, file-pattern rules and User Rules alone. Others include /review-security, /review-bugbot, /split-to-prs and /autopilot, which hands a pull request to a cloud subagent. The list changes with releases, so check the table on the skills page.

Use a skill when the agent needs a detailed, repeatable process, such as cutting a release or running a migration checklist. Cursor's help pages draw the line the same way: a rule when a short instruction is enough, a skill when Agent needs a process to follow. Commit skills to the repository. Cursor's docs say unsynced local skills are not copied into Cloud Agents, remote sessions or self-hosted workers. A personal skill in ~/.cursor/skills/ can be synced to your own Cloud Agents (it stays private, and admins can switch sync off) or published to the team marketplace covered below. Neither reaches everyone in the repository the way a commit does.

Subagents: when the work outgrows one context

A subagent is a separate assistant the main agent delegates to. It runs in its own context window, starts with only what the parent passes it, and returns its result to the parent. Several can run at once.

Cursor documents two built-in subagents that need no configuration and that Agent uses automatically. Explore searches and analyses the codebase in its own context window, using a faster model so it can run many searches in parallel. Browser controls a browser through MCP tools and filters noisy page output down to what matters.

Cursor is direct about the cost: "Running five subagents in parallel uses roughly five times the tokens of a single agent." A subagent can also be slower than the main agent on a simple task because it starts fresh. Use one for long research, parallel workstreams or an independent check of finished work. For a single-purpose job such as formatting imports, Cursor's docs suggest a skill instead, and they advise starting with two or three focused subagents with well-written descriptions, because the description is how the main agent decides when to delegate.

Custom subagents are markdown files in .cursor/agents/. Cursor also reads .claude/agents/ and .codex/agents/ for compatibility, and .cursor/ wins when two share a name. The easiest way to write one, according to the subagents page, is to ask Agent, and the built-in /create-subagent skill does the same job. Four settings matter for a team:

  • readonly stops a subagent editing files or running state-changing shell commands.
  • Parallel edits share one checkout by default, so subagents editing at once can overwrite each other. Ask for isolation and each gets its own branch, in an isolated Git worktree on the same machine or in its own cloud environment with a dedicated VM.
  • model defaults to the parent's model. Pinning a named third-party model can change what a run costs, because each request bills at the list price of the model that ran.
  • is_background decides whether the parent waits. A foreground subagent (the default) blocks until it returns, which Cursor says suits sequential work. A background one returns at once, writes its output to ~/.cursor/subagents/ and can be resumed, which suits long-running or parallel work.

Typing /in-cloud makes the next task a cloud subagent on its own VM and branch. Cloud subagents use the MCP servers configured for the team at cursor.com/agents, not those on your machine, which our guide to Cursor's cloud agents and automations covers.

Custom subagents also cost context before they run: a forum user reported in May 2026 about 11,400 tokens at the start of a chat with over 60 user-level subagents, against about 1,400 without them. That may change, but it is another reason to keep the set small.

Hooks: controls that must run every time

Hooks are scripts that observe, block or modify the agent loop at defined points. Cursor's listed uses include running a formatter after edits, scanning for secrets and gating risky operations such as database writes. Events include beforeShellExecution, afterFileEdit and beforeReadFile, which can keep sensitive files away from the model. The built-in /create-hook skill drafts hooks and updates hooks.json for you.

Matchers decide which actions a hook sees

A matcher is a regular expression on a hook entry, and an empty string or "*" matches everything. What it is tested against depends on the event, according to the hooks reference:

EventThe matcher is tested against
beforeShellExecution, afterShellExecutionThe full command string
preToolUse, postToolUse, postToolUseFailureThe tool type, such as Shell, Read, Write, Delete, Task or MCP:<tool_name>
subagentStart, subagentStopThe subagent type, such as generalPurpose, explore or shell
beforeReadFile, afterFileEditThe fixed values Read and Write

Cursor's example runs an approval script on beforeShellExecution only when the command contains curl, wget or nc. Our view is that a hook protects only what its matcher catches. An unanchored rm also fires on format, and a narrow pattern can miss a variant, so test it against forms like git push -f or a command chained after &&, and use the empty or * matcher for a control that must see everything.

Why hooks, and how they fail

Cursor's page on safety and controls says the model will attempt to follow rules but "rules are suggestions, not guarantees", and recommends enforcement hooks for requirements that must be followed, such as blocking git push or database DROP statements. Users do report the agent skipping rule and skill files.

The same page calls hook-based controls "deterministic enforcement", which needs a qualification. A command hook runs your code every time its event fires, but it blocks only if it returns a deny, exits with code 2 or, for permission hooks such as beforeShellExecution and preToolUse, returns invalid output. The hooks reference says crashes, timeouts and other exit codes fail open by default, so the action goes through. Set failClosed: true on any hook that enforces a control, test that it denies what it should, and avoid prompt-based hooks for hard controls, because they ask a model to judge. Cursor's rules documentation also says AI guidance should not be your only security control. Our post on Cursor for regulated businesses covers turning a written policy into hooks.

Where hooks are defined

Hooks can be defined at four levels, in this order of priority:

  • Enterprise: a system-wide hooks.json at an operating-system path, deployed by your own device management.
  • Team: configured in Cursor's web dashboard and synced to members, on Enterprise only.
  • Project: .cursor/hooks.json in the repository, run in any trusted workspace.
  • User: ~/.cursor/hooks.json on one person's machine.

Every matching hook from every level runs, and a deny from any of them overrides an allow. Hooks can also arrive inside a plugin (Cursor Plugin format only), so review them with the rest of the plugin. Cloud agents run command hooks from the repository but not user-level hooks, skip hooks during read-only early turns, and do not yet support session or MCP hooks. On Enterprise they also run dashboard team hooks and enterprise-managed hooks. On Teams, controls that must cover Cursor's cloud agents and automations belong in the repository. Cursor can also run hooks written for Claude Code, through a third-party imports setting that is on by default, and our guide to setting up Claude Code for a business team makes the same case for hooks over written instructions.

Treat the configuration folder as code

For a team, rules, skills, subagent definitions and hook files change what the agent does for everyone, and two of them can run code. Our view is that every change to .cursor/, AGENTS.md and the skills folders should go through a pull request with a named owner, like a change to CI.

The evidence supports that. A January 2026 study of more than 31,000 skills from two public skill marketplaces (not Cursor's) found that 26.1% had at least one vulnerability, and that skills bundling scripts were about twice as likely to. A vulnerability published in June 2026 let Cursor Desktop versions before 3.0.0 run Claude hook commands from a workspace's .claude/settings.local.json without dedicated approval. It is fixed, so keep Cursor up to date and review hook changes, in any format, as code.

Plugins, MCP servers and marketplaces

A plugin packages rules, skills, subagents, commands, MCP servers and hooks into one installable bundle, and people install it from Customize at project or user scope. An Agent Plugin, with a plugin.json at its root, follows an open standard and carries skills and MCP servers. A Cursor Plugin, with a .cursor-plugin/plugin.json manifest, can also carry rules, subagents, commands and hooks. The plugins reference says that manifest needs only a name, with components found in default folders, and a .cursor-plugin/marketplace.json file lets one repository hold several plugins.

Plugins come from three places, and only one is reviewed by Cursor:

  • The Cursor Marketplace. Cursor's marketplace security page says every plugin there is manually reviewed before listing, must be open source, and has each update reviewed. It still puts installation at the user's risk and recommends reading the source.
  • cursor.directory. Cursor's documentation points to cursor.directory for community plugins and MCP servers. We have not found a page that says those listings get Cursor's review.
  • Your own team marketplace. This is your organisation's repository, so the review is yours.

Team marketplaces, imported from a GitHub, GitLab, Bitbucket or Azure DevOps repository, are available on Teams (one) and Enterprise (unlimited, added by admins only). Each plugin is set to Default Off (developers choose), Default On (installed, with an opt-out) or Required (always installed), and access can be limited to Organization Groups, which Cursor documents as an Enterprise feature. Members can also publish a personal skill to the team's Default marketplace without installing it for anyone else, and the Allow Members to Publish setting is on by default.

MCP servers connect the agent to tools and data. Project servers go in a committable .cursor/mcp.json, with secrets in environment variables, and the MCP documentation says Cursor asks for approval before using MCP tools by default. Cursor's safety page says MCP servers do not enforce policy, and distribution is separate from policy. Team MCP servers are shared through the Default team marketplace, and adding one does not install or enable it for every developer. The MCP allowlist is Enterprise only: it limits which servers run, marketplace plugins respect it, and it pushes nothing to anyone's machine. Unused servers still cost context, since Cursor Learn puts a tool definition at "usually a few hundred tokens per tool". Our explainer on MCP servers covers the protocol, and our guide to Cursor Enterprise administration covers allowlists and which setting wins.

Cursor's Enterprise comparison table shows community plugin import on by default for Teams and off for Enterprise, and marketplace edits open to all teams on Teams and limited to admins on Enterprise. Our advice is to name an owner for the team marketplace, read a plugin's source before adding it, decide deliberately whether members may publish, and leave Required to that owner.

Sharing the setup, and what it needs

Anything committed to the repository is shared with everyone who works in it, and the pages we checked state no plan requirement for project rules, AGENTS.md, skills, subagents or project hooks. Central control depends on plan, according to Cursor's enterprise documentation:

  • Team Rules are on Teams and Enterprise, and an admin can make one required so members cannot switch it off. Since September 2026, Team Rules scoped to a file pattern apply only when a matching file is in context.
  • Team marketplaces for sharing rules, skills, plugins and Team MCP servers are on Teams (one) and Enterprise (unlimited).
  • The MCP allowlist is Enterprise only, and approves servers without distributing them.
  • Hooks can be shared through the repository, a plugin or your own device management on Teams. Dashboard distribution is Enterprise.

Cursor is now sold as part of The X Subscription, announced on 12 Oct 2026, and existing Cursor plans continue for current customers. Check the pricing page before choosing a plan. Our guide to SpaceX Super Intelligence (SpaceXSI) for UK business explains how Cursor, Grok and Grok Bot fit together, following Cursor's acquisition by SpaceX in August 2026.

Where we would start

We use Cursor in our own engineering, and the order we suggest is simple. Commit a short AGENTS.md or one Always Apply rule with the build and test commands and a pointer to your linter configuration. Add scoped rules only as repeated mistakes appear. Turn the procedures people keep explaining to the agent into skills in the repository. Write two or three read-only subagents for review and research before any that edit code. Put the controls that must not fail, such as secrets, destructive commands and production access, into project hooks set to fail closed. Once more than one repository needs the same setup, package it as a plugin and distribute it through a team marketplace, remembering that Teams allows one. Ownership and sequencing are covered in our guide to rolling out Cursor to an engineering team, and the same four ideas across Claude Code, Codex and Cursor are in rules, skills, subagents and hooks: which to use when.

Common questions

What is the difference between Cursor rules and skills?

A rule is a short written instruction that, depending on its mode, is applied to every chat, attached when matching files are in context, pulled in when the agent judges it relevant, or used only when mentioned. A skill is a packaged procedure whose detail loads only when the agent or a person invokes it. Use a rule when a short instruction is enough and a skill when the agent needs a repeatable process.

Can Cursor ignore a rule, and what stops it?

Yes. Cursor's documentation says rules are suggestions to the model and not guarantees. For something that must happen every time, use a command hook that denies the action or exits with code 2, and set it to fail closed, because by default a hook that crashes or times out lets the action through.

When should I use a Cursor subagent instead of the main agent?

Use a subagent for long research that would flood the main conversation, for workstreams that can run in parallel, or for an independent check. Each subagent has its own context window and uses its own tokens, so five in parallel use roughly five times the tokens of one agent. For a simple single-purpose task, a skill is usually the better fit.

Which Cursor plan do I need to share rules and hooks across a team?

Anything committed to the repository is shared with everyone who works in it. Enforceable Team Rules and team marketplaces need a Teams or Enterprise plan. Distributing hooks from Cursor's dashboard needs Enterprise, while Teams customers can share hooks through the repository or their own device management. Cursor is now sold as part of The X Subscription, announced on 12 Oct 2026, and existing Cursor plans continue for current customers, so check its current pricing page.

How do we share a Cursor setup, including MCP servers, across a whole team?

Commit rules, AGENTS.md, skills, subagents, project hooks and the project MCP configuration to the repository, which shares them with everyone who works in it. For a setup that spans repositories, package it as a plugin and distribute it through a team marketplace: one on Teams, unlimited on Enterprise. An admin sets each plugin to Default Off, Default On or Required. Team MCP servers go through the Default marketplace, and adding one installs it for nobody.

Should developers be allowed to install community plugins and MCP servers?

Cursor's manual review covers plugins on its own marketplace only, so treat anything from elsewhere, including cursor.directory listings and your own team marketplace, as third-party code to read before installing. On Enterprise an allowlist limits which MCP servers run, and community plugin import is off by default there, while Teams has it on.

If you want a view of how your team's Cursor setup should look before you commit to a plan, start with a diagnostic, or see our SpaceXSI and Cursor implementation service and Request a Quote.

John Kelleher holds the SpaceX Super Intelligence Partner Network Accreditation: Forward Deployed Engineer, and the SpaceX Super Intelligence Technical Architect Accreditation.

Written by

John Kelleher

John is the founder and the Chief Executive at SpotDev.