Running two AI coding agents on one codebase is great until both edit the same file. Then you become the messenger: “Claude, Cursor already changed this.” “Cursor, Claude is handling that.” Most of the fix isn't a tool. It's a few rules human teams already use, written down where both agents can read them.
1. Give each agent its own working copy
Two agents in one folder share one set of files, so every save can break the other agent's work in progress. Git worktrees give each agent its own folder and branch from the same repository:
git worktree add ../myapp-claude -b claude/auth-refactor
git worktree add ../myapp-cursor -b cursor/settings-pageOpen Claude Code in ../myapp-claude and Cursor in ../myapp-cursor. Nothing changes under either agent's feet, and you bring the work together with normal merges or pull requests. When a task is done, clean up with git worktree remove ../myapp-cursor.
2. One writer per file
Split the work by area, not by step. “Claude does the backend, Cursor does the UI” works far better than “Claude starts it, Cursor finishes it”. Write the split down as folders:
Claude Code: src/auth/**, src/api/**
Cursor: src/settings/**, src/components/**
Shared (ask first): src/types.ts, package.jsonShared files are where conflicts happen. Give each one a single owner; the other agent asks for a change instead of making it.
3. Give both agents the same rules
Keep the project's rules in one AGENTS.md file at the root of the repo. Cursor and Codex read it directly. Claude Code reads CLAUDE.md, so make that file a one-line pointer:
# CLAUDE.md
@AGENTS.mdPut in it what every agent needs on every task:
- how to build, test and lint;
- the ownership split from step 2;
- “don't edit files outside your area; ask in the plan instead”;
- how to write commit messages.
One file means you change a rule once, and both agents follow it from their next session.
4. Claim work before starting it
Add a small plan file, for example docs/agents/board.md, with one line per task: who has it, which files, and its status. Tell each agent to add its line before starting and to mark it done at the end:
- [doing] Settings page redesign · Cursor · src/settings/** · claimed 14:05, expires 15:05
- [done] Token refresh fix · Claude Code · src/auth/refresh.ts
- [next] Settings API · waits for: Settings page redesignThe expiry time matters. Agents crash and sessions end mid-task. Without a time limit, a stale claim blocks that work forever, or you have to notice and clear it yourself.
5. Hand off in writing
At the end of every session, ask the agent for a short hand-off note in the same file or next to it: what changed, what's left, and what's risky. The next agent, or the same one tomorrow, reads it first. It costs a minute and saves you re-explaining the task from scratch.
6. Small commits, and you do the merging
- Each agent commits small, focused changes with clear messages.
- Each agent pulls or rebases before it starts work.
- Neither agent pushes to
main. You review each branch's diff and merge it. - Run the tests after merging both, not only on each branch.
Where the manual setup breaks down
A Markdown board works for a day or two. Then claims go stale, two agents both think they own a file, a hand-off note gets skipped, and you're the messenger again. The rules are right; keeping them up by hand is the hard part.
How Kynvox handles it
I'm building Kynvox partly because of this problem. Its Agent Bus turns the steps above into something the agents do themselves, through Kynvox's built-in MCP server:
- One shared project map for plans, notes and decisions, which every connected agent reads and writes.
- Claims with a time limit, so agents see what's taken, and a crashed agent's claim expires on its own. A claim that has expired can't overwrite newer work.
- Checkpoints that keep progress when an agent stalls, so the next one continues instead of starting over.
- Dependencies, so tasks unlock in the right order.
- A live graph showing which agent is working on what.
Claude Code and Cursor connect today. Kynvox is in early access for macOS and Windows; join the waitlist to try it.
Checklist
- One worktree and branch per agent.
- One writer per file; shared files have one owner.
- One
AGENTS.mdfor everyone, withCLAUDE.mdpointing to it. - Claim before starting, with an expiry time.
- A hand-off note at the end of every session.
- Small commits; you review and merge.
