Comity for
Cursor

Native hooks on shell commands, file writes and deletes, the Comity MCP server and an always-on rule. In the editor, the CLI and cloud agents.

Sam's Cursor window: the agent edits CheckoutSummary.tsx, and its write to db/schema.sql is blocked by Comity because the path is protected, so it asks Priya, the owner, to approve. The always-on rule lives in .cursor/rules/comity.mdc.

Set up in a minute

Three steps. The same files serve the editor, the Cursor CLI and cloud agents.

  1. Step 1: Install and sign in

    Once on each teammate's machine. The CLI needs Node.js 22 or newer.

    $ npm i -g comity-cli$ comity login
  2. Step 2: Set up the repo

    Hooks, the MCP server and an always-on rule go into .cursor, the org link into comity.json.

    $ comity init --tools cursor$ git add comity.json .cursor
  3. Step 3: Trust and enable

    Open the repo in Cursor, trust the workspace, and enable comity in Cursor Settings → MCP.

    $ comity doctor✔ cursor hooks all 7 events installed

What Comity adds

What the hooks, the MCP server and the rule give Cursor.

A briefing at session start

Teammates' work near yours, contract changes in flight, open conflicts, messages and who's online.

sessionStart · additional_context

Blocks before the write

A shell command, write or delete that breaks a rule is denied, and Cursor shows Comity's reason to you and the agent.

preToolUse · permission: deny

News after each tool call

New conflicts, messages and notices arrive as context, along with warnings queued before the call.

postToolUse

An always-on rule

Tells the agent to declare its intent, check scope and answer conflicts through Comity's tools.

.cursor/rules/comity.mdc

Your yes for work requests

When the agent accepts a teammate's work request, Cursor's approval prompt asks you first.

beforeMCPExecution

Cloud agents too

Cloud agents run the repo's hooks, except session start and end, once the environment has the CLI and a token.

COMITY_TOKEN

Questions

About Comity in Cursor.

We set up Claude Code already. Does Cursor need more?

It works as is: Cursor runs the Claude Code hooks in .claude/settings.json too. Add Cursor's own hooks and the Claude Code ones step aside, so each event is checked once.

Why do briefings arrive a step late?

Cursor's prompt and pre-tool hooks can't add context, so prompt-time briefings and pre-tool warnings arrive after the next tool call.

Is there a token in .cursor/mcp.json?

No. It starts comity mcp, a local bridge that uses the login on your machine. The file is the same for every teammate, on any OS.

What does Comity check in Cursor?

Shell commands, file writes, edits and deletes. Reads, searches and MCP calls aren't evaluated.

What if a teammate doesn't have the CLI?

Their hook fails with a harmless error that Cursor logs in the Hooks output channel, and the action goes ahead.

Other integrations

Try Comity now.

Start free →

npm i -g comity-cli && comity login && comity init