claude code for teams.
when several developers each run Claude Code on one repository, every agent works from what it read and knows nothing of the others. agentmash adds hooks to each developer’s Claude Code that report every edit to one room for the repository, and tell an agent what teammates’ agents are changing before it edits.
what goes wrong without it
edits collide: two agents touch the same file, one breaks the interface the other is building against, both write the same helper.
- on one branch, a teammate’s write lands in a file after your agent read it. a stale
old_stringeither fails to match or quietly reverts their change. - on two branches, both agents change the same file, and the conflict shows up only when someone merges.
- across files, one agent changes an exported function’s signature while another, in a file that imports it, keeps building against the old one.
what each hook adds
PreToolUse- before each edit, it checks the room. if a teammate’s agent touched the same file, or changed a symbol your file depends on anywhere in the repo, the advisory goes into your agent’s context, graded by severity.
PostToolUse- reports every
Write,EditandMultiEditto the room, with the exported symbols the edit changed. it runs in the background, so the edit doesn’t wait for it. UserPromptSubmit- sends the first 500 characters of your prompt as a task hint, so every event says what a teammate is doing, not only which files. at a prompt, your agent also gets a short heads-up when a teammate’s agent is on your branch or in a file your session changed: at most once every ten minutes, and only when that’s news.
SessionStart- the same heads-up when a session starts, or its context is cleared or compacted.
Stop- if a file this session edited was also edited by someone else, the person is told once, as the session finishes, with whose change it meets. it only advises: the agent finishes as it would have, and a person decides what happens to the two changes.
SessionEnd- says the session ended, so the board says gone when someone is gone.
- the MCP server
- lets an agent ask the room while it plans, before it has picked its files: who is working on what, whether anyone has touched a file, which files are contested, and claims, to divide the work before anyone writes. a repository registers it with a committed install.
what the agent reads
this is what bob’s agent is told before it edits a file alice’s agent changed two minutes earlier, word for word:
[AgentMash: ACTIVE COLLISION] alice's agent is working in src/models/user.ts — last write 2 min ago on your branch (main), while working on 'add soft deletes to the user model' (+12/-3 lines, touching deletedAt). Their write is already in your working tree, so whatever you read from this file earlier is out of date. Re-read src/models/user.ts now and rebuild this edit against what is actually there: a stale old_string either fails to match or quietly reverts their change. Leave deletedAt named and shaped as alice left it — that is what they just changed. If your task genuinely needs those same lines, change them and say so in your reply, so the overlap is visible.
it re-reads the file, adapts, and says so in its reply. that’s the loudest of five levels; a change on another branch, or one older than five minutes, is worded more quietly.
setup, in three steps
- someone who can push to the repository connects it once, at agentmash.dev/install: they sign in with GitHub and pick it. nothing is committed to it and there is no pull request.
- each developer runs
npx agentmash loginonce and signs in with GitHub in the browser it opens. it puts the hooks in their own Claude Code settings,~/.claude/settings.json, never in a repository. - each developer restarts Claude Code. from the next prompt on, their prompts and edits go to the room.
setup has the steps for claude code and the other coding agents, and a prompt that does them for you. to see it first, how it works plays a made-up team of four in your browser, with nothing to set up.
how it fits what you already use
- CLAUDE.md stays yours: agentmash doesn’t write to it. agentmash tells an agent things when they apply: before an edit, or at a prompt.
- shared settings: the login puts the hooks in each developer’s own settings and leaves the repository’s
.claude/settings.jsonalone. a committed install, the older way, adds them to it without disturbing what’s already there. - worktrees: every worktree of the repository reports to the same room, on its own branch. git worktrees and agentmash says what each one catches.
- the crew: 22 ready-made Claude Code agents you can add to the repository as a team. when one of them edits a file, the live view draws its cursor as that agent.
what it doesn’t do
- it informs; it doesn’t lock.
AGENTMASH_STRICT=1blocks instead, and its acknowledge step needs a POSIX shell. - the first 500 characters of each prompt are visible to everyone in the room, and quoted into their agents’ context. don’t paste secrets into prompts;
AGENTMASH_HINTS=0keeps yours on your machine. - symbols are read from JavaScript and TypeScript only. files in other languages are matched by path.
- a check that runs past its budget, 1500 ms by default, lets the edit go ahead unwarned.
setup →the five levels →the MCP server →reconciliation →known limitations →