claude code and cursor on one team.
a Cursor teammate’s edits reach the room live, so the Claude Code agents around them are told before they edit the same file. Cursor’s own agent is warned too, the one way Cursor lets a hook do it: its first edit of a file a teammate is in is refused, with the reason, and its next try goes through.
what’s live
- the Cursor adapter reports each edit from Cursor’s
afterFileEdithook: the file and the shape of the change, like+12/-3 lines, touching deletedAt, the same summary a Claude Code edit gets. beforeSubmitPromptsends the prompt, which becomes the task hint, andsessionEndsays when a session ended.- so a Cursor teammate’s edits show on the board, and in the advisory a Claude Code agent reads before it edits the same file.
- before an edit, Cursor’s
preToolUsehook asks the room about the file. Cursor drops what a hook adds to its agent’s context, so when a teammate is in the file, the adapter refuses the first edit with the advisory as its reason, once per conversation and file every ten minutes, and lets the retry through. - the MCP server is in Cursor’s own settings too, so its agent can ask who is working where, and claim files, before it starts.
- the
cursor-agentCLI runs the same hooks, so a teammate working in it is reported and warned the same way.
what isn’t
the warning is a refusal, not a note beside the edit: the agent meets it as an edit that failed with a reason, and tries again knowing it. it comes once per conversation and file every ten minutes, so another edit of that file in that time goes through unpaused. and a shell command the agent runs names no file, so it is never paused.
everyone else, through git
a git post-commit hook, installed once per checkout, reports what landed in each commit: the files, the commit subject and the line counts. it shows where someone landed, not what they’re doing, and it never warns before an edit. aider commits every change by default, so the git client sees aider users close to when they edit. for vim, Emacs or any other editor, it’s commit time only.
every tool, as of the last check
| tool | what it gives a hook | adapter |
|---|---|---|
| Claude Code | PostToolUse: the path, the prompt, the session, before and after | built |
| Cursor | afterFileEdit: the path and the edits, as fields; preToolUse before | built |
| Devin (formerly Windsurf) | Claude Code’s own hooks, which it runs | built |
| Codex CLI | PreToolUse and PostToolUse, with the path read out of the patch | built |
| GitHub Copilot | PreToolUse and PostToolUse, in VS Code and its CLI | built |
| Amp | a plugin of ours: the files Amp names for a call; the advisory as a refused first edit | built |
| Antigravity | PostToolUse after an edit, and a heads-up at the start of each turn; connected when asked for | built |
| Cline | hook files before and after a tool; the advisory arrives just after the edit | built |
| Crush | PreToolUse only: the advisory as a refused first edit, the edit reported once its file changes | built |
| Factory Droid | PreToolUse and PostToolUse: the path, or the patch; the advisory as a refused first edit | built |
| Gemini CLI | BeforeTool and AfterTool: the path; the advisory as a refused first edit | built |
| goose | a decision before a tool, AfterFileEdit after one; the advisory as a refused first edit | built |
| Junie | PreToolUse only: the advisory before the edit, to be verified; the edit reported a step later | built |
| Kilo Code | a plugin of ours: the path, or the patch; the advisory as a refused first edit | built |
| Kiro | PreToolUse and PostToolUse: the advisory as a refused first edit, by exit 2 | built |
| OpenCode | a plugin of ours: the path, or the patch; the advisory as a refused first edit | built |
| OpenHands | PreToolUse and PostToolUse, and a plugin for Agent Canvas; the advisory as a refused first edit | built |
| Qwen Code | PreToolUse and PostToolUse: the advisory as a refused first edit, after the edit is approved | built |
| Continue | no hooks: the MCP tools only | built |
| Zed | no hooks: the MCP tools only | built |
| Aider | no hook, but it commits every change by default | the git client covers it |
| vim, Emacs, any editor | nothing | commit time only, through the git client |
read from each tool’s own documentation on , and the tools from Amp to Zed on , from their documentation and, where it is open, their source. how each coding agent was checked, as of : the warning before an edit and the reports were tested live in Claude Code, Codex, Cursor, GitHub Copilot (its CLI), Kilo Code and OpenCode, and the MCP tools in Claude Code and Codex; Amp, Cline, Crush, Factory Droid, Gemini CLI, goose, Kiro, OpenHands and Qwen Code are held by our tests against payloads recorded from each tool, not run live yet; Devin, Antigravity, Junie, Continue and Zed rest on their own docs (Devin and Junie partly on our tests too), not tested live yet.
set it up
each developer runs npx agentmash login once. it finds Cursor and adds agentmash’s hooks to ~/.cursor/hooks.json and its MCP server to ~/.cursor/mcp.json, in the home directory and never in a repository, so nothing is committed. then restart Cursor. the repository itself is connected once, by someone who can push to it, at agentmash.dev/install.
step by step, with a prompt to paste into cursor: setting up cursor.
the cursor adapter →every tool, with sources →write your own →