Elffuss BraidHub

utopia-ia/elffuss-braid public

Changeset: 0ccca9aebb87
0ccca9aebb87 Docs: a watchdog that stops ends verify with an error, not a failed run KikoCis,
.github/
bench/
crates/
docs/
fuzz/
scripts/
site/
.gitignore65 B
AGENTS.md26.3 KiB
CLAUDE.md11 B
CONTRIBUTING.md2.0 KiB
Cargo.lock62.4 KiB
Cargo.toml1.5 KiB
LICENSE11.1 KiB
NOTICE160 B
README.md39.0 KiB
SECURITY.md1.2 KiB
deny.toml1.0 KiB

README.md

<img src="docs/assets/hero-light.svg" width="100%" alt="Elffuss Braid logo: three strands braided together, above the tagline “Many agents. One main. No retry loop.” Below, a terminal shows three agents landing on main in turn: agent-a lands as a fast-forward, agent-b is rebased onto it, and agent-c, which changed the same line of shipping.toml as agent-a, gets a conflict, so main did not move and braid exits with status 2.">

✳ Elffuss Braid

Version control for repositories where many AI coding agents land changes at the same time.

Braid works with Claude Code, Gemini CLI and any other coding agent that reads AGENTS.md. It is written from scratch in Rust, installs with one cargo install, and on one machine needs no server and no daemon. Each agent commits in parallel, in a workspace of its own, and landing on one main branch is a short step the agents take in turn. Merge conflicts come back as data, in text or JSON, with exit status 2, and main does not move. Git stays at the edges: braid git import brings a history in bit for bit, and braid git sync keeps GitHub in step.

CI License: Apache-2.0 Version 0.1.1 Rust 1.89+ Format v1: frozen

Quick start · Ask your agent · Scion's ideas · How it works · BraidHub · Measured against git · Questions · braid.elffuss.com · En castellano

Anthropic described Scion, the version control system it built in-house with agents in mind, in Redesigning source control at Anthropic. Scion is internal. Braid is an independent, open-source take on several of its ideas, and you can run it today: ask your coding agent to set it up in a project, or try the quick start.

Braid contains no code from Anthropic, and is not affiliated with or endorsed by Anthropic.

[!NOTE] Version 0.1: keep your git repository as the source of truth.

Scion's ideas, in braid

Each row is an idea from the article, what braid 0.1.1 does with it, and how far along that is.

Scion's ideaIn braid 0.1.1State
A changeset lists the files changed against its first parentThe same, plus the root tree id; the bytes are frozen✅ done
Data is content-addressed and never changes, so any cache can serve itBLAKE3 ids; BraidHub serves every object by id as immutable✅ done
Commits take no lock, only moving a branch is serial, and the server does the rebasesAgents commit in parallel; braid land rebases path by path onto whatever landed first, in one short step taken in turn, locally or on BraidHub✅ done
A commit costs what it changes, not what the repository weighsLanding rebases only the paths a change touches, and braid change create needs no working copy; but braid commit scans the whole working copy by default (given paths, only those), and at the last measurement was slower than git on large trees (measured)partly
Derived data for blame, path history and ancestry, computed from the parentsGeneration numbers, skip pointers and changed-path filters, which braid derive can compute ahead of time, and blame records, which braid blame computes per file, all kept in the store; BraidHub serves history and diffs, not blame✅ done locally
Every query is an API, and the working copy is optional--json on every command; braid hub show, ls, cat, log and diff read a repository with no clone; braid change create --land writes with no checkoutfirst version
Sparse and virtualized checkoutsbraid hub clone --paths fetches only the trees under some paths, with no working copy (cat-object, log and change create --land work there); no sparse working copy yet; a virtual file system is planned (milestone 7)partly
The daemon, the caches and the server answer the same requestsBraidHub is the server; a per-machine daemon and cache tiers are planned (milestones 6 and 7)planned
A proper merge queue doesn't make much sense at agent scale; invest in post-merge testing instead, and automate bisect and revertbraid verify --revert bisects to the changeset that broke the tests and lands its revert✅ new in 0.1.1
Concurrent changes can conflict, and agents fix themA conflict comes back as data, with the command to run next, and main does not move; braid does not settle conflicts itself: the agent edits the files (braid resolve only marks them settled)✅ done
Hermetic simulations and fuzzingDeterministic simulation of agents landing at once, with injected faults; crash and power-loss tests; five fuzz targets✅ done
Permissions per directory, semantic approval rules, monitoring agents ("superfans")BraidHub's permissions are per repository, and its change requests take reviews and approvalsnot in braid
Clients are always onlineBraid works offline on one machine; BraidHub is the authority when several machines share a repositoryno, by design

Three agents, one main

Three agents change a small shop at once, each in a workspace of its own: no shared index, no repository-wide lock. Then they land on main, in turn.

Three agents commit at the same time, each in its own workspace, and land on main in turn: the first is a fast-forward, the second is rebased onto it, and the third changed the same line as the first, so main does not move and braid reports the conflict with exit status 2

The real CLI, recorded by scripts/demos/render.sh.

  • agent-a lands first: a fast-forward.
  • agent-b is one changeset behind. It does not fetch and does not retry: braid land rebases its change onto agent-a's, in one short step.
  • agent-c changed the same line as agent-a, a real conflict: main stays where it was, braid exits with status 2, and the conflict comes back as data, with each side and the command to run next.

In git, each agent that loses the race fetches, rebases and pushes again. In the run measured against git, on one machine, with 4, 8 and 16 agents landing at once, git retried each push 1.1, 2.5 and 5.2 times on average, no braid agent retried, and braid took 0.4, 0.3 and 0.2 of git's time. CI runs a scene like this one on every push to main (three_agents.rs).

Quick start

Braid builds from source with cargo, and needs Rust 1.89 or newer, a C compiler and git. CI tests Linux and other Unix-like systems; Windows is not tested yet.

cargo install --locked --git https://github.com/KikoCis/elffuss-braid --tag v0.1.1 elffuss-braid-cli

To set braid up in a project you already have, ask your agent. To run the race above yourself, in a throwaway directory:

export BRAID_AUTHOR="Ada Lovelace <ada@example.org>"
cd "$(mktemp -d)" && braid init shop && cd shop
echo 'free_over = 60' | braid change create --base none \
  --set shipping.toml=@- -m "Start the shop" --land main > /dev/null
for a in a b c; do braid workspace add agent-$a; done      # under .braid/work/

echo 'free_over = 50'  > .braid/work/agent-a/shipping.toml
echo 'Ships in a day.' > .braid/work/agent-b/README.md
echo 'free_over = 40'  > .braid/work/agent-c/shipping.toml
braid commit --workspace agent-a --agent agent-a -m "Free shipping from 50"
braid commit --workspace agent-b --agent agent-b -m "Next-day shipping"
braid commit --workspace agent-c --agent agent-c -m "Free shipping from 40"

braid land --workspace agent-a --agent agent-a     # fast-forward
braid land --workspace agent-b --agent agent-b     # rebased onto agent-a's change
braid land --workspace agent-c --agent agent-c     # a conflict: exit status 2

The three landings print this; your ids will differ, since every signature carries its time:

Landed 9b6231894f8d on main (fast-forward)
Landed on main as 76b20fe96330, rebased onto 9b6231894f8d
Updated 1 path in the working copy
bdc82892d520 conflicts with main at 76b20fe96330; main did not move:
  CONTENT       shipping.toml  (1 region)
Run `braid --agent agent-c --workspace agent-c update` to bring the conflicts into the working copy.

The same conflict as an agent reads it, with --json

braid land --workspace agent-c --agent agent-c --json, abridged:

{
  "outcome": "conflicts",
  "next": "braid --agent agent-c --workspace agent-c update",
  "conflicts": [{
    "path": "shipping.toml",
    "kind": "CONTENT",
    "hunks": [{
      "base":      { "start": 0, "end": 1, "text": "free_over = 60\n" },
      "branch":    { "start": 0, "end": 1, "text": "free_over = 50\n" },
      "workspace": { "start": 0, "end": 1, "text": "free_over = 40\n" }
    }]
  }]
}

base is what both sides started from, branch what main holds now and workspace the agent's own change; lines count from 0, and a range stops before end. Exit status 2 also means a command line that braid could not parse, so an agent reads outcome too. braid land --help describes every field.

Settle the conflict as an agent would, then look back:

braid update --workspace agent-c --agent agent-c    # exit status 2: markers in its shipping.toml
echo 'free_over = 45' > .braid/work/agent-c/shipping.toml
braid commit --workspace agent-c --agent agent-c -m "Free shipping from 45"
braid land --workspace agent-c --agent agent-c      # fast-forward
braid log main     # every changeset names the agent that made it
braid op log       # every landing, newest first
braid undo         # takes agent-c's landing back; the change stays in its workspace

The third agent asks for the conflict as JSON and gets the base, branch and workspace text of the line; braid update writes conflict markers into the file; the agent settles the line, commits and lands, and braid log shows the three agents' changesets on main

The recording goes on the same way, and asks for the conflict as JSON first.

Use it from your agent

Braid comes with instructions written for coding agents. In a project that is a git repository, ask your agent, whatever harness runs it:

Install braid in this project and set it up for agents, following https://braid.elffuss.com/agents.md (read it whole, with curl -fsSL)

It installs braid with cargo, tells you what in the project braid does not run, such as git hooks, offers to make a git remote if the project has none, imports the project's git history, and writes the rules for agents into the project's AGENTS.md with braid agents init. From then on, every agent session works in a braid workspace of its own, where git refuses to run, lands through braid, and tells you when what it landed is waiting for a sync to the git remote. In a clone where braid is not set up, agents work with git as before.

Setting braid up in a project's git checkout: braid init, git told to ignore .braid, braid git import brings in the history, braid agents init writes the braid section into AGENTS.md, the section's rules are listed, and a new session starts in a workspace of its own under .braid/work

  • AGENTS.md gets a section between <!-- braid:start --> and <!-- braid:end --> with the rules every session follows; running braid agents init again rewrites only that section. CLAUDE.md and GEMINI.md, where they exist, get the line @AGENTS.md. They are committed with git, so every clone and every new session has them.
  • Nothing of braid's own goes into git. .braid/ holds the store, the workspaces and .braid/config, the name and e-mail address that sign what agents land.

Agents get --json on every command, exit status 2 for a conflict that left the branch where it was, and a guard that holds back new files that look like secrets (.env*, *.pem, id_*) or are larger than 1 MiB until braid track lets them in. The guide is part 1 of AGENTS.md, served as braid.elffuss.com/agents.md next to an llms.txt. To set a project up by hand, follow its Set up a project: the same steps, what to check first, and what to do when one fails.

Why braid

Git was designed for people who work offline and sync now and then. Agents are many, always connected, and all want to land on main at once. With git, every agent that loses the race to push fetches, rebases and pushes again. A merge queue ends the race by testing each change before it lands, so every landing waits for CI; Anthropic's article puts it plainly: "A proper merge queue, for example, doesn't make much sense at agent scale."

git, a clone per agenta merge queuebraid
Landinggit push, rejected whenever another agent got in firstwaits for CI on the changes ahead of itbraid land: one short step, taken in turn
Retriesgrow with the agents: 5.2 per push with 16, in one runnonenone: a change that fell behind is rebased
A conflictmarkers, and messages written for peoplethe change leaves the queueexit status 2, main does not move, JSON with next
A change that breaks the buildlandsis stopped before it landslands, and braid verify --revert then lands its revert

So braid trades the queue's guarantee for landings that never wait for CI: between a landing and the next braid verify, main can be red, and braid/green/main names the newest changeset that passed.

The design, against git's

gitbraid
Unit of changea commit: a full tree snapshota changeset: the files that changed against the first parent, plus the root tree id
Many writersone index per working treeone workspace per agent over a shared append-only store; creating a change takes no repository lock
Fetchingnegotiated packs, built for each clientimmutable objects by id; any HTTP cache can serve a public repository's, and a private one's carry Cache-Control: private
Large directoriesrewritten whole on every changesplit into content-defined nodes; an edit rewrites only its path
Large filesa separate extensioncontent-defined chunks, deduplicated across versions
HashSHA-1 by defaultBLAKE3
For agentsoutput written for people--json everywhere; changes can be created without a checkout

This is the design. Status and roadmap says what exists today.

How it works

<img src="docs/assets/how-it-works-light.svg" alt="Three workspaces, a, b and c, each with its own working copy and no index, sit on one shared store of immutable objects named by BLAKE3 and an append-only op log, and commit in parallel. Landing is one short step, taken in turn: a goes straight in as a fast-forward, b is rebased onto it, and c hits a conflict, exit 2, so main did not move; c runs update, fixes the file and commits, then lands as a fast-forward. The strands braid into main, which git sync sends to any git remote as a fast-forward, with a lease. A dashed box marks a daemon and caches as planned.">

  1. Everything is an immutable object named by its BLAKE3 hash, and a changeset records the files that changed against its first parent, plus the root tree it produces: history, blame and rebase read the short list, and the root id commits to the whole repository.
  2. Landing is the one step agents take in turn, and it is short: a fast-forward, or a rebase path by path that merges only the files both sides touched. Conflicts come back as data, and the branch does not move.
  3. Many processes share one store without a daemon, through locks the kernel releases if a process dies, and an append-only op log records every operation, so that braid undo can step back.
  4. The same requests at every tier: a local store, a per-machine daemon, a cache and a server are meant to answer the same requests. The server has its first version, BraidHub; the daemon and the caches are planned (milestones 6 and 7).

Working with git

Repositories come in with their whole history, and git hosts keep working as mirrors.

braid git sync takes a branch of a git repository with its history; after agents land two changes in braid and a person pushes one to the git repository, the next sync merges both and pushes a fast-forward, and git log shows the original commits with their ids unchanged

cd "$(mktemp -d)" && braid init demo && cd demo
braid git import /path/to/project       # every local branch and tag
braid log main -- README.md             # only the changes to a path
braid blame main README.md              # who last changed each line
git init --quiet --bare ../mirror.git
braid git export ../mirror.git          # the same commits, with the same ids
braid git sync https://github.com/you/project.git --branch main
  • Bit for bit. braid git import reads git through gitoxide, exports each commit again as it imports it, and stops unless the id comes back the same. Shallow and SHA-256 repositories are refused for now.
  • The remote only fast-forwards. braid git sync fetches and imports, then fast-forwards braid or pushes, merging first when both moved. The push carries a lease on what it just fetched, so history on GitHub, Gitea or any git remote is never rewritten; a conflict moves nothing and exits with status 2.
  • No git code. Braid contains no code from git itself, which is GPLv2. It reads and writes git data with gitoxide (MIT or Apache-2.0); git sync also runs the git binary, to set up its mirror, fetch and push.

Keeping main green

New in 0.1.1. Braid has no merge queue: changes land as they come, and braid verify checks afterwards. It runs the project's tests on the head of a branch, in a fresh copy of its files, and keeps braid/green/<branch> at the newest changeset that passed. When they fail, it bisects the changesets since the green one, and with --revert it lands the revert of the first that fails. One run is one pass: run it after landings, or on a schedule.

braid verify --branch main --revert --json -- cargo test --workspace

Here three changesets landed after the green one, and the second broke the tests. A failing run is run once more before it counts:

$ braid verify --branch main --revert -- sh -c 'grep -qx ok status.txt'
braid verify: 60fb322bafea failed (exit status: 1)
braid verify: 60fb322bafea failed (exit status: 1)
braid verify: c4b445c63d60 passed
braid verify: 51108ceb6ded failed (exit status: 1)
braid verify: 51108ceb6ded failed (exit status: 1)
main at 60fb322bafea: reverted (5 runs)
the tests fail from 51108ceb6ded, the first changeset that fails; its revert landed on main
Revert: dbc25836e20d
  • A fresh copy, not a sandbox. The command runs as given, with no shell, in a copy of the changeset's files in the system's temporary directory, outside the repository: every run builds from scratch, and the copy is removed after it. BRAID_VERIFY_CHANGESET and BRAID_VERIFY_BRANCH say what it tests, and PWD names the copy; BRAID_TOKEN, every variable whose name starts with BRAID_HUB, and OLDPWD are taken out of its environment. That is all the isolation there is: the command runs as you, with your access to every file, the network, the braid command and any hub login saved in braid's configuration directory. For code you do not trust, run verify in a container, a sandbox or as a user of its own.
  • A process group and a watchdog, on Unix. The command runs in a process group of its own. When it exits, or runs past --timeout (10 minutes by default), the group is killed, with whatever it started that is still in it; a process that left the group, as a daemon does, is not. A watchdog process, started before the command, kills the group and removes the copy if braid is killed or exits while the tests run. When the watchdog cannot start, or stops, verify ends there with an error (exit status 1) rather than go on unwatched, and runs no more tests. On other systems (Windows is not verified) only the command itself is killed, and nothing watches braid.
  • In a container, run braid under an init such as tini (docker run --init), not as PID 1: PID 1 gets no default handling of signals, and has to reap the processes others leave behind, which braid does not.
  • Flaky tests. A run fails when the command exits with a status other than 0, is killed or runs past --timeout, and a failing run is run again (--reruns, once by default) before it counts. One that then passes is flaky: green, but the green ref stays where it was unless --flaky-moves-green.
  • Bisecting tests each changeset as it is, along first parents. When the first that fails was reverted later in the range, verify tests the revert and, if it passes, bisects again after it. A changeset whose files cannot be written on this system is skipped, and listed in skipped.
  • Limits on reverts. Verify never reverts a merge, nor a revert it made, which it tells by the revert's reverts field and its agent, braid-verify; braid warns anyone else who acts as braid-verify. It lands at most three reverts an hour (--max-reverts-per-hour), each counted by its own committer time among the last 10,000 changesets of the branch, whatever the dates of those between them. Both rules are read from the branch, so a clone without verify's local record in .braid/verify/ follows them too. After a revert the green ref does not move: the next pass tests the new head.
  • The green ref is local. It is never exported or sent to a hub, and a fresh clone, as CI has, has none: verify then tests only the head, unless --from names a changeset to bisect from. braid status --json shows it as green. --dry-run runs the tests, but moves no ref, records nothing, lands nothing and does not fetch from a hub.
  • Exit status 0 means green (pass or flaky); 4 red (red, reverted, refused or no_culprit), whether or not a revert landed; 2 a revert that conflicts; and 1 an error. Once the tests have started, an error prints the report too, with what was done until then.

braid revert <rev> undoes one changeset by hand: it lands a new changeset that puts the files it changed back as they were before it, and when a later change touched the same lines, it stops with exit status 2 and the branch does not move. braid verify --help describes every JSON field, and the design has the rules.

BraidHub

BraidHub is the hosted service for agents on many machines. In a repository linked to it, braid land lands on the hub, rebased there path by path in turn with every other landing, with the output and exit statuses of a local landing. A repository is private unless its owner makes it public, and can keep a GitHub repository as its mirror, which every landing on its default branch reaches as a fast-forward.

A public repository can be read, and cloned, with no account. This one is on the hub too:

braid hub show -R kikocis/elffuss-braid     # its description, counts and README
braid hub log -R kikocis/elffuss-braid      # its history, newest first
braid hub cat -R kikocis/elffuss-braid Cargo.toml
braid hub clone kikocis/elffuss-braid spec --paths docs/spec   # only the trees under docs/spec

Landing from several machines takes an account, with GitHub sign-in: braid login, then braid hub publish to put a repository on the hub and braid hub clone to make a linked copy of it elsewhere. The same CLI covers change requests that land exactly as they were reviewed, issues, an inbox and forks, every command with --json. Coding agents have their own guide (docs/hub-agents.md), and docs/hub.md documents the protocol. BraidHub is new in version 0.1: for anything that matters, keep a GitHub mirror as the source of truth.

Design

Status and roadmap

MilestoneScopeState
0Public repository, CI, object ids, braid hash-object✅ done
1Format v1: canonical codec, trees (flat and split), changesets, name rules; frozen✅ done
2Local store and op log: many processes, crash-safe, fsck, undo✅ done
3History and the git bridge: import, export, log, show✅ done
4Many agents on one machine: workspaces, land, conflicts, git sync✅ done
5Performance: deltas, chunking, derived indexes, blame, benchmarks against gitin progress
6Server: BraidHub with GitHub sign-in, landing over HTTP, GitHub mirrors and sparse clones; caching tiersfirst version; caching planned
7Daemon, virtual file system, WebAssembly coreplanned

New in 0.1.1: braid revert, and braid verify, which runs when you run it: one run tests a branch's head, bisects a failure to the changeset that caused it and, with --revert, lands that changeset's revert.

Each milestone ships when its tests pass: golden vectors and fuzzing for the format, crash and many-process tests for the store, bit-for-bit round trips and differential tests against git for the bridge, deterministic simulation for landing.

What is honest about this

  • It is version 0.1. Today it stores history, round-trips git repositories, runs workspaces for many agents on one machine, lands their work from many machines through BraidHub, and finds and reverts what broke the tests. Keep your git repository as the source of truth, and do not keep anything only in braid.
  • Slower than git at most things, at the last measurement. Measured against git gives every result as a ratio against git on the same machine, with the script that reproduces it. At commit 5330054, braid was faster when many agents landed at once, and slower at importing and storing history, and at status and commit on large trees. Much of that has been worked on since, but bench/run.py has not been run again for the ratio table. A later measurement of the store's size, on the imported histories of four public repositories, found 2.5 to 3.1 times what git gc --aggressive packs them into (format v1, section 7).
  • main can be red for a while. Braid lands first and tests after, and merges are textual: two changes can merge cleanly and still break the build together, until braid verify --revert reverts one of them.
  • Not there yet: garbage collection, so nothing is ever removed from a store, and shallow or SHA-256 git repositories, which the git bridge refuses. log -- <path> and blame follow first parents and, on purpose, not renames.
  • The hashed format is frozen, and every golden vector is recomputed by a second implementation written from the specification alone. Storage and protocols can still change.
  • Braid is not Scion. It starts from the ideas Anthropic described in public about its own source control system. It is an independent implementation, contains no code from Anthropic, and is not affiliated with or endorsed by Anthropic.
  • Platforms. CI tests Linux and other Unix-like systems. Windows is not tested yet.

Measured against git

Each number is braid's time, or the size of its store, divided by git's for the same work on the same machine: below 1 braid is faster or smaller, above 1 it is slower or larger. They are medians from one run of bench/run.py, measuring braid at commit 5330054. Git ran with its defaults, except that automatic garbage collection and maintenance were off, and so were its file system monitor and, unless a row says otherwise, its untracked cache. The benchmark's README describes every scenario. Yours will differ: run python3 bench/run.py --only <scenario> before relying on any of them.

What was comparedbraid / git--only
4, 8 and 16 agents land 10 commits each, at once: braid commit + braid land, a workspace each, vs git commit + git push, a clone each, with git pull --rebase and a new push when rejected0.4, 0.3, 0.2agents
Import tmux 3.5a, 10,287 commits: braid init + braid git import vs git clone --no-local --bare; then checking it out too, with braid workspace add vs git clone --no-local17.6, 17.1import
Size after that import: du of .braid/store vs the bare clone after git gc --aggressive25.1store
Status of a tree of 100,000 files, clean: braid status vs git status, without the untracked cache, then with core.untrackedCache=true2.6, 5.8status
The same, with 10 files modified3.0, 5.7status
Commit one changed file of that tree: braid commit vs git add + git commit5.0commit
Commit one new file in a directory of 20,000 files, 200 times: braid commit vs git add + git commit1.8wide
The same without a working copy: braid change create --land0.9wide
Newest 1,000 changesets of tmux: braid log -n 1000 vs git log --first-parent -n 1000 --format=%H after git gc --aggressive1.7history

Git retried each push 1.1, 2.5 and 5.2 times on average with 4, 8 and 16 agents; no braid agent retried, and nearly every braid landing was a rebase. Since this run, braid stores deltas, cuts large files into chunks, edits a large directory in place, walks the working copy in parallel, and looks objects up through the store's indexes instead of mapping the whole store first. The ratios show none of that, and leave out braid log -- <path> and braid blame, which came later.

Why braid was slower at that commit

  • Importing and storing history. Braid kept every version of a file whole, compressed on its own, where git stores most versions as a delta against another. The import converted and checked every object on one thread, and much of that time went to checking every entry name against the aliases of .git, with Unicode normalisation and case folding, each time a tree was read or built.
  • Status and commit on a large tree. braid status walked the working copy one directory at a time on one core, opening each directory from the root one name at a time, so that it never follows a symlink; it also read the whole base tree and rewrote the whole stat cache every time. git status spreads its checks over several cores and, with the untracked cache, skips the directories that did not change. braid commit has no staging area, so it ran a whole status first.
  • A new file in a wide directory. Braid wrote only the few nodes of a large directory that change, but read and rebuilt the whole directory in memory to find them. From 2,500 to 20,000 files, the cost of one commit grew 5.2 times for braid commit, 3.6 times for braid change create and 3.5 times for git.
  • Opening the store. Every command first built a map of where each object of the store is, which on a history the size of tmux's was a large part of braid log -n 1000; git looks each object up in its pack index when it needs it.

Questions

Is braid an open-source Scion? No. Scion is internal to Anthropic. Braid is an independent implementation of the ideas Anthropic published about it, contains no code from Anthropic, and on one machine needs no server. The site's page on Scion's ideas says what braid takes from Scion and where it differs.

Does braid need a server? Not on one machine: the agents' workspaces share one store, and landings take their turn with no server and no daemon. When agents on several machines share a repository, BraidHub is the server, and braid land lands there, in turn with every other landing.

Why not a git worktree per agent? A git worktree gives each agent its own files and index, but landing works as before: each branch still has to be rebased or merged onto main, and when the agents push to one remote, every agent that loses the race fetches, rebases and pushes again, and stops at conflict markers when two changes clash. braid land rebases a change onto whatever landed first, in one short step taken in turn, and a conflict comes back as data while main stays put.

Do coding agents need a merge queue? Not to land. Agents land in turn and never wait for CI; braid verify tests after landing, bisects a failure and, with --revert, lands the revert, and main can be red in between. Where people review each change before it lands, pull requests and a merge queue still make sense, and braid git sync keeps the GitHub repository they use in step.

Part of Elffuss

Braid is part of Elffuss, a family of tools for building software with agents: elffuss.com · Code · Claw · Translator · Copilot · Blog · Hugging Face · Dev log. Braid has a Space on Hugging Face too.

Prior art and credits

  • Anthropic, Redesigning source control at Anthropic: changesets stored against the first parent, server-side merges, minimal branch state, immutable objects served by any cache tier, and testing after merging instead of a merge queue. The article credits many of its techniques to Sapling's server, Mononoke, and its Bonsai data model.
  • Jujutsu: the operation log and undo.
  • Sapling: history served at scale, and compressing a file version against the previous one.
  • gitoxide: the git bridge.
  • BLAKE3, FastCDC, prolly trees and imara-diff.

Contributing and security

  • CONTRIBUTING.md: how to build, test and propose changes. Pull requests are welcome.
  • SECURITY.md: how to report a vulnerability privately.

License

Apache-2.0. Copyright 2026 UtopiaIA. See NOTICE.


En castellano

Muchos agentes. Un solo main. Sin reintentos. Braid es un sistema de control de versiones escrito desde cero en Rust, para repositorios en los que muchos agentes de IA aterrizan cambios a la vez. Cada agente hace commit en su propio espacio de trabajo, y aterrizar en main es un paso corto que dan por turnos: si un cambio se ha quedado atrás, braid le hace rebase sobre lo que haya aterrizado antes, y un conflicto vuelve como datos, sin mover main. braid verify, nuevo en la 0.1.1, ejecuta los tests cada vez que lo lanzas tras aterrizar; si fallan, localiza con bisect el changeset que los rompió y, con --revert, aterriza el cambio que lo deshace. Git se queda en los bordes, así que GitHub y Gitea siguen funcionando.

Se inspira en las ideas que Anthropic publicó sobre Scion, su sistema interno de control de versiones. Es una implementación independiente: no contiene código de Anthropic y no tiene relación con Anthropic ni cuenta con su respaldo.

Está en la versión 0.1, así que tu repositorio de git sigue siendo la fuente de verdad. Para trabajar desde varias máquinas está BraidHub, el servicio alojado de braid: los repositorios son privados salvo que su dueño diga lo contrario, y cada uno puede tener un repositorio de GitHub como espejo, al que el hub sube como fast-forward cada aterrizaje en su rama por defecto. Las fases dicen qué llega después y qué pruebas tiene que pasar cada una.

Para usarlo en un proyecto, pídeselo a tu agente:

Instala braid en este proyecto y configúralo para agentes siguiendo https://braid.elffuss.com/agents.md (léelo entero, con curl -fsSL)

Lo instala con cargo, te avisa de lo que braid no ejecuta, como los hooks de git, importa la historia de git del proyecto y, con braid agents init, escribe en su AGENTS.md las reglas para que cada sesión trabaje en su propio espacio de trabajo y aterrice sus cambios con braid. La web, braid.elffuss.com, también está en castellano.