Skip to main content
Glama

Quilt

CI npm downloads license

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.

Two agents editing one file, plain git vs Quilt. Without Quilt (left), the first agent's commit absorbs the other's work and the history credits one author. With Quilt (right), each change is committed by the agent that made it.

npm install -g @quilt-dev/cli
quilt setup     # capture hooks wired; claim enforcement via Claude hooks or MCP

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:

WITHOUT quilt   1 commit for 7 agents — six got "nothing to commit", their
                work swept into the first agent's blob. a7 silently
                overwrote a1's change to getUser. a1's work is gone.

WITH quilt      6 clean commits, one per agent, each exactly its own lines.
                a7's write into a1's claimed function was denied before any
                bytes changed, with a1's stated intent in the denial.

Related MCP server: cafecito

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:

$ QUILT_ACTOR=builder-flows quilt claim deals.js flows.js --intent "wire flows to deals"
  ✗ denied  deals.js (held by builder-friction)
      builder-friction is: friction pass: rename + archive flags
      their claim lapses 2026-07-04T22:12:05Z unless renewed
  ✓ claimed flows.js

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

quilt setup      # wire Quilt into the repo (capture hooks + optional MCP tools)
quilt doctor     # confirm it's wired and capture is flowing

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:

cd your-repo
quilt setup          # once, ~5 seconds
claude               # terminal 1
claude               # terminal 2
claude               # terminal 3
claude               # terminal 4

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 edit is captured into the repo its file belongs to.

Nothing else. No QUILT_ACTOR, no per-terminal ceremony, nothing to approve: the capture hooks attribute every edit to its session automatically. Watch it live with quilt fleet, and when a session's work is ready, ask it to run quilt commit --mine -m "...". Each commit contains exactly that session's lines, even where two sessions touched the same file. (Claude Code will also offer to enable the optional quilt MCP server for the project; approving it adds the claim/prevention tools, but the hooks protect you either way.)

Watch the fleet

quilt ui opens the same picture in your browser, live: who wrote what (per-actor line counts per file), active claims, who's blocked on whom, and anything that needs a human. Local-only (127.0.0.1), read-only, one command.

The quilt ui dashboard: an escalated collision at the top under "Needs you", actor cards with their claims, a who-wrote-what table with per-actor line counts, and blocked/queued actors.

Prefer the terminal? quilt fleet --watch is the same view as text.

Set an explicit id when you want one that is stable across sessions:

QUILT_ACTOR=auth-agent claude    # this agent's edits are attributed to auth-agent

Then each agent commits only its own lines:

quilt status                     # who owns what
quilt preview --mine             # exact patch that would be committed
quilt commit --mine -m "fix auth redirect"
quilt provenance HEAD            # actor, session, files, hunks, tree

Quilt writes that provenance into the Git commit itself, so it survives normal pushes and fresh clones. Prompt correlation stays local in quilt ui; it is not published into Git history.

In a shared shell, make the committer explicit (quilt --as auth-agent commit --mine ...). Quilt refuses a checkout-global session identity when the dirty tree shows another actor. If a deploy provider requires a recognized Git email, set one once while keeping actor names distinct:

quilt config author.email you@example.com

quilt fleet shows the whole picture: every actor, their claims, and anything that needs a human. See docs/reference.md for the full command list.

Why not worktrees?

A worktree per agent is the usual answer, and for fully independent tasks it works. But every worktree is another environment to build (another install, another build cache, another dev server) and isolation just moves the collision to merge time. Those costs grow with the number of agents; the whole point of a shared checkout is paying for the environment once.

Run fewer agents

Worktree per agent

Quilt

Parallelism

capped low

high

high

Setup per agent

none

full install/build/env × N

none (one checkout)

See each other's in-flight work

n/a

no

yes

Collisions

avoided by hand

surface at merge

prevented, or surfaced live

Clean per-agent commits

n/a

after a merge

yes

Worktrees isolate; they don't coordinate. When agents work the same code at the same time, you usually want them to see each other and account for each other as they go. That is what Quilt does. The two aren't mutually exclusive: worktrees for independent, long-running work, Quilt for agents in the same code at once.

Using it with agents

quilt setup wires the capture hooks and a shared MCP server. On Claude Code the hooks let agents use the built-in Edit and Write tools normally while Quilt records each change's author and blocks a write into code another agent holds, with no protocol for the agent to follow and no setup: each session is named automatically, or carries its own QUILT_ACTOR for a stable id. For other runtimes, the same capture and prevention is available as MCP tools, with each connection named automatically the same way.

See docs/orchestrators.md for Codex, Cursor, Aider, and the difference between process-per-agent and many-agents-in-one-process setups.

Docs

  • docs/orchestrators.md: running a fleet of agents.

  • docs/reference.md: the full command list, how attribution works, and the .quilt/ state layout.

  • bench/: the scenario ladder Quilt is tested against, run with and without Quilt on the same metrics.

Telemetry

One anonymous heartbeat per day: quilt version, OS, Node major, random local id. Nothing else unless you opt in at quilt setup, and never code, paths, repo or actor names. quilt telemetry off, QUILT_TELEMETRY=0, or DO_NOT_TRACK=1 silences everything. Details: docs/reference.md.

Contributing

Contributions are welcome. See CONTRIBUTING.md.

License

MIT

Available Tools

12 tools
claimA

Reserve files BEFORE you edit them — a claim placed before editing is also what BINDS your external edits to your actor id, so claim whole files first as the default. Use a bare path for a whole file, a trailing slash for a whole directory (e.g. convex/_generated/ — right for codegen output), or path#symbol (e.g. utils.js#formatPrice) to reserve one function so others can edit other parts of the same file in parallel (a symbol that does not exist in the file is denied with a suggestion, since it would bind nothing). Pass a short intent (the why) so an actor you block can resolve the collision from it. A denied target is held by another actor — its holderIntent tells you what they're doing, so reconcile from that instead of just waiting.

Inputs: paths (required), wait, actor, queue, +2 more.

commit_mineA

Commit ONLY your owned hunks as an ordinary git commit, leaving every other actor's changes untouched in the working tree. This is how each agent lands its own work in a shared checkout without sweeping up anyone else's. The committed files' claims auto-release, so no separate release call is needed. Preview it first with preview_mine.

Inputs: message (required), actor, paths, includeUnclaimed.

escalateA

Flag a collision you CANNOT reconcile (e.g. two opposed intents on the same line) for a human. Use this instead of forcing a change through when a denied claim's holderIntent conflicts with yours. It shows up under 'Needs you' until resolved.

Inputs: target (required), actor, reason.

get_conflictsA

Show overlapping/shared changes and collisions that were caught.

Inputs: actor.

get_my_changesA

List the changes YOU own in the working tree: the files and hunks attributed to your actor id, with per-file added/removed line counts. The 'what have I done so far' view, scoped to just you. Review your own work with it before committing — use get_status for who-owns-what across all actors, or preview_mine for the exact patch commit_mine would produce.

Inputs: actor.

get_statusA

Show who owns which working-tree changes, plus caught collisions and active claims. Call before editing and before committing.

Inputs: actor.

preview_mineA

Show the exact patch commit_mine would create right now: only your owned hunks as a unified diff, plus the files, whole-file additions, and added/removed line totals. A dry run, nothing is written. Review it before commit_mine to confirm you are committing your lines and nothing else.

Inputs: actor, paths, includeUnclaimed.

quilt_editA

Edit a file through Quilt instead of your raw editor. Replaces the unique old_string with new_string and records WHO authored the change at the moment of the edit — so attribution is exact even when several agents share this checkout, with no claims or reconcile guesswork. Pass why (your ticket/task). Prefer this over a plain file edit when coordinating a fleet.

Inputs: path (required), new_string (required), old_string (required), why, +1 more.

quilt_writeA

Create or overwrite a whole file through Quilt instead of your raw editor, recording YOU as the author of its contents at write time, so attribution is exact even when several agents share this checkout, with no claims or reconcile guesswork. Use this for new files; use quilt_edit to change part of an existing one. Pass why (your ticket/task). If another agent holds this path, the write is denied with their intent so you can reconcile instead of clobbering.

Inputs: path (required), content (required), why, actor.

releaseA

Release your claims on the given paths. Omit paths to release ALL of yours; an empty array releases none.

Inputs: actor, paths.

resolveA

Mark a collision as sewn/handled after you reconciled it — closes its 'Needs you' flag and records the audit trail. Use after you've merged or adapted so the work accounts for both intents.

Inputs: target (required), note, actor, takeFrom.

start_sessionA

Register an actor and start a session in this repo, pinning this server to that identity. Optional: if several agents share one server, skip this and pass actor on each call instead.

Inputs: actor (required), name, type, email.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.1/5.0

    Scored across 12 tools

    Disambiguation4/5

    Most tools have distinct roles: start_session, claim/release, preview_mine/commit_mine, and quilt_edit/quilt_write are clear. However, get_status, get_my_changes, and get_conflicts overlap somewhat since get_status already covers ownership and collisions, which could cause misselection between the overview and specialized views.

    Naming Consistency4/5

    The names are consistently snake_case and mostly verb-first, with clear pairs like claim/release and escalate/resolve. Minor deviations exist: bare imperative verbs sit alongside get_* noun-object names, and quilt_edit/quilt_write use a different prefix pattern, but the naming remains predictable overall.

    Tool Count5/5

    Twelve tools is well-scoped for the multi-agent collaboration domain. Each tool maps to a distinct workflow step—session setup, inspection, claiming, editing, committing, and conflict resolution—without obvious bloat.

    Completeness4/5

    The set covers the full lifecycle: start a session, inspect ownership, claim files, edit/write, preview, commit, resolve conflicts, and escalate. Minor gaps like no explicit revert/abandon-changes tool exist, but agents can work around them with release and raw git operations.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Enables multiple AI agents to collaborate on the same git repository by coordinating work via a shared claims branch, detecting file conflicts before they happen.
      9
      44 PyPI
      PolyForm Noncommercial 1.0.0
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI agents to coordinate on a shared repository using commutativity-proven parallel landing and regenerative merge, avoiding rebase conflicts through symbol-level leases.
      Apache 2.0
    • A
      license
      Not graded
      quality
      C
      maintenance
      Multiplayer coordination for AI coding agents: Claude Code, Codex CLI and Cursor share one room per repository. An agent claims a path glob before it edits and a conflicting claim is refused at claim time, so collisions are prevented rather than resolved at merge. Metadata only — source code and diffs never leave the machine.
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables multiple AI coding agents to collaborate on the same Git repository without conflicts through isolated worktrees, file locking, automated test verification, and a serialized merge queue.
      8
      MIT