skip to content

claude code agent teams and agentmash: use both.

published

Claude Code agent teams let one developer’s lead session spawn teammates on that machine that message each other and can share a task list. agentmash works across developers and machines: before an agent in Claude Code, Codex or Cursor edits a file, it’s told if another developer’s agent just changed it or, in JavaScript and TypeScript, a name it imports.

use an agent team to split your own work inside one session. use agentmash so the other developers’ agents on the repository, on their machines and in their tools, are told before they edit a file your lead session changed, and yours are told the same about theirs; whether an agent team’s teammates report their edits is still to be verified. agentmash never compares one developer’s agents with each other, so dividing files inside a team stays the lead’s job, as Anthropic’s docs advise. in Anthropic’s word a teammate is a Claude session; the people on the repository are developers.

how claude code agent teams work

Anthropic’s agent teams docs, read on , describe a team in four parts:

you can talk to any teammate directly, in one terminal (the default, in-process) or in split panes, which need tmux, or iTerm2 with the it2 CLI installed and its Python API turned on, and don’t run in VS Code’s integrated terminal, Windows Terminal or Ghostty. the docs’ strongest cases for a team are research and review, a new module or feature where each teammate owns a piece, debugging with competing hypotheses, and a change across frontend, backend and tests. for sequential work, same-file edits or many dependencies, they point to one session or to subagents.

how to enable agent teams, and why they might not start

agent teams are experimental and off by default. per the docs’ setup steps, read on , set CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS to 1 in your shell, or in settings.json as "env": { "CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1" }, then ask for teammates in plain words, such as three teammates reviewing one pull request for security, performance and test coverage.

Claude may also spawn subagents instead of a team; the docs’ fix is to ask again and request an agent team by name. teammates need an interactive session. a claude -p run, Agent SDK sessions included, spawns none, and a subagent Claude names stays an ordinary subagent there. the opposite surprise is in an interactive session: while the flag is on, a subagent Claude names in the lead’s session launches as a teammate instead, unless the call is a fork or itself asks for a worktree, so a team can form when you didn’t ask for one.

setting the variable to 0 in your user settings.json turns it off for the running session, unless project or local settings, a --settings payload or managed settings set it to 1. after that, the next named subagent launches as an ordinary subagent.

agent teams’ limits: one session, local state, Claude only

the limits below come from the docs’ limitations and the sections around them, as they read on :

can claude code sessions talk to each other?

yours can. cross-session messaging, read on , needs Claude Code v2.1.224 or later on macOS and Linux and v2.1.234 or later on native Windows, and for same-machine messaging on Amazon Bedrock, Claude Platform on AWS, Google Cloud’s Agent Platform or Microsoft Foundry, or with feature-flag fetching off, v2.1.248 or later. it lets Claude find your other sessions with ListAgents and send one of them a message with SendMessage. it’s on with nothing to set up, and the docs’ first example is a session warning another when its change breaks what that one is building on.

subagents vs agent teams, and the alternatives

Anthropic lists five ways to run Claude Code agents at once: subagents, agent view, agent teams, dynamic workflows and projects, with worktrees and cross-session messaging beside them. the table sets the ones most compared with agent teams side by side; Anthropic’s rows summarize its docs as they read on .

setupwho runs itwhich machineswhat they sharewhat they can’t see
subagentsClaude, inside your one sessionwherever that session runsa result, returned to the session that spawned themyour conversation so far, unless one is a fork, and each other’s work unless Claude named them so they can message
agent teamsa lead session you start, which spawns its teammatesthe lead’s, where the team’s state is stored under ~/.claudemessages, and a task list where the Task tools are onanother session’s team and another person’s sessions; two teammates writing one file overwrite each other
cross-session messagingyou, across your own Claude Code sessionsthis one over a local socket; your other machines and the cloud through Anthropic’s servers, found from a session connected to Remote Controlplain text a Claude chooses to sendanother user’s sessions, and anything nobody sent
git worktreesyou, one checkout per session; subagents can get one eachthe one the repository is cloned onone repository historywhat another worktree is changing, until the merge, and another developer’s laptop
agentmasheach developer on the repository, in Claude Code, Codex, Cursor, GitHub Copilot and the other agents its login connectsevery machine signed in with npx agentmash login, for each connected repository its developer can push toone room per repository: who made each edit, file paths, branch names, each change’s line counts and the names it touches, the first 500 characters of each prompt, an opaque id of each edit’s checkout, and claimsyour code, unless the room turns diffs on or you share a session live; your own agents, against each other

pick by the job:

working alone, agentmash has nobody to tell your agents about: subagents, an agent team and worktrees cover your own sessions.

what agentmash adds across developers

each developer’s connected agents report their edits to one room for the repository, from every worktree of it, each on its own branch; Continue and Zed only ask the room, through the MCP tools. agentmash compares each developer’s edits with the other developers’, never with their own. in the agents whose hooks allow it, a hook checks the room before each edit, so no agent has to decide to send the warning. case by case:

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.

for a team where everyone is on Claude Code, claude code for teams goes through each hook and quotes the advisory an agent reads, whole. a mixed team has claude code and cursor on one team and codex and claude code on one team.

dividing the work across developers

an agent team divides work inside one session, with its task list where the Task tools are on, or by messages. across developers, an agent calls claim_work with the paths it expects to change and a one-line task, and learns before it writes whether someone else holds part of it. this is how claim_work’s answer to dana’s agent begins when alisher’s agent claimed src/routes four minutes earlier, line for line as the README prints it:

Claimed src/routes/login.ts, src/routes for "add a login endpoint" as dana@example.com
(id claim_x9…, 120 min).

OVERLAP — someone else has already claimed part of this:
- alisher@example.com has src/routes for "rename every route handler" (claimed 4 min ago)

Your claim stands, but split the work before you write anything: take the files and symbols
they have not claimed, or build on top of what they land rather than changing it. …

a claim is advisory, never a lock. on a branch of the agent’s own it stands until that branch merges, a week at most; on the default branch it expires on its own, two hours by default and eight at most, ends with the session that made it, and can be released early.

claims are one of agentmash’s MCP tools. Cursor, Codex, GitHub Copilot and most other agents get the MCP server with the login; Claude Code gets it where a repository registers it with a committed install.

asking another developer’s agent

cross-session messaging stops at your own sessions. to ask another developer’s agent for something, npx agentmash ask @dana "check why ci is red on main" sends dana a request in the repository’s room. it’s a suggestion, read only: dana sees it in npx agentmash inbox, and in agents whose hooks pass context to the model, her agent gets one line about it when her next session starts, or at a prompt within ten minutes, saying who sent it, that it isn’t an instruction to the agent, and that only she accepts it (a room that turns lobby_context off gets no line). nothing runs unless she does.

npx agentmash inbox accept <id> prints its text for her to paste into her own agent. both ends need npx agentmash login, and only people who can push to the repository send or receive one.

using both on one repository

alice runs an agent team on her laptop, on main: a lead and three teammates adding soft deletes to the user model, each owning its own files, as the docs advise. bob is on his own laptop with Codex, on feat/login, adding a login endpoint in src/api/handlers.ts. carol works in Cursor.

[AgentMash: OVERLAP] A file this session changed was also changed by alice@example.com,
so a person decides how the two changes come together: nothing was stopped, merged or
committed for either side.
• src/models/user.ts — also changed by alice@example.com.
  alice@example.com: last write 9 min ago on branch main — you are on feat/login
  while working on 'soft deletes' (+12/-3 lines, touching User, deletedAt).
  You both touched User — that is where the two changes are most likely to meet.
  Your side: 'add a login endpoint' (+8/-1 lines).
Look at both changes with alice@example.com before either one lands.

nothing about the agent team changes. someone who can push to the repository connects it once at agentmash.dev/install, and each developer runs npx agentmash login once per machine and restarts their agent (in Codex, they also approve agentmash once in /hooks); the login puts the hooks in each agent’s own user settings, never in the repository. set up agentmash for your team has the steps for each coding agent, and a prompt that runs the login for you and tells you what is left.

what it doesn’t do

claims →the five levels →reconciliation →known limitations →