Agents · Claude Code
Claude Code for teams, without collisions
In shortRun lanes init --agents claude in your repository and commit the result. Lanes writes .claude/settings.json so that every Claude Code edit is committed as you and published to a shared branch, after waiting for any teammate editing the same file. Add lanes mcp to Claude Code so its agent can read the team brief and check a file before touching it.
Claude Code on a team
Claude Code is the agent most teams run several of at once: one per person, often more than one per person in parallel worktrees. Each session sees only its own conversation and its own checkout. When two people's agents work in the same repository, one can overwrite the other's change in a shared file, or write new code against a function the other is renaming. Git shows the damage later, at merge time, after both agents have finished.
Lanes connects every agent on the team to one coordination server. Claude Code gets a team brief with each prompt, heads-ups about teammates' changes, and the rest of the team's agents see what Claude Code is changing.
What Lanes installs for Claude Code
Lanes adds command hooks to .claude/settings.json: UserPromptSubmit for the brief, PreToolUse on Edit, Write, MultiEdit and NotebookEdit for the lease and the sync, PreToolUse on Read for the read heads-up, PermissionRequest to hold a lease while you decide on an approval prompt, PostToolUse to commit and publish, Stop to publish what changed during the turn and run the end-of-turn check, and SessionStart and SessionEnd to register and remove the agent.
The file is committed with lanes init, so every teammate gets it when they pull. lanes off removes only the Lanes entries and leaves your own settings alone.
| What | Claude Code with Lanes |
|---|---|
| Edits wait for a teammate's edit of the same file | Yes |
Each edit committed as you and published to lanes/main | Yes |
| Team brief added to each prompt | Yes |
| Heads-up before reading a teammate's file | Yes |
| Check at the end of a turn | Yes |
| MCP team tools | Yes |
Set it up
- Get Lanes:
git clone https://github.com/mfmatozza/lanes && cd lanes && npm ci && npm run build. The commands below writelanesfornode /path/to/lanes/dist/lanes.cjs. - In your repository, run
lanes init --agents claudeand push the commit it makes. - Turn on shared context once per repository:
lanes team on, then commit.lanes/team.json. - Add the MCP server to Claude Code:
claude mcp add lanes -- node "/path/to/lanes.cjs" mcp- Check the machine with
lanes doctor.
Working alone, the first session starts a local Lanes server. For a team, one person runs lanes server --host 0.0.0.0 and invites the others with lanes invite <name>.
Things to know about Claude Code
- Claude Code reads
.claude/settings.jsononly from the folder it was started in. In a monorepo, runlanes initin each folder you start Claude from, or start Claude at the repository root. - Every hook command ends with
; exit 0, so a missing Node never shows a hook error and never blocks an edit. lanes approve <id> --runcan run an approved request with your own Claude Code, in plan mode for read-only requests and in a separate worktree for requests that may edit.
Status
Run against the real Claude Code in 389 sessions, including all benchmark runs.
Mixed teams work: one person can use Claude Code while teammates use Claude Code, Codex or Cursor. Every agent reports to the same server, so the brief and the heads-up name each teammate's task whatever agent they run.
Questions
Do I have to change how I use Claude Code?
No. Start Claude Code in the repository as usual. The hooks run by themselves, and the only visible sign is a status line while an edit waits for a teammate's.
Does Lanes work with Claude Code in VS Code and in the terminal?
Yes. Both run the same hooks from .claude/settings.json.
Can Claude Code see what my teammate's Codex or Cursor agent is doing?
Yes. All agents report to the same Lanes server, so the brief and the heads-up name the teammate's task whatever agent they use.