Weft Coordination Protocol (WCP)
Weft coordinates coding agents while they edit—not only when they open a pull request. Agents submit tool-call edits to a per-repository sequencer. The sequencer validates each edit against accepted changes since the agent's base and returns actionable diagnostics to the agent through its native hooks. Humans see the same event stream and can approve, pause, message, undo, or inspect evidence.
The goal is to make concurrent agent work safer without file locks or requiring agents to stop and wait for a human merge. WCP is the harness-neutral wire protocol; Weft is its Cloudflare-backed implementation and set of adapters.
Live demo: demo.weft.mx — the web UI over the real event logs of the dogfood repo and the demo runs, public and read-only (no login).
Status: research/demo implementation; WCP v0.1 is a draft, not a published standard. See the design, protocol specification, and try it yourself.
Plain-language one-pagers: Protocol · Platform · Product.
Architecture
flowchart LR
subgraph agents[Agent workspaces]
H[Claude Code / Codex / OpenCode / Hermes] --> A[Harness adapter + analyzer]
end
A -->|check / edit / events| G[Gateway]
G --> C[Repo coordinator\nDurable Object + SQLite\nordered WCP log]
C -->|verdicts / diagnostics / inbox| A
C --> Q[Queues]
Q --> W[Workflows\nprocess / select / land / revert]
W --> S[Sandbox containers\nmerge / tests / agent]
W --> R[Artifacts + evidence]
G --> D[D1 index]
HN[Human web / iOS clients] <-->|observe / human actions| G
Adapters translate harness hooks into WCP requests; the protocol and coordinator do not depend on any one coding agent. Artifacts hosts repos and candidate forks. A single Durable Object per repo assigns event order and validates edits. Workflows orchestrate revision processing, candidate selection, landing, and revert. Sandboxes perform git and test operations without exposing credentials to the agent container. D1 indexes tasks, changes, revisions, and evidence; R2 stores run artifacts. The live demo and preview environment are described in the runbook.
Why Cloudflare
- Workers provide the gateway, UI, preview service, and product integrations close to the coordination API.
- Durable Objects with SQLite give each repository one authoritative ordered log, state machine, and submit queue.
- Artifacts supplies the trunk and isolated candidate forks.
- Queues and Workflows make push processing, tests, selection, landing, and recovery durable and retryable.
- Containers / Sandbox SDK isolate git, builds, tests, and optional agent runs; credentials are mediated outside the container.
- D1 indexes cross-repo tasks and evidence; R2 retains logs, transcripts, and screenshots.
- Workers AI, AI Gateway, and Browser Rendering support risk/review assistance, attributable model traffic, and visual evidence. They are supporting services, not required to understand the core WCP event model.
The implementation is evolving; the design distinguishes core, strong, and optional product integrations. No production deployment is implied by this repository.
Try it
In any git repository, with Node.js 22+:
npx @celador/weft
No login and no account. It runs locally by default: it starts a Weft gateway on your machine
(127.0.0.1), so your code and diffs never leave it. It adds Weft's hooks for the coding agents
you have (Claude Code, Codex, Cursor, Copilot CLI, OpenCode, Gemini, Antigravity) to every
checkout, offers a second worktree so two agents can work side by side, and opens your live feed.
Agents with MCP but no hooks (Zed, Warp, JetBrains, Xcode) use npx @celador/weft mcp (tools
weft_check, weft_claim, weft_status, weft_inbox, weft_feed, weft_history,
weft_negotiate, weft_gate; weft_history says why earlier changes to a symbol were reverted
or refused). Local is
free for personal use; using it at work needs a commercial license
or Pro. The source is open (AGPL-3.0; the protocol and plugins are MIT). A hosted team space on Weft's Cloudflare gateway is an option
(--hosted; 5,000 agent events a month free, Weft Pro per user for teams); deploy puts the gateway in your own Cloudflare
account. The npm package is @celador/weft
(the name weft is taken on npm). No repo handy? npx @celador/weft demo makes a two-file
sample repo and prints the two prompts that make your agents collide. Details:
docs/try-it.md and docs/hosted.md.
Install it where you already work: