jj-musubi: distributed workspaces for jj

Commit or rebase on your laptop. Your changes immediately appear on your devbox.

jj-musubi keeps a Jujutsu repository in sync across all of your machines while you work. Commit, rebase, fetch, or push on one, and a second or two later the result is on every other. Every machine’s changes show up in jj log on all the others, up to the last jj command you ran, so the change you were halfway through on your laptop is sitting on your devbox, ready to build on.

Close your laptop halfway through something and pick it up on your devbox. Open the laptop the next morning, and it catches up immediately. Set agents loose on three machines, and every one of them can see what the others are doing (and so can you).

Git can’t do this. Neither can jj on its own. Engineers at Meta (Commit Cloud) and Google (an internal jj server) have had something like it for years, and once you’ve worked that way, going back to pushing work-in-progress branches around is miserable. musubi gives you the same thing on your own machines, over plain ssh.

cargo install --locked jj-musubi
Set up a hub in three commands

laptop · ~/src/fetcheryou, typing

laptop ~/src/fetcher ❯ echo "max_retries = 3" >> fetcher.toml
laptop ~/src/fetcher ❯ jj commit -m "Retry failed fetches"
Working copy  (@) now at: tzmkxpwr 768173d7 (empty) (no description set)
Parent commit (@-)      : xnwvsyzr a56e0850 Retry failed fetches
laptop ~/src/fetcher ❯ jj git fetch
remote: Enumerating objects: 4, done.
remote: Total 3 (delta 1), reused 0 (delta 0), pack-reused 0 (from 0)
bookmark: main@origin [updated] tracked
laptop ~/src/fetcher ❯ jj rebase -s xnwv -d main
Rebased 2 commits to destination.
Working copy  (@) now at: tzmkxpwr f2479160 (empty) (no description set)
Parent commit (@-)      : xnwvsyzr 9843da40 Retry failed fetches
Added 1 files, modified 0 files, removed 0 files

hub · musubi topon devbox

musubi top: 1 hub, every 1s
This machine's daemon is running, serving 1 repository.
Hub /tmp/musubi-demo/devbox/musubi-hub: up 37s, musubi 0.5.0, 1 hive.
HIVE                                                      HEAD   IN/s       OUT/s      OPS     COMMITS  MACHINES  ISSUES
fetcher                                                   #9     0 B/s      0 B/s      10      8        2/2

fetcher since the hub started:
  received 18 KiB and sent 19 KiB
  10 operations came in, with 8 commits, and 11 went out
  9 pushes moved the head, and 0 found it moved already
MACHINE          HEARD     AT      MUSUBI   STATE
devbox           6s ago    #9      0.5.0    up to date
laptop           6s ago    #9      0.5.0    up to date

AGO       HEAD    FROM             OPS   COMMITS  WHAT
7s ago    #9      laptop           1     2        rebase commit a56e085035d631fc64828926023ca59b27d24ff5 and descendants
14s ago   #8      laptop           1     1        fetch from git remote(s) origin
21s ago   #7      laptop           1     2        commit b388b8b3304cb856396e130217eb252c1c638bec
21s ago   #6      laptop           1     1        snapshot working copy
36s ago   #5      devbox           1     1        new empty commit
36s ago   #4      devbox           2     0        reconcile divergent operations
36s ago   #3      laptop           1     1        snapshot working copy
36s ago   #2      laptop           1     0        musubi: hive settings changed
q quit   ↑↓ choose a hive   r refresh   + slower   - faster

devbox · ~/src/fetcher

@  mpzxznkt you 2026-11-02 13:50:09 default@ 8f275b09
│  (empty) (no description set)
│ ○  tzmkxpwr you 2026-11-02 13:50:38 laptop/default@ f2479160
│ │  (empty) (no description set)
│ ○  xnwvsyzr you 2026-11-02 13:50:38 9843da40
│ │  Retry failed fetches
│ ◆  wtrvuttw alice 2026-11-02 13:50:09 main db5699ba
├─╯  Log how long each fetch takes
◆  wwtnyuok you 2026-11-02 13:50:08 624497da
│  Release 1.4.0
~
I edit, commit, fetch, and rebase on my laptop. Nobody is touching the devbox: it’s just showing jj log every half second. Underneath, musubi top on the hub shows each change go by.

Picking up where you left off, before and after

Here’s how you might move unfinished work from your laptop to a devbox today, with jj and a git remote:

Before

# -c @- makes a bookmark for the change you just
# finished, named push-kkmpptxzwqzr, and pushes it.
laptop ❯ jj git push -c @-

# Fetch that bookmark, then start a new change on it.
devbox ❯ jj git fetch
devbox ❯ jj new push-kkmpptxzwqzr@origin

You’ve now got a push-kkmpptxzwqzr branch on GitHub until you remember to delete it, and the devbox gets only what you pushed. Whatever you were partway through on top stays behind on the laptop.

With musubi

# Start a new change on top of the laptop's current one.
devbox ❯ jj new laptop/default@

That’s all. laptop/default@ is the change your laptop’s default workspace is on, as of the last jj command you ran there. musubi keeps it current on every machine, so you can build on it from anywhere.

Things you couldn’t do before

Edit on your laptop, test on your devbox

A laptop is a fine place to write code and a poor place to run a big test suite. With musubi, you can keep writing code on the laptop and run the tests on the devbox, against exactly the code you’ve got, without committing or pushing anything first.

On the devbox, jj new laptop/default@ gives you the files the laptop had at its last jj command. Run the tests. Edit some more on the laptop and run jj st there (jj only notices edits when one of its commands runs). Back on the devbox, jj workspace update-stale brings in those edits, and you run the tests again.

# Once: build on whatever the laptop has.
devbox ❯ jj new laptop/default@
devbox ❯ make test

# Edit some more, and let jj see it.
laptop ❯ jj st

# Pick up the edits, and test again.
devbox ❯ jj workspace update-stale
devbox ❯ make test

Close the lid, and the work carries on

Shut your laptop halfway through a change. Your devbox already has everything up to your last jj command, with the change your laptop was working on in jj log as laptop/default@, so an agent there can pick it up with jj new laptop/default@ and keep going while the laptop sleeps.

Open the laptop again later, and it catches up immediately, agent’s work and all. You never have to wonder which machine is behind.

# The laptop is asleep, but the two changes it
# was working on are already here.
devbox ❯ jj log
@  vruxwmqv default@ (empty)
│ ○  kkmpptxz laptop/default@
│ │  Retry failed fetches
│ ○  ysqnvlpw
├─╯  Split the fetcher's config
◆  qpvuntsm main Release 0.4

# Carry on from where the laptop stopped.
devbox ❯ jj new laptop/default@

Every agent, in one jj log

Run Claude Code on your laptop and Codex on a couple of devboxes, all in the same repository. Each agent’s changes show up on every machine as soon as it runs a jj command, and the one it’s working on is labelled with its machine and workspace, such as devbox/default@. One jj log tells you what all of them are up to.

Review an agent’s work from wherever you happen to be, or hand it to an agent on another machine with jj new gpu/agent-2@. You will almost never need to ask “which machine was that on?”

@  vruxwmqv default@ (empty)
│ ○  mzlkrtno laptop/agent-1@
├─╯  Port retry logic to the uploader
│ ○  wsytqnpv devbox/default@
├─╯  Add a fuzz target for the parser
│ ○  tqxoyzmw gpu/agent-2@
├─╯  Bisect the flaky integration test
◆  qpvuntsm main Release 0.4

Fetch once, push once

Run jj git fetch on any machine, and they all have the new main@origin. Push from the devbox, and the laptop shows the bookmark you pushed, along with its @origin.

devbox ❯ jj git fetch
bookmark: main@origin [updated] tracked

laptop ❯ jj log -r main
◆  rlvkpnrz main Bump tokio to 1.48

Three commands to set it up

One machine that’s usually on, such as a devbox or a home server, runs a hub. Every other machine reaches it over ssh: if ssh devbox works, so does musubi.

  1. Start a hub

    On your devbox, or any machine that’s usually on.

    musubi hub
  2. Share a repository

    In the repository on your laptop. --hub takes the name you ssh to the hub’s machine by.

    musubi create --hub devbox
  3. Add your other machines

    In the same repository on each other machine. Where a machine has no copy of it yet, musubi clone makes one.

    musubi join --hub devbox

musubi never writes to your working-copy files: if another machine edits the files in the change you’re on, jj tells you your working copy is stale, and jj workspace update-stale catches it up when you’re ready.

Why you can trust it with your work

Keeping several copies of a repository in step, when any of them can change at any moment and any machine can vanish mid-conversation, is the kind of problem that’s easy to get almost right, which is to say wrong.

So the sync protocol is written down in the Lean theorem prover, its safety and liveness properties are proved, and the Rust code is checked against that model step by step. Every night, generated tests drive two or three real repositories with real jj commands while injecting faults: machines crash partway through a sync, the hub restarts or loses the tail of its history as a power cut would, and replies go missing. Every repository must still load after every step, and at the end every machine must agree on every commit, change id, bookmark and tag, and match a reference repository that replays the same history with jj’s own merges. A failure shrinks to a minimal case that replays exactly. How musubi keeps your work safe has the details.

Why not Syncthing, or a git remote?

Syncing a repository with Dropbox or Syncthing shares the working copy too, so machines fight over one checkout, and jj’s own documentation warns that you can corrupt the repository that way. Pushing through a git remote carries only the commits you’ve put a bookmark on, and only when you remember. How musubi compares goes through the alternatives in more detail.

Give it a try

Install musubi on your laptop and on a devbox, or any other machine that’s usually on. Start a hub on the devbox, share a repository from the laptop, and join it from the devbox. Then make a change on the laptop, run a jj command, and watch it turn up on the devbox. If something surprises you, let me know.