skip to content
agentmash
get started

claude code and cursor on one team

published · updated

with agentmash, each developer’s agent in Claude Code or Cursor is told before editing a file a teammate’s agent just changed. Cursor’s, as the login connects it, gets it the only way a hook can before an edit: its first edit of a file a teammate is in is refused, with the reason, and its next try goes through.

how claude code and cursor work together

what cursor’s agent isn’t told

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.

a Cursor edit is reported without the names it changed: the touching deletedAt in its summary is text that people and agents read, and it’s never matched by name. so matching by symbol runs one way. before Cursor’s agent edits src/api/handlers.ts, its check sends the names that file imports and exports, so it’s told when a Claude Code teammate’s agent changed createUser in the last half hour by default. when Cursor’s agent changes createUser, a Claude Code agent hears of it only before it edits src/models/user.ts itself, unless Cursor’s agent claimed the work first and named createUser.

the warning is about teammates. if you run Claude Code and Cursor yourself on one repository, both report as you, and by default neither is warned about the other. with AGENTMASH_WARN_SELF=1, Claude Code is told about your Cursor edits too; Cursor’s own check doesn’t do that yet. keeping your own agents apart is a worktree’s job, as git worktrees and agentmash explains.

cursor’s parallel agents, worktrees and cloud agents

Cursor runs several agents of its own. as its docs describe them on :

worktrees keep one developer’s agents out of each other’s files, subagents keep their contexts apart, and a cloud run lets a teammate look once it’s there. none of the three pages describes telling an agent, while it works, what a teammate’s agent is changing on another machine; agentmash tells an agent before it edits. its adapter counts any worktree of the repository as the repository, so an edit Cursor’s hooks report from one goes to the same room, under that worktree’s branch, or its commit when no branch is checked out there.

a cloud agent is the exception. it runs the hooks committed in the repository’s .cursor/hooks.json, but not the ones in your ~/.cursor/hooks.json, since the VM can’t reach your home directory. that file is where npx agentmash login puts agentmash’s hooks, so with the login alone a cloud agent’s edits don’t reach the room, and no advisory reaches the cloud agent before it edits. the adapter a repository can commit instead, in .cursor/hooks.json, never answers before an edit, so it can’t warn a cloud agent either.

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

toolwhat it gives a hookadapter
Claude CodePostToolUse: the path, the prompt, the session, before and afterbuilt
CursorafterFileEdit: the path and the edits, as fields; preToolUse beforebuilt
Devin (formerly Windsurf)Claude Code’s own hooks, which it runsbuilt
Codex CLIPreToolUse and PostToolUse, with the path read out of the patchbuilt
GitHub CopilotPreToolUse and PostToolUse, in VS Code and its CLIbuilt
Ampa plugin of ours: the files Amp names for a call; the advisory as a refused first editbuilt
AntigravityPostToolUse after an edit, and a heads-up at the start of each turn; connected when asked forbuilt
Clinehook files before and after a tool; the advisory arrives just after the editbuilt
CrushPreToolUse only: the advisory as a refused first edit, the edit reported once its file changesbuilt
Factory DroidPreToolUse and PostToolUse: the path, or the patch; the advisory as a refused first editbuilt
Gemini CLIBeforeTool and AfterTool: the path; the advisory as a refused first editbuilt
goosea decision before a tool, AfterFileEdit after one; the advisory as a refused first editbuilt
JuniePreToolUse only: the advisory before the edit; the edit reported a step laterbuilt
Kilo Codea plugin of ours: the path, or the patch; the advisory as a refused first editbuilt
KiroPreToolUse and PostToolUse: the advisory as a refused first edit, by exit 2built
OpenCodea plugin of ours: the path, or the patch; the advisory as a refused first editbuilt
OpenHandsPreToolUse and PostToolUse, and a plugin for Agent Canvas; the advisory as a refused first editbuilt
Qwen CodePreToolUse and PostToolUse: the advisory as a refused first edit, after the edit is approvedbuilt
Continueno hooks: the MCP tools onlybuilt
Zedno hooks: the MCP tools onlybuilt
Aiderno hook, but it commits every change by defaultthe git client covers it
vim, Emacs, any editornothingcommit 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. every coding agent the login connects has been tested with agentmash: Claude Code, Codex, Cursor, GitHub Copilot, Devin, Amp, Antigravity, Cline, Crush, Factory Droid, Gemini CLI, goose, Junie, Kilo Code, Kiro, OpenCode, OpenHands, Qwen Code, Continue and Zed.

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 →