# quilt

quilt lets several agents work on one repository at once, each in a thin view of its own. On seven WordPress changes, run by script, it added 1 MB where a git worktree each added 341 to 583 MB.

Alpha · d/rksci labs · Published 2026-11-29 · Tags: Autonomous Agents, Git, Developer Tools, Evaluation

## Four agents, one checkout

quilt gives each agent its own branch and a thin view of the one repository, so agents can work at the same time without overwriting each other. It is an alpha. The WordPress figures come from scripted runs with no model. Real agents have been run on smaller tasks, once each, and quilt was not always the faster tool.

## What it is for

Agents that share one checkout overwrite each other. A `git worktree` each fixes that, at a price: every worktree is a full copy with its own install, the copies drift from the main branch, and a conflict shows up at merge time, when the reason for it has gone.

Figure: Left, four small sheets hang over one repository with a single dotted block of dependencies. Right, four tall copies, each with that block.

[quilt](https://github.com/drksci/quilt) aims to remove those costs on an existing repository in any language, and to leave no trace. It adds no file, hook or service to the repository. Its state lives in `.git`, and its branches and merges are ordinary Git.

## How it works

A request is cut up by a person or an agent. quilt takes the result and runs it in four moves.

Each agent works on an ordinary Git branch, in a view: a layer over the one repository that holds only what that agent changed, with installed dependencies already in place. On Linux the view is an overlay. Elsewhere it is a clone on APFS, Btrfs or XFS, or a plain copy.

The part of a change that more than one agent depends on goes in first, with its final signature and a stand-in body. This is a patch. Other agents call it from the start, and their code builds before the real body exists.

A branch that only fills a body merges at once. A branch that changes a signature runs the check first, and the branches that call it are told to update. The main line never carries an open patch.

Each command in a view runs in a network namespace of its own, so `127.0.0.1` belongs to that command. Where a namespace cannot be made, the command runs with the machine's ports and quilt says so once.

A patch is marked in the source by a `quilt:patch` comment that names the branch that will fill it. The marker is tracked, so a patch is still found after its function is renamed or moved, and a branch cannot merge with its own patch open.

```php
function wp_remove_surrounding_empty_script_tags( $contents ) {
	// quilt:patch script.strip
	return $contents; // stand-in
}
```

Figure: Four dashed boxes stacked in one file, each a function signature over a pink quilt:patch marker, each with an arrow to a box for one agent.

Two test suites that start a server on one fixed port cannot run at once on one machine, and a worktree each does not change that. The clash cost quilt its slowest run, reported below.

Figure: Left, two agents point at one dotted box marked 127.0.0.1:8000. Right, each agent points at a box of its own with the same address.

| Command                           | Does                                                           |
| --------------------------------- | -------------------------------------------------------------- |
| `git quilt run BRANCH -- COMMAND` | Runs a command or an agent in a branch's view                  |
| `git quilt status`                | Shows what each branch changes, and where the branches overlap |
| `git quilt merge BRANCH`          | Merges a branch, checking first if a signature changed         |
| `git quilt plan FILE`             | Runs a plan: outline, parallel fills, merges                   |

## What the scripted runs measured

Seven changes from the history of WordPress (6,989 files), three of them security fixes. Each was loaded at its parent commit and split into four parts by file. A script applied each part, so no model was involved and the figures are the tools' own cost. One run each, on 28 November 2026, on one Linux machine with 4 cores.

Figure: Seven rows, each a long dotted bar for git worktree between 341 and 583 MB over a pink sliver marked 1 MB for quilt.

| Change               | Tests passed | Disk, worktrees | Disk, quilt | Time, worktrees | Time, quilt |
| -------------------- | ------------ | --------------- | ----------- | --------------- | ----------- |
| Script-tag helper    | 207 of 207   | 414 MB          | 1 MB        | 4.0 s           | 2.8 s       |
| Secrets API          | 63 of 63     | 583 MB          | 1 MB        | 5.4 s           | 5.4 s       |
| Password hashing     | 195 of 195   | 490 MB          | 1 MB        | 5.9 s           | 2.7 s       |
| theme.json check     | 20 of 20     | 341 MB          | 1 MB        | 6.6 s           | 2.2 s       |
| Ability capabilities | 180 of 180   | 543 MB          | 1 MB        | 6.3 s           | 3.0 s       |
| Unicode email        | 300 of 300   | 524 MB          | 1 MB        | 5.5 s           | 3.1 s       |
| Template revisions   | 22 of 22     | 414 MB          | 1 MB        | 5.2 s           | 2.6 s       |

quilt was faster in six of seven and tied on the Secrets API. Setting up each worktree took 1.8 to 4.4 s, and a view needs no set-up. A scripted run measures set-up and merge, so the time columns say little about a real session.

The 1 MB is the size of the views' own files. Read from the filesystem's used space, an overlay view costs about 6 MB, and what the difference is has not been traced.

## What real agents did

Real agents have been run three times, each on something smaller than the WordPress set, each once. All used Claude Code with Sonnet 5.5, four agents to a task.

| Task                               | Worktrees                                | quilt                                    |
| ---------------------------------- | ---------------------------------------- | ---------------------------------------- |
| Disjoint files                     | 9 s, $0.23, 0 refused, main line passes  | 11 s, $0.25, 0 refused, main line passes |
| Four patches in one file           | 55 s, $0.53, 3 refused, main line passes | 24 s, $0.37, 0 refused, main line passes |
| Two agents rewrite one function    | 72 s, $0.60, 3 refused, main line passes | 39 s, $0.40, 1 refused, main line passes |
| A signature changes under a caller | 14 s, $0.29, 0 refused, main line fails  | 34 s, $0.36, 0 refused, main line passes |

The four tasks cost $1.65 with a worktree per agent and $1.39 with quilt. In the last one, the two worktree branches merged cleanly and left the main line failing. quilt merged the signature change first and sent the agent whose test used the old signature back with a note, which took 20 s longer and left the main line passing.

On a larger task, a proxy change to httpx, quilt was slower: 229.1 s against 72.2 s, with 3 MB of disk against 94 MB and $0.83 against $0.64. Both arms passed 76 of 79 withheld tests. Two quilt agents each lost 120 s to a test command that did not return, because two copies of httpx's suite were started at once and the suite binds one fixed port. quilt's own merges and checks took 8 s of the 229. The same clash can hit a worktree per agent, and in that run it did not, because the agents ran their tests at different moments.

One WordPress change, the script-tag helper, was run once with four real agents. The project does not count it: the request did not name the function the withheld tests call, so both tools ended with the same 7 of 207 tests in error. What it did measure was 512 MB against 2 MB, 92.5 s against 93.8 s, and $0.62 against $0.81.

Real agents on all seven WordPress changes, more than once each, so that a stall such as the shared port can be told from quilt's own cost.

## What is not known

The loop (work on a branch in a view, save, merge, plan) runs and is tested on Linux. The released binaries were run on Linux and macOS, x86-64 and ARM, by a smoke workflow that passed on all four: the `npx` line, the install script, and a branch worked on and merged in a view. No person has used quilt on a Mac, nothing has been measured on one, and the overlay view is Linux only.

Private ports have the least coverage. They were tested on Linux, as root and as an ordinary user, on one version of `passt`. They were not run on macOS, where the command falls back to shared ports, and not under the AppArmor profile Ubuntu ships for `passt`. The probe that decides whether to use them fails closed, so the expected result there is a fallback, and that is untested.

The patch markers are untested against a formatter that breaks a marker across lines, and against Git older than 2.38. No harness other than Claude Code and no model other than Sonnet has been run.

The seven WordPress changes measured on a Mac, where the view is a clone and not an overlay.

quilt is a d/rksci labs alpha, at 0.1.2. Every number here is from the README and status page of [drksci/quilt](https://github.com/drksci/quilt) at commit `3688ba4`, where each run has its method and its data. The four plates are redrawn here from that project's figures.