Quilt
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
Quilt is a command-line tool that tracks which agent wrote which lines in a
shared Git checkout, so multiple AI coding agents can work in one repo at once
and each commits only its own changes.
It captures every edit at the tool boundary, keeps a per-line record of who wrote
what, and reconstructs each agent's own changes at commit time. Git stays the
source of truth. Quilt never calls an LLM or spawns agents, and its state lives in
a .quilt/ sidecar you can delete without touching your repo.
The problem
You want your agents in ONE checkout: one node_modules, one build, one dev
server, one environment to keep working, not a worktree per agent, each with
its own install and its own drift. But on a shared checkout, plain git bites
even when agents work on completely different things: the first git commit -am
sweeps everyone else's uncommitted files into one blob, codegen and lockfile
churn get credited to whoever committed last, and two agents occasionally do
land on the same line, where one silently overwrites the other. None of that
requires agents to be working on the same task. It's just what a shared
checkout does by default.
Quilt makes the shared checkout safe. Every agent commits exactly its own
lines and nothing else: disjoint work stays disjoint all the way into
history, with no ceremony. And when two agents genuinely want the same code,
that becomes a coordinated handoff instead of a silent loss. It holds as you
add agents.
./examples/fleet.sh runs seven agents against one checkout. The two endings:
When two agents want the same file
Fanning out on disjoint files is the easy case. The real test is contention.
A denied claim isn't a dead end. It carries the holder's stated intent and
when their lease lapses:
So the blocked agent builds its granted files while it waits, re-claims after
the holder's commit auto-releases, and layers its change on top of the landed
one. Two clean commits, both changes in the file, nothing lost.
./examples/contention.sh runs the whole sequence on the real machinery.
What it does
- **One shared checkout.** Model humans, agents, and bots as actors editing one
working tree, no worktree per agent.
- **Line-level attribution.** commit --mine commits only your lines, even when
they share a hunk with another actor's.
- **Symbol-level claims.** Reserve utils.js#formatPrice, not the whole file, so
agents editing different functions never contend. Ten languages via tree-sitter;
whole-file claims for the rest.
- **Collision prevention.** A write into code another agent has claimed is denied,
with the holder's stated intent, before any bytes change.
- **Push-awareness.** Claim a symbol that depends on a function another actor is
changing, and Quilt warns you at claim time.
- **Detect and preserve.** If one actor overwrites another's uncommitted lines,
Quilt snapshots the victim's version so nothing is silently lost.
Every commit Quilt produces is an ordinary Git commit. It trusts Git and never
rewrites it, and all state lives locally under .quilt/. No account, no daemon.
Quickstart
That's it. Agents are named automatically: each Claude Code session or MCP
connection gets its own id, so parallel agents are told apart with no setup.
4 terminals, one repo
The whole flow, from a git repo to four agents working at once:
Start sessions from a directory that holds several repos? Run quilt setup
there instead: it wires the workspace root and every repo inside, and each