Start here
Several agents, one repository
How several coding agents work in one codebase, often in the same files, without races or double merges.
Give each agent its own change and its own view, and let one process merge changes into main. With bay, an agent submits a change once. A runner checks the exact candidate and merges it. Agents never push or merge main by hand, and every refusal names the next step.
What goes wrong without it
- Two agents push at once. One push fails, and its agent retries, merges or force-pushes.
- A check passes on a branch, but main moved before the merge. What merges was never checked.
- A retry after a lost reply merges the same work twice.
- An agent edits a file that another change changed a moment ago, and nobody tells it until a merge conflict.
What bay does
| Need | bay |
|---|---|
| Work apart | bay start <intent> --paths <paths> opens a change and a sparse view of its paths. The intent says what the work is, in a few words. |
| A branch made outside bay | bay merge --from <branch> takes it in and merges it in one step, checked like any other change. |
| Work that needs other work first | bay start <intent> --paths <paths> --after <change> merges a change only after the named change merged. |
| Submit once | bay merge returns at once, and a runner finishes the merge after the agent leaves. To hear the outcome, run bay merge <change> --wait=3600 as a background task. |
| Merge what was checked | The runner checks the exact candidate, and bay merges only that candidate. |
| Main moved meanwhile | MAIN_MOVED: bay retries once more, then joins the queue. |
| A conflict in the queue | bay status names a conflict with main while the change waits, so its agent can repair it early. |
| No double merge | bay records each step by op id, so a crash loses no work and a retry never merges twice. |
| A stale input | INPUT_CHANGED refuses the merge until the agent reads the new version and checks again. |
| See the others | bay status --all shows every machine and session. bay status --since lists what changed. |
| Ask another agent | With [talk] enabled = true in the policy, bay talk asks one agent for one change, decision or check, with a reply time. |
| Know why it merged | Evidence of every check stays in Git. A key signs it when your registry signs everything. |
Compared with a merge queue
Most teams compare bay with what they run now: pull requests and a merge queue. A good merge queue can merge, and it keeps going after the author leaves. bay adds a record in Git that the merged commit is the exact one that passed. Batching and footprint reuse are the exceptions to that record. It keeps partial results when a worker dies, and recovers when a runner dies. It also stops work whose declared inputs moved, until the agent checks again.
Limits
- Check time caps how many changes merge a day. Merge more changes a day gives the limit.
- Ready builds cover macOS and Linux. On Windows, build from source, or run the Linux build inside WSL.
- Early refusals in hooks need Claude Code or Codex. With other agents, a stale change still cannot merge.
- Without the hook or a protected main, an agent can still push main around bay.
- Security and privacy says what bay guards, and when.
Try it
Install bay, then follow the Quickstart to merge a first change.
curl -fsSL https://getbay.io/install.sh | sh