Chapter 26

Cursor: Configure Rules, Skills, Hooks, Run Modes, and Worktrees

Cursor has the most editor-oriented set of surfaces: MDC rules, AGENTS.md, Agent Skills, JSON hooks, local run modes, a sandbox, a CLI, and worktrees. Each surface has a separate scope.

Here's the companion project's MDC rule - note the frontmatter.

---
alwaysApply: true
---

- This is an ESM project for Node.js 24 or later with strict TypeScript.
- Run `npm run check` after changing source or tests.
- Preserve the command allowlist, `shell: false`, path containment, timeout, output cap, and sanitized environment.
- Do not add secrets or weaken a test to make verification pass.

Project Rules live in .cursor/rules and must have the .mdc extension; the frontmatter controls four behaviors: always apply, agent-selected by description, file globs, and manual @-mention. Plain .md in this directory is ignored by the rules system, and root and nested AGENTS.md are a documented simple alternative. Cursor looks for skills in .agents/skills/ and .cursor/skills/, and custom subagents in .cursor/agents/ get a separate context; the official advice is to start with 2-3 focused roles, because each subagent adds tokens and latency. Project hooks are in .cursor/hooks.json, exchange JSON over stdio, and can observe, block, or modify behavior.

The run modes set the level of autonomy, and each has its own security meaning.

Mode · Autonomy · Security meaning

  • Auto-review - Allowlisted calls immediately, others judged by sandbox or classifier; The recommended current default, but the classifier is not a security boundary
  • Allowlist - Automatically only declared actions; sandbox optional; A deterministic narrow set
  • Run Everything - All tool calls without prompts; No sandbox or classifier; the user accepts the risk
Cloud Agents are a different boundary. Cursor's documentation says the local run modes don't apply to Cloud Agents: they run on a dedicated machine and don't ask approval for every action. The cloud environment's rights and credentials are configured separately.

The three products are covered separately. Now let's run one task through all three and compare not impressions but controls and evidence.

Links