Claude Code - Dynamic Workflows
Anthropic 官方公告(2026-05-28,claude.com/blog):Claude Code 的 dynamic workflows 正式 GA——Claude 临场编写 orchestration 脚本,在单个 session 内跑数十到数百个并行 subagent,结果先验证再折叠给用户,“按季度规划的工作变成按天交付”(work you’d normally plan in quarters now finishes in days)。同期给出最大规模案例:Bun 用它完成 Zig→Rust 移植(约 75 万行、11 天、99.8% 测试通过)。详见概念页 动态工作流。
要点
- 机制:按 prompt 动态规划 → 拆子任务扇出到并行 subagent → 每个结果先独立验证才折叠 → 迭代到答案收敛,产出单一协调答案。多角度独立尝试 + 对抗 agent 试图推翻,是结果质量的来源。
- 长时与可恢复:为并行、长时(小时到天级)工作设计;进度随跑随存,中断后从断点续跑;协调发生在对话之外,任务再大计划也不漂移。
- 典型形状:全库 bug 猎杀 / profiler 引导的性能审计 / 安全审计(每个发现过独立验证,报告只留真问题);跨数千文件的迁移与现代化(框架替换、API 弃用、语言移植);高代价工作的双重检查(独立尝试 + 对抗审查)。
- Bun 案例:workflow 1 为 Zig 代码库每个 struct field 映射正确的 Rust lifetime;workflow 2 把每个 .rs 文件写成对应 .zig 的行为等价移植,数百 agent 并行、每文件双 reviewer;fix loop 把 build 与测试跑到干净;落地后隔夜 workflow 清理不必要的数据拷贝并为每处开 PR。尚未上生产,作者(Jarred Sumner)称后续会详写。
- 可用性与入口:GA 于 Claude Code CLI / Desktop / VS Code 扩展(Pro / Max / Team / Enterprise)及 Claude API、Amazon Bedrock、Vertex AI、Microsoft Foundry。两种触发:直接让 Claude “create a workflow”,或开
ultracode设置(effort 拉到 xhigh,由 Claude 自动决定何时起 workflow)。首次触发展示计划并求确认;Max / Team / Enterprise / API 默认开启,Pro 在 /config 里开;组织管理员可在 managed settings 禁用。 - 成本警示:token 消耗远高于普通 Claude Code session,官方建议先在 scoped task 上试水。
- 用户反馈:Klarna(Alessio Vallero)用于大代码库 discovery/review——找 dead code 与清理机会,是传统静态分析漏掉的;CyberAgent(Ken Takao)——“填上单个 subagent 与全职 agent team 之间的空档”。
值得留的原话
- “Claude dynamically writes orchestration scripts that run tens to hundreds of parallel subagents in a single session, checking its work before anything reaches you.”(引言)
- “Work you’d normally plan in quarters now finishes in days.”(引言)
- “Agents address the problem from independent angles, other agents try to refute what they found, and the run keeps iterating until the answers converge—which is how a workflow reaches results a single pass can’t.”(How it works)
- “Because the coordination happens outside the conversation, the plan stays on track no matter how big the task gets.”(How it works)
- “Progress is saved as the run goes, so a job that’s interrupted picks up where it left off instead of starting over.”(How it works)
- “Dynamic workflows fill the gap between firing off a single subagent and building out a full agent team.”(Ken Takao, CyberAgent)
与已有页面的关联
- 动态工作流:本源为概念页的全部依据。
- Agent Fleet 管理:fleet 页管 always-on 运营 bot 群,本源是单任务一次性 swarm——“solo 优先、无监督 crew 错误率 17 倍”的结论在这里靠验证闸门兜底,见概念页对照一节。
- Agent 状态分层:协调态外置对话之外、进度持久化可续跑,是”work 态须在发起进程外存活”的又一实例。
- 自改进 Agent 回路 / Agent Skill:同为 Claude 生态的 agent 基础设施演化(Agent Skills / Claude Code)。
- Dynamic Workflow 架构拆解:后续机制深挖(收敛判定四模式、编排脚本原语、Workflow tool schema、CLI/SDK 依赖方向);官方 workflows 文档与 SDK 参考快照另存 raw/。