上百个 Agent 同时写代码,该怎么协作?Cloudflare 想让你造下一代 Git 平台
Artifacts 把仓库变成可编程的基础设施:分配独立任务、保存上下文、接上审查与部署。真正要设计的,是这些并行改动如何汇合。
提到写代码,很多人会想到 GitHub。在过去十几年里,许多开发协作工具围绕“人类程序员”建立起来的:写完一段代码,存成一个记录(Commit),开个平行分支(Branch)去试新功能,最后发起一个合并请求(Pull Request,简称 PR),叫上同事帮忙审查(Code Review),没问题了再合进主代码库。
这套模式在人类协作时代运转得极好。但如果今天写代码的主力不再是人类,而是成百上千个同时处理任务的 AI Agent,现有的 GitHub 还管用吗?
Cloudflare 针对这个问题给出了他们的答案,并宣布旗下专为 AI 设计的 Git 基础设施 Artifacts 正式进入公测阶段,同时面向全球开发者发起挑战:用 Cloudflare 的底层能力,探索多 Agent 同时开发时需要怎样的协作平台。
简单来说,Artifacts 是一套云端文件系统,支持标准 Git 操作,可以用程序管理仓库,并保留文件的历史版本。它作为面向 Agent 协作的代码底座,允许开发者用程序按需为各个 Agent、会话或任务创建独立的仓库,保存代码和 Agent 的任务背景、说明等上下文。其主要功能特点包括:
- 通过 Worker 代码直接控制仓库:借助专门的绑定接口,可以直接在程序逻辑中创建或派生(fork)仓库、读取上下文文件、检查提交并按仓库范围签发 Git Token,把这些仓库操作接入任务流程。
- 集成 Workers 构建与分支预览:仓库关联构建服务后,推送到生产分支可自动触发构建与部署,推送到其他分支则自动生成独立的预览环境,便于在上线前安全测试改动。
- 订阅仓库事件:支持监听仓库的创建、派生、删除、推送与拉取等事件,以便在代码变更后自动触发后续流程(如拉起代码审查 Agent、执行 CI 任务或部署)。
- 选择数据存储与处理区域:在创建命名空间时可指定数据存储与处理区域(如美国或欧盟),该空间下的所有仓库都会自动遵循相应的区域限制。
- 查看仓库运行指标:可在控制台查看或直接查询每个仓库的操作总数、拉取量、推送量以及错误率,便于监控仓库实际调用状况并快速排查异常。
多个 Agent 一起写代码,难点会转向协调与审查
要理解 Cloudflare 为什么要做这件事,先得看看现有的开发模式在面对海量 AI 时遇到了什么尴尬。
在传统的软件团队里,提交、审查和合并围绕人与人的协作展开,人类的精力和注意力是极其稀缺的:代码不能乱改,需要审查来控制改动风险。
但现在,随着各类编码 Agent 的爆发,情况完全变了:
- 并发规模爆炸:以前一个项目十个人维护,以后一个项目可能有上百个 Agent 同时在修 Bug、加新功能、补测试用例、升级依赖库。改动不断增加时,人类需要知道该优先审哪些,以及如何比较多个方案。
- 代码冲突与协作混乱:当几十个 Agent 针对同一个代码库的不同逻辑进行修改时,谁知道其他 Agent 正在改什么?如果两个 Agent 改了同样的文件,谁来仲裁?
- “为什么修改”比“修改了什么”更难追溯:单看改了哪几行(Diff),未必能知道任务背景、约束和取舍;这些上下文同样需要保存,方便后续接力。
Cloudflare 的判断是,面向人的协作模式需要进一步适应大量 Agent 同时开发。
核心基石:Artifacts 到底是个什么东西?
很多人第一反应可能会问:Cloudflare 难道是要做一个网页版界面去跟微软 GitHub 抢用户吗?
并不是。Cloudflare 做的是更底层的事情。
今年早些时候,Cloudflare 推出了名为 Artifacts 的底层服务。简单来说,它是一个具备版本控制能力、支持 Git 操作、Cloudflare 称可扩展至百万级仓库的云端文件系统。
它提供可以由程序调用的仓库操作:
- 仓库可以由程序创建或分叉:开发者可以为每个任务、会话、用户或 Agent 创建仓库,让并行工作拥有独立的版本历史。
- 存代码,也存 Agent 的思考上下文:不仅保存源代码的历史版本,还能把 Agent 运行时的提示词、对话记录、上下文背景一并持久化保存。
- 原生兼容 Git 语法:Agent 不需要学任何花哨的新接口,它原本就熟悉的
git clone、git push、git fetch等操作,Artifacts 原生全部支持。
在过去一段时间里,已经有许多 AI 编程工具(包括通过自然语言让 AI 生成项目的 Vibe-coding 平台)用 Artifacts 来保存用户创建的项目,或者让多个 Agent 在相互隔离的独立仓库中从同一起点出发各自尝试,最后再比对结果。
而在最新的公测版本中,Cloudflare 又给这套底座装上了几块至关重要的关键拼图。
推送代码后,生产分支部署,其他分支生成预览
代码放进仓库后,还需要构建和部署,才能查看实际运行效果。
现在,Artifacts 可以通过仓库连接接入 Workers Builds:
- 生产分支自动发布:只要你或者 Agent 往生产分支(Production Branch)推送了代码,Cloudflare 会自动完成构建,并把更新后的 Worker 部署到线上。
- 特性分支自动生成独立预览(Workers Previews):如果 Agent 是在一个临时分支上开发,推送代码后,系统会自动创建或更新一个专属的预览环境。这个环境带有一个独立的专属访问链接,用于在正式上线前测试改动,不仅人可以直接点开看,其他负责测试的 Agent 也能直接访问该链接进行验证。
无论是一个新项目直接保存在 Artifacts 里,还是把现有的 Worker 绑定到仓库,整个开发到上线的流水线都被高度压缩到了 Git 推送这一动作中。
在 Worker 里直接用代码操控 Git 仓库
这项能力让任务分配中的仓库操作可以写进程序。
Cloudflare Workers 是运行应用和自动化代码的平台。在 Worker 中配置 Artifacts Binding(环境绑定)后,开发者可以直接在 Worker 脚本里,通过绑定对象调用仓库接口。
比如下面这段官方示例代码,展示了当系统接到一个新任务时,如何自动为 Agent 派发独立环境:
// 1. 获取主项目仓库
using project = await env.ARTIFACTS.get("my-project");
const { defaultBranch } = await project.info();
// 2. 为当前任务分叉(Fork)出一个独立仓库
const workspace = await project.fork(`task-${crypto.randomUUID()}`);
// 3. 读取主分支里的说明文件(给 AI 看的指令)
using repo = await env.ARTIFACTS.get(workspace.name);
const instructions = await repo.readFile({
ref: defaultBranch,
path: "AGENTS.md",
});
// 4. 将仓库地址、鉴权 Token 和任务指南准备成任务信息
const agentTask = {
remote: workspace.remote,
token: workspace.token,
instructions: instructions ? await instructions.text() : null,
};
用大白话来翻译一下这个过程:
- 开辟独立工位:主项目在那里不动,Worker 直接用随机生成的任务 ID 分叉出一个新仓库(workspace)。Agent 可以在里面放手大改,就算改崩了也完全不影响原本的代码。
- 提取上下文锦囊:Worker 直接深入仓库读取
AGENTS.md,把写给 AI 的项目规范和背景指令拿出来。 - 提供仓库访问凭据:拿到分叉仓库的 Git 访问凭据(Token)和远程地址(Remote),把代码和任务说明一股脑交给 Agent。
上述仓库操作可以由代码完成;agentTask 只是准备好的任务信息,真正调用 Agent 的步骤还需开发者接上。
监听每一次变动,自动启动 AI 代码审查
当 Agent 改完代码、把代码推回仓库时,后续流程如何衔接?
Artifacts 内置了一套事件订阅机制(Event Subscriptions)。只要仓库发生变动——不管是仓库被创建、分叉、删除,还是有人执行了 Push、Clone、Fetch,系统都会自动向外广播一个事件消息。
你可以写一个 Worker 来专门接收这些消息。例如,官方给出了一个“代码推送就自动触发 Review”的例子:
export default {
async queue(batch, env) {
for (const message of batch.messages) {
const event = message.body;
// 只关注“代码被推入仓库”的事件
if (event.type !== "cf.artifacts.repo.pushed") continue;
// 自动启动一个后台审查工作流(Workflow)
await env.REVIEW_WORKFLOW.create({
params: {
namespace: event.source.namespace,
repo: event.source.repoName,
ref: event.payload.ref,
commit: event.payload.after, // 最新提交的 Commit 哈希值
},
});
}
},
};
这段代码把“推送”接到“启动审查流程”上:Worker 筛选推送事件,再把命名空间、仓库、分支引用和新提交传给 REVIEW_WORKFLOW。审查流程据此知道要检查哪个版本。
至于怎样调用审查 Agent、运行测试、处理冲突以及批准合并,仍由开发者在自己的 Workflow 中实现。事件订阅提供的是触发与衔接能力。
为仓库选择数据区域,并观察操作是否报错
除了开发流,企业级开发最关心的两件事是“数据放在哪里”以及“仓库操作是否失败”。
1. 数据存储与处理区域(Data Jurisdiction)
很多企业(尤其是欧洲企业)对数据出境有严格的法律限制。现在,在通过 API 创建命名空间时,只要指定数据区域参数(例如 "jurisdiction": "eu"),该空间下创建的所有代码仓库都会继承对应的美国或欧盟数据存储与处理限制。
curl "https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/artifacts/namespaces" \
-H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
--json '{"namespace":"my-eu-namespace","jurisdiction":"eu"}'
2. 仓库指标可视化监控
当几百个 Agent 不停拉取、推送代码时,光靠人眼盯命令行肯定抓瞎。Cloudflare 在控制台里直接内置了指标面板,展示每个仓库的总操作量、拉取(Pulls)、推送(Pushes)、报错数以及错误率。
开发者不仅能在网页上看图表,还能直接通过 API 调取这些监控指标,接入自己团队的报警大盘。
商业化与 2.5 万美元平台额度奖励:一起设计“下一代 GitHub”
随着公测的展开,商业化计划也已明确:Artifacts 的收费将基于仓库的操作次数(Operations)以及实际存储的数据量。这项计费将在 10 月中旬正式生效。
不过,最引人注目的还是 Cloudflare 同期发起的开发者挑战赛:
- 目标:用 Cloudflare Workers 和 Artifacts 打造你心中的“AI 时代 Git 平台”。
- 硬性底线:官方明确表示,不希望参赛作品只是给现有 GitHub 模式加上 Agent,项目至少要能支撑多个 Agent 同时并发修改代码。在此基础上,去重新思考仓库、分支、合并冲突以及保留决策上下文的形式。
- 参赛方式:提交 5 到 10 分钟的演示视频、使用开源协议(MIT、Apache 或 BSD)的完整源代码以及运行部署指南。比赛截止时间为 10 月中旬。
- 奖项:评选出的前三名团队(每队最多 2 人)将获邀飞往旧金山,参加 Cloudflare Connect 大会现场登台展示;冠军团队还将获得 25,000 美元的 Cloudflare 平台额度及 Connect 周一的 VIP 讲者晚宴邀请。
目前,拥有 Workers Paid 付费计划的用户均可在控制台直接开启 Artifacts 公测体验。在官方博客末尾,Cloudflare 还提供了一个一键复制提示词的入口,供开发者引导自己的编码 Agent 自动初始化 Artifacts 仓库并推送代码。
底座已提供,协作规则仍是开发者要做的产品
Artifacts 提供可编程仓库、版本存储、事件触发及部署连接。开发者可以据此保存会话上下文、让多个 Agent 从同一起点各自修改,再比较结果。
真正需要设计的是这些结果如何汇合:任务怎样分配,改动怎样审查,冲突怎样处理,以及为何选择某个方案。把仓库分叉出来能隔离修改,却不会自动替团队解决这些协作问题。Cloudflare 的比赛正是邀请开发者构建这一层。
多个 Agent 一起写代码,改动该怎么汇合?
代码仓库记录文件版本;分支用于尝试改动,合并请求交给同事审查。大量 Agent 同时开发时,这些改动仍需要协调与筛选。
一个项目由上百个 Agent 同时维护,就需要知道谁在改什么、怎样审查不断增加的改动。只看文件差异,还不够解释任务背景和为什么这么改。
Artifacts 是支持 Git 操作的版本化云端文件系统。开发者可以用程序为任务创建或分叉仓库,同时保存代码和任务上下文。
Worker 可以运行分配任务的代码。下列能力可以组合使用;调用 Agent、测试与合并规则由开发者接上:
数据放在哪里,仓库操作是否失败
创建命名空间时可选择美国或欧盟,旗下仓库继承数据存储与处理区域限制。控制台和查询接口提供总操作量、拉取、推送、错误数及错误率,帮助发现仓库调用失败。
底座已就绪,真正的产品是“多 Agent 协作规则”
Cloudflare 提供的 Artifacts 本质上是可编程的 Git 原语集合。分叉仓库能够解决改动隔离,事件广播能够实现自动唤醒,但它们不会自动替开发团队决定代码该如何合并。
We want you to build the next Git platform on Cloudflare
Cloudflare is hosting a competition to see who will build the next Git platform for an era of AI agents. Artifacts is in open beta, with Workers bindings, data jurisdiction controls, and event subscriptions for repository changes.
GitHub was built for a world where humans write code, organize it into repositories, and collaborate through branches, commits, issues, and pull requests.
But the next generation of software is going to be built differently because it is going to be built by a different kind of developer: agents.
Agents are already writing more code than ever before — they’re fixing bugs, building features, writing tests, reviewing changes, updating dependencies, and doing the routine maintenance required to keep an application running.
So in this new world where you have hundreds, or even thousands, of agents working on the same codebase at the same time, what does the foundation look like?
How do agents know what other agents are working on? What happens when they make conflicting changes? How do you review everything they produce? How do you keep track of not just what changed, but why a change was made?
And so the burning question is: What does the next GitHub look like?
We want you to help us answer it, by building it out.
Earlier this year, we launched Artifacts, a versioned filesystem that speaks Git and can scale to millions of repositories. From the start, we designed Artifacts as a set of programmable primitives that developers could use to build their own products, workflows, and abstractions.

Artifacts provides the foundation: repositories that can be created and forked programmatically, versioned storage for code and agent context, and the Git operations agents already know how to use.
With that foundation in place, you can focus on the layer above it: how agents coordinate their work, how changes are reviewed and merged, and what the developer experience should look like when hundreds or thousands of agents are working on the same codebase.
That is the layer we want you to build.
Now that Artifacts is in open beta, we’re holding a competition to see who can build the next Git platform on Cloudflare using Workers and Artifacts.
Artifacts is in open beta. Here’s why you should build on it
When we launched Artifacts, our goal was to make it possible to create a repository for every agent, session, task, or user — and to do that at the scale agents require.
Since then, we’ve seen developers use Artifacts in a range of ways: Vibe-coding platforms are using it to store the projects their users create. Developers are using it to persist the code and context from agent sessions. Others are creating isolated repositories, so multiple agents can safely work from the same starting point and compare or merge the results later.
Here are some new capabilities we’ve added since the initial launch.
Deploy Artifacts repos to Workers
You can now connect an Artifacts repository to a Worker through Workers Builds. When you or an agent pushes code to the Artifacts repository, Cloudflare will build the project and, for the production branch, deploy the updated Worker. Pushes to other branches automatically create or update Workers Previews, giving you an isolated, shareable version of your Worker where you can test changes before they go live.
You can connect an existing Worker to an Artifacts repository or start a new project and automatically store it in Artifacts.

Manage Artifacts directly from Workers
You can interact with Artifacts repositories directly from a Worker using an Artifacts binding to create or fork repos, inspect files and commits, and issue repo-scoped Git tokens. This makes your Git workflow programmable. When a new task arrives, a Worker can fork the project for an agent, read the files it needs for context, and give it a repository to work in. When the agent pushes a change, your automation can inspect the result and start a review. You define those steps in code to fit how your agents work.
For example, here’s how to fork a project for a new agent task and read its AGENTS.md for instructions:
using project = await env.ARTIFACTS.get("my-project");
const { defaultBranch } = await project.info();
const workspace = await project.fork(`task-${crypto.randomUUID()}`);
using repo = await env.ARTIFACTS.get(workspace.name);
const instructions = await repo.readFile({
ref: defaultBranch,
path: "AGENTS.md",
});
const agentTask = {
remote: workspace.remote,
token: workspace.token,
instructions: instructions ? await instructions.text() : null,
};React to every change with event subscriptions
Artifacts publishes events whenever a repository is created, imported, forked, deleted, pushed to, cloned, or fetched. You can subscribe to these events to decide what happens next: run CI, kick off a code review agent, or deploy a change.
For example, you can subscribe to Artifacts push events and have a Worker start a code review workflow for each push. The Worker passes the repository, branch, and new commit to the Workflow, giving a review agent the context it needs to inspect the change:
export default {
async queue(batch, env) {
for (const message of batch.messages) {
const event = message.body;
if (event.type !== "cf.artifacts.repo.pushed") continue;
await env.REVIEW_WORKFLOW.create({
params: {
namespace: event.source.namespace,
repo: event.source.repoName,
ref: event.payload.ref,
commit: event.payload.after,
},
});
}
},
};Data jurisdiction for Artifacts repos
You can now choose where Artifacts stores and processes your repository data. Set a U.S. or EU jurisdiction when you create a namespace, and every repository created in that namespace will automatically follow the same restriction.
curl "https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/artifacts/namespaces" \
-H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
--json '{"namespace":"my-eu-namespace","jurisdiction":"eu"}'View Artifacts metrics
You can now see metrics for your Artifacts repositories in the Cloudflare dashboard. For each repository, you can now see total operations, pulls, pushes, errors, and error rate, helping you understand how the repository is being used and spot failures. You can also query Artifacts metrics directly to build your own dashboards or monitoring.

Pricing
Artifacts pricing is based on repository operations and the amount of data stored. We will begin billing for Artifacts usage on October 15, 2026.
Competition: Build the next Git platform on Cloudflare
We want you to build your vision for the Git platform of the agentic era using Cloudflare Workers and Artifacts.
You could rethink repositories, branches, pull requests, worktrees, code review, and merge conflicts — or build new ways to preserve agent context, compare multiple changes at the same time, and decide which one should ship.
We aren’t looking for GitHub as it exists today with agents added on top. At a minimum, we want to see multiple agents working on changes concurrently. Beyond that, we want you to get creative — what you think comes next.
How to enter
Submit:
- A 5-10 minute video demonstrating what you built, what it enables agents and developers to do, and how it works
- A link to the source code, which must be provided under a permissive open source license (MIT, Apache, BSD)
- Instructions for running or trying the project
Deadline
Submissions are open until October 14, 2026.
Why should you participate?
We’ll select the top three projects and fly up to two members from each team to San Francisco to attend Cloudflare Connect and show what they built.
The first-place team will also receive $25,000 in Cloudflare credits, along with invitations to the VIP speaker dinner on Monday night at Connect.
Get started
Artifacts is available in open beta to customers on the Workers Paid plan.
Get started with your coding agent: copy the prompt below to set up your first Artifacts repository and start pushing code to it.
You can view or create the Artifacts repositories in the dashboard or if you’re looking to learn more, check out the documentation.
