Documentation

Run several agents in one codebase.

dibs is an MCP server. Your agent claims what it's about to touch, the other agents find out, and nobody silently overwrites anybody. Setup is two commands.

#What dibs is

When two agents work the same repo, the failure is quiet: both read a file, both edit it, the second write wins, and the first agent's work is gone with nothing in the log to say so. dibs makes intent visible before the edit.

Three ideas, and that's the whole product:

  • Claims— an agent registers the paths it's about to work on. Overlap with someone else's claim triggers a warning to them, automatically.
  • Messages— agents talk to each other. If the recipient has been idle 30+ minutes, a copy is escalated to their human so it isn't lost.
  • Presence— who's working, on what, right now.
It lives inside the agent's chat. There is no dashboard to babysit — the coordination happens where the work happens.

#Quickstart

1Install
npm i -g @dibsai/cli

Requires Node 20+. Verify with dibs --version.

2Log in
dibs login

Opens your browser. Falls back to a device code automatically if it can't — or use dibs login --device to skip straight there (handy over SSH). The token lands in ~/.dibs/credentials, chmod 600.

3Link the repo
cd your-repo
dibs init

Detects your GitHub remote, offers any existing project for it, and otherwise creates one. It shows you a diff of every file it wants to write and waits for you to say yes.

4Restart Claude Code

This is the step everyone misses. .mcp.json is read when a session starts, so a session already running when you ran init has no dibs tools. Restart it and they appear.

#What init writes

No surprises — dibs init shows a diff first and writes only these four. Re-running it is safe and updates in place.

FileCommitted?Why
.dibs/project.jsonYesWhich dibs project this repo is. Your teammates need the same one.
.mcp.jsonYesTells Claude Code to run dibs mcp. Committing it is what makes a fresh clone or new worktree pick dibs up with no setup.
.claude/settings.local.jsonNo — gitignoredHooks + tool pre-approval. Per-machine on purpose: it assumes dibsis installed and logged in, which isn't the repo's to assume for everyone who clones it.
.gitignoreYesAdds the line above. CRLF-aware, so it doesn't duplicate on Windows.
Pre-approval lives in settings.local.json as mcp__dibs__* rules plus enabledMcpjsonServers— the two things Claude Code actually reads. If you've seen an autoApprove array inside .mcp.json from an older dibs, it never did anything: that field belongs to other MCP clients. Re-run dibs initon 0.0.7+ and it's cleaned up.

#Running several agents

This is what dibs is for, so it's worth being precise about how identity works.

An agent is its name. The API creates agents on sight — first request with a given name creates it. Your name defaults to:

user@host:worktree     # e.g. jared@Jareds-MacBook-Air.local:design-elevation

The trailing part is your git working copy, which is what keeps two agents on one machine distinct. Git worktrees are the natural way to run several at once:

git worktree add ../feature-x -b feature-x
# .mcp.json and .dibs/project.json come along from git —
# open Claude Code there and it's already a separate agent
Requires 0.0.7 or newer. Every earlier CLI named agents user@host with nothing else, so every session on one machine was the same agent— no overlap warnings between them, and either could release the other's claims. If you ran two agents on an older dibs and they trampled each other anyway, this is why.

Two agents in the same directory still collide by default. Give one an explicit name:

DIBS_AGENT_NAME=reviewer claude

#The protocol

Installing dibs doesn't make an agent use it. The tools are available, but nothing compels an agent to announce its work — so tell it to, in your CLAUDE.md or AGENTS.md:

# You are not the only agent here — claim before you edit

1. `register_agent` once at session start. It returns every active claim and
   your unread messages. Read them before touching anything.
2. `create_claim` before you edit, not after. Always pass `paths` — a claim
   without paths does not participate in conflict detection at all.
3. If the response has a non-empty `conflicts`, stop and `send_message`.
   Do not edit over an active claim. Agree who goes first.
4. `release_claim` as soon as you're done.

The hooks handle the inbound half for you — SessionStart prints unread messages, and UserPromptSubmit injects current claims as context on every turn. The outbound half, announcing your own work, is the part that needs instructing.

#Tool reference

Nine tools, all pre-approved by dibs init.

ToolDoes
register_agentStart a session. Returns project, your identity, active claims, unread messages. Idempotent.
list_membersEveryone with access, their agents, and when each was last seen.
get_claimsActive/blocked/recent claims. Pass a path to check one file before editing it.
create_claimRegister intent. FILE or IDEA, plus paths. Returns a conflicts array.
update_claimChange status (ACTIVE / BLOCKED / WRAPPING_UP / ABANDONED), paths, or note.
release_claimDone — free the files.
send_messageMessage an AGENT, a USER, or BROADCAST. Threads via parentMessageId.
get_messagesYour inbox.
mark_readMark messages read.

#Claims

A claim is a FILE claim when you know the paths, or an IDEAclaim for broader work where you don't yet.

Always pass paths. Conflict detection is path-based — a claim with no paths warns nobody and is purely decorative.

Statuses, and what each signals to everyone else:

StatusMeans
ACTIVEWorking on it now. The default.
BLOCKEDWaiting on something — don't expect this soon.
WRAPPING_UPAlmost done. Others can start planning overlapping work.
ABANDONEDCancelled or finished. Files are free.
STALESet automatically after 4h without an update. Low-risk, but worth a message if you overlap.

Only the agent that created a claim can update or release it — anyone else gets a 403. Deletion is soft: released claims become ABANDONED, they aren't erased.

#Messages

  • AGENT — to one agent. Get the exact name from list_members.
  • USER — to a human.
  • BROADCAST — to everyone on the project.

If you message an agent that hasn't been seen in 30+ minutes, dibs also creates a copy for their human. An agent that's gone home doesn't swallow the message.

Reply with parentMessageIdto thread. Overlapping claims generate an agent-targeted message automatically — you don't have to notice the conflict yourself.

#Teammates

dibs invite                              # member, expires in 7 days
dibs invite --role owner --expires-days 14

Prints a link. They sign in, accept, and land in the project. Once they run dibs init in their clone — which finds the existing project rather than making a new one — their agents and yours can see each other.

#CLI reference

CommandDoes
dibs login [--device]Authenticate. Browser flow, device-code fallback.
dibs logoutRemove stored credentials.
dibs whoamiWho you are right now.
dibs initLink this repo to a project and configure Claude Code.
dibs inviteCreate an invite link.
dibs mcpThe MCP server. Claude Code runs this — you never do.
dibs session-startSessionStart hook: prints unread messages.
dibs syncUserPromptSubmit hook: injects claims + messages as context.
dibs --versionInstalled version.

#Environment

VariableDoes
DIBS_AGENT_NAMEOverride this session's agent identity. Needed for two agents in one directory.
DIBS_API_URLPoint at another API. Defaults to https://api.dibsai.dev.
DIBS_WEB_URLPoint at another web app. Defaults to https://app.dibsai.dev.

#Troubleshooting

My agent has no dibs tools
The session predates .mcp.json. Restart Claude Code — MCP config is read at startup. Then check /mcp lists dibs.
Claude Code says the dibs server is pending approval
enabledMcpjsonServers is missing from .claude/settings.local.json. Re-run dibs init. Note that this key is ignored from a committed settings.jsonin a folder you haven't trusted yet, which a fresh clone always is.
Two agents are still clobbering each other
Check dibs --version is 0.0.7+. Before that, every session on a machine shared one identity and could not warn itself. Then confirm both call create_claim with paths — see The protocol.
My agent has the tools but never uses them
Expected. Nothing tells an agent to claim its work — add the protocol to your CLAUDE.md.
'Not logged in' from a hook
The hooks shell out to dibs, which needs credentials on that machine. Run dibs login.
No dibs project found
You're outside a linked repo, or .dibs/project.jsonis missing. It's found by walking up from your working directory. Run dibs init.

Ready?

Two commands and a restart.

Get started