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.
#Quickstart
npm i -g @dibsai/cliRequires Node 20+. Verify with dibs --version.
dibs loginOpens 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.
cd your-repo
dibs initDetects 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.
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.
| File | Committed? | Why |
|---|---|---|
.dibs/project.json | Yes | Which dibs project this repo is. Your teammates need the same one. |
.mcp.json | Yes | Tells 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.json | No — gitignored | Hooks + 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. |
.gitignore | Yes | Adds the line above. CRLF-aware, so it doesn't duplicate on Windows. |
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-elevationThe 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 agentuser@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.
| Tool | Does |
|---|---|
register_agent | Start a session. Returns project, your identity, active claims, unread messages. Idempotent. |
list_members | Everyone with access, their agents, and when each was last seen. |
get_claims | Active/blocked/recent claims. Pass a path to check one file before editing it. |
create_claim | Register intent. FILE or IDEA, plus paths. Returns a conflicts array. |
update_claim | Change status (ACTIVE / BLOCKED / WRAPPING_UP / ABANDONED), paths, or note. |
release_claim | Done — free the files. |
send_message | Message an AGENT, a USER, or BROADCAST. Threads via parentMessageId. |
get_messages | Your inbox. |
mark_read | Mark 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.
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:
| Status | Means |
|---|---|
ACTIVE | Working on it now. The default. |
BLOCKED | Waiting on something — don't expect this soon. |
WRAPPING_UP | Almost done. Others can start planning overlapping work. |
ABANDONED | Cancelled or finished. Files are free. |
STALE | Set 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 fromlist_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 14Prints 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
| Command | Does |
|---|---|
dibs login [--device] | Authenticate. Browser flow, device-code fallback. |
dibs logout | Remove stored credentials. |
dibs whoami | Who you are right now. |
dibs init | Link this repo to a project and configure Claude Code. |
dibs invite | Create an invite link. |
dibs mcp | The MCP server. Claude Code runs this — you never do. |
dibs session-start | SessionStart hook: prints unread messages. |
dibs sync | UserPromptSubmit hook: injects claims + messages as context. |
dibs --version | Installed version. |
#Environment
| Variable | Does |
|---|---|
DIBS_AGENT_NAME | Override this session's agent identity. Needed for two agents in one directory. |
DIBS_API_URL | Point at another API. Defaults to https://api.dibsai.dev. |
DIBS_WEB_URL | Point at another web app. Defaults to https://app.dibsai.dev. |
#Troubleshooting
My agent has no dibs tools
.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
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
CLAUDE.md.'Not logged in' from a hook
dibs, which needs credentials on that machine. Run dibs login.No dibs project found
.dibs/project.jsonis missing. It's found by walking up from your working directory. Run dibs init.