返回列表
🪞 Uota学 · 🧠 阿头学 · 💬 讨论题

Claude Code「代理团队」不是功能升级,是工作形态换代

从“让一个模型硬扛全流程”切到“领队+多队友并行协作”,价值不在更聪明,而在更像一个能被管理的团队——但代价是:你得学会拆任务、写角色、控协作成本。

2026-02-07 原文链接 ↗
阅读简报
双语对照
完整翻译
原文
讨论归档

核心观点

  • Agent Teams 把“并行”做成了产品默认能力 以前你想并行只能靠自建编排(OpenClaw skills / 多会话 / 自己当调度器)。Anthropic 这次把“多会话协同+共享任务清单+队友互相发消息”变成原生范式:不是让单体更强,而是让组织形态更强。
  • Sub-agent vs Team 的分水岭不是“复杂”,而是“需要互相沟通吗” 只要结果、不需要互相校验 → sub-agent 更省 token;需要并行探索、互相质疑、对照证据 → team 才有净收益。这个判断比“任务大不大”更关键。
  • 团队的第一大坑是“伪并行” 强串行任务、同一文件并行修改、或任务边界不清,会把协作变成覆盖/返工/协调噪音。并行的前提是可拆成相对独立的交付单元(模块/文件/假设)。
  • 省钱不是少用,而是把管理前置 Teams 会烧 token,能省的不是算力,而是来回沟通:一开始就把角色、目标、约束、输出物写进 spawn prompt;把任务切到“自包含、可验收”;定期 check-in,及时止损走偏的队友。
  • Delegate mode 的意义:把领队从“也想亲自干活”锁回“只做调度” 很多失败协作都来自领队一边协调一边插手实现,导致上下文混、节奏乱。delegate mode 本质是强制分工。

跟我们的关联

🪞Uota

  • OpenClaw 这条线可以把“teams”作为默认交互范式来设计 skill:把“拆解—并行—汇总—验收”写成可复用模板,而不是每次临时拆。
  • 可以在 skill 里显式引入“devil’s advocate/审计员/验证员”角色,专门并行找反例、查风险、做交叉验证。

👤ATou / 🧠Neta

  • 团队规模小(20 人特种队)但任务面宽时,Agent Teams 是把“并行研究/并行实现/并行复盘”变成日常肌肉记忆的捷径:用它替代“你一个人开 10 个窗口硬切”。
  • 对增长/品牌这种多假设领域:用多队友并行验证互斥假设,能显著降低“在一个错误假设上走到黑”的时间浪费。

讨论引子

  • 如果“并行”成为默认能力,你的工作流里哪些环节应该从一开始就按“多角色协作”来设计,而不是单人顺序执行?
  • 你愿意为“更快发现错误假设”付出多少 token 成本?有没有一条清晰的停损线(比如 10 分钟无进展就收队/重拆)?
  • 在 Neta 这种少人高杠杆团队里,哪些工作最适合交给“唱反调者/审计员”角色来常驻?为什么?

Claude Code「代理团队」安装与使用指南(完整教程)

OpenClaw 社区早就用自定义技能编排多代理会话了。如今 Anthropic 已把它原生做进 Claude Code。下面是如何完成设置,并从今天开始真正用起来。

OpenClaw 先做出来,Anthropic 把它官方化了

OpenClaw 社区最先摸索出了这套玩法。

他们做了自定义技能,让你能把多个 Claude Code 会话编排到一起,在同一个项目上协同工作:协调任务、共享上下文、并行运行。

这很聪明,确实能用,而且显然引起了 Anthropic 的注意。

因为他们刚刚把同样的东西原生集成进了 Claude Code。无需插件、无需绕路、无需自定义技能。现在它就内置在产品里,并被称为 “agent teams”。

不再是一个代理按直线把所有事情从头做到尾,而你只能坐着看它思考;现在,一个领队代理会把任务拆成多个部分,拉起多位队友,并且他们会在彼此协调的前提下同时开工。

你可以把它理解为:从“一个自由职业者单打独斗包办一切”,升级成“项目经理带着完整团队到场,把活分派给所有人”。

它目前处于研究预览阶段,大多数人还不知道它的存在。本指南会覆盖你需要的一切:如何安装、如何配置、以及如何真正正确地使用它。

过去一个代理单干,现在它带着一支队伍出现了

在这次更新之前,Claude Code 更像一个单人员工。

你给它一个任务,它会从第一步开始,做完再到第二步,做完再到第三步……直到把整件事做完。串行。一次只做一件。

代理团队彻底改变了这一点。

你描述你想要什么,领队代理会先审视任务,把它拆解成多个部分,并拉起不同的队友,让他们同时处理不同板块。

一个队友可能在研究你的代码库,另一个在调试某个函数,还有一个在写测试。

他们各自拥有独立的上下文窗口、独立的工作区,并且可以直接互相发消息,分享各自发现。

领队代理会盯住全局:协调推进、维护共享任务清单,并在队友完成后把所有成果汇总起来。

如果你愿意,你甚至可以直接插入、和任何一个队友对话——不必一定通过领队——比如重定向他们的方向,或追问一个补充问题。

“等等,sub-agents 不早就有了吗?”——是的,但区别在这里

如果你用 Claude Code 有一阵子了,你大概率已经用过 sub-agents。

它们会在你的会话里被拉起,完成一个聚焦的小任务,然后把结果汇报给主代理。简单、有效,而且相对省 token。

代理团队是另一种完全不同的东西。

每个队友都是一个完全独立的 Claude Code 会话,拥有自己的上下文窗口。

它们不只是向领队汇报,还会彼此直接沟通、共享发现、互相质疑彼此的工作,并通过共享任务清单自我协同。

Sub-agents 像是派一个助理去帮你拿个答案。代理团队更像把一群专家关进同一个房间,让他们一起把问题推演清楚。

实用层面的差异归结为一个问题:你的“工人们”需要彼此沟通吗?如果答案是否,你只是要一个快速结果,那就用 sub-agents。如果答案是,并且协作会让工作受益,那就是代理团队的用武之地。

Sub-agents 更省 token,更适合聚焦任务。

代理团队更贵,但它能处理复杂的、多部分的工作——这些工作若由单一代理来做,往往要花显著更长的时间。

什么时候用代理团队真正合适,什么时候是用力过猛

代理团队不是一个“什么都用它”的功能。

它会带来协调开销,而且消耗 token 的速度远快于单一会话。

所以你需要有意识地选择何时拉起团队。

最适合的是:并行探索确实能带来增益的任务。

研究与评审就是典型场景:多个队友从不同角度同时调查一个问题,然后对照笔记、互相校验。另一个好场景是开发新功能:让每个队友负责一个独立的模块或文件。

调试更是有趣。与其让一个代理沿着一条路径走到黑、还可能在错误假设上浪费时间,你可以拉起多个队友并行验证相互竞争的假设。谁先找到答案谁就“赢”,其他人就可以停止。

跨层工作也很稳:一个队友做前端,一个做后端,一个写测试。各自负责自己的部分,不互相踩脚。

不适合代理团队的,是任何强串行的工作。

如果第二步必须等待第一步完成,并行就没有收益。同一个文件的并行修改也很糟,因为两个队友同时改同一文件会导致覆盖。还有一些简单任务:协调成本比让一个代理快速搞定还要高。

在拉起团队之前,先问自己:这项工作能否真正拆成彼此独立的部分?能,就上;不能,单一会话或 sub-agents 往往更合适、也更省钱。

如何在设置中启用代理团队(30 秒搞定)

代理团队是实验性功能,默认关闭,所以你需要先把它打开才能使用。有两种方式。

第一种是通过你的 settings.json 文件。打开它并加入下面这些:

{

"env": {

"CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1"

}

}

第二种是直接在 shell 里设置为环境变量。两种方式都可用,但如果你希望跨会话持久生效,settings.json 更干净。

就这样。配置好之后,Claude Code 就能识别代理团队相关命令,你也就可以开始拉起团队了。

如果你想深入阅读超出本文范围的完整文档,Anthropic 在这里都写好了:https://code.claude.com/docs/en/agent-teams

启动你的第一个代理团队:到底该怎么说

你不需要学任何特殊语法。只要用自然语言描述你想要什么,并告诉 Claude 创建一个团队即可。

下面是一段很实用的示例提示词,因为它给领队提供了清晰、彼此独立的角色可以分派:

我在设计一个 CLI 工具,帮助开发者在整个代码库中追踪 TODO 注释。创建一个代理团队,从不同角度探索:一个队友关注 UX,一个关注技术架构,一个扮演唱反调者(devil's advocate)。

随后 Claude 会创建团队、为每个角色拉起队友、通过共享任务清单分配任务,并让他们开始工作。你会在领队的终端里看到所有活跃队友,以及他们正在做什么。

一个好的首次提示词关键在于:给领队足够的抓手。

明确每个队友要聚焦什么,并确保角色之间不要过度重叠。任务如果太含糊,领队就得自己先把结构捋出来——这会消耗你的 token,而且通常会得到更不聚焦的结果。

你也可以明确告诉它要多少位队友,以及用哪个模型:

创建一个包含 4 位队友的团队,并行重构这些模块。

每位队友都使用 Sonnet。

团队运行后,你有两种显示模式可选。默认是 in-process mode:所有队友都在你的主终端里运行,你用 Shift+Up/Down 在他们之间切换。

如果你想同时看到所有人的输出,split-pane mode 会为每个队友分配一个独立窗格,但这需要 tmux 或 iTerm2。

团队运行后如何控制

当你的团队已经启动,有几件事你会立刻想知道怎么做。

第一,你可以直接和任何一个队友对话,不必经过领队。在 in-process mode 下,按 Shift+Up 或 Shift+Down 选中某个队友,然后直接输入即可。在 split-pane mode 下,点进他们的窗格,像普通的 Claude Code 会话一样与其交互。

第二,有个叫 delegate mode 的东西,它能解决一个常见问题:有时候领队会决定自己动手做事,而不是等队友做完。

Delegate mode 会把领队锁定为“只负责协调”,也就是说它只能拉起队友、分配任务、发送消息、管理任务清单。团队运行后按 Shift+Tab 可切换开启。

第三,任务既可以由领队分配,也可以由队友自行认领。当某个队友完成当前任务后,它可以从共享清单中自动捡起下一个未分配的任务。

如果你想更强控制力,就直接告诉领队:哪个任务交给哪个队友。

第四,当某个队友完成工作后,你可以让领队把他关掉。

领队会发送关闭请求,队友确认后会优雅退出。整个团队完成后,告诉领队做清理,它会移除所有共享的团队资源。但在运行清理之前,务必先把所有队友都关掉。

最佳实践:别靠踩坑来浪费 token

代理团队消耗 token 很快,因为每个队友都是一个并行运行的独立 Claude Code 会话。有几件事能帮你省下不少钱和挫败感。

给队友写更细的 spawn prompt。他们会自动从你的 CLAUDE.md 和 MCP servers 加载项目上下文,但他们不会继承领队的对话历史。

所以如果有某些特定上下文能让他们把事情做得更好,一开始在领队拉起他们时就写进 prompt。你前置得越具体,后续来回沟通就越少。

把任务切得合适。太小的话,协调开销会超过收益;太大的话,队友长时间不汇报,浪费努力的风险会变高。

甜 spot 是“自包含”的单元,并且能产出清晰的交付物,比如一个函数、一个测试文件,或一次评审结论。

让每个队友尽量改不同的文件。两个队友同时编辑同一个文件很容易互相覆盖,这种头疼完全没必要。拆分工作时,让每个人负责自己的一组文件。

如果你刚开始用代理团队,先从研究与评审类任务入门,再跳到并行实现。比如让队友从不同角度评审一个 PR,或用不同理论并行排查一个 bug。这些任务能让你看到并行协作的价值,又不会像并行写代码那样带来复杂的协调成本。

并且要定期查看团队进展。让他们长时间无人看管,会显著提高无效劳动的概率,尤其当某个队友走进了一条不产出的路径时。

目前还不支持什么(免得你怪工具)

这是实验性功能,在你开始依赖它之前,有一些“毛边”你需要提前知道。

Session resumption 在 in-process 的队友上不生效。如果你用了 /resume 或 /rewind,你的队友不会回来。领队可能会尝试给他们发消息,但他们已经不存在了。遇到这种情况,直接让领队重新拉起新的队友即可。

任务状态可能会延迟。有时候某个队友已经完成工作,但没有把任务标记为 completed,这会卡住依赖该任务的后续任务。如果看起来像是卡住了,先确认工作是否真的完成,然后要么手动更新状态,要么让领队去提醒(nudge)队友。

每个会话只能运行一个团队,而且队友不能再拉起自己的团队。创建团队的会话会在整个生命周期里一直是领队,所以不存在把某个队友“升职”,或在会话中途转移领导权。

Split-pane mode 只支持 tmux 或 iTerm2。在 VS Code 的集成终端、Windows Terminal 或 Ghostty 中不支持。不过默认的 in-process mode 在任何地方都能用。

这些都不算致命问题,但提前知道它们意味着你不会把时间浪费在排查“只是预览阶段限制”的东西上。

这只是开始,而且只会越来越好

代理团队处于研究预览阶段,这意味着 Anthropic 正在积极开发它。你今天看到的是基线,不是天花板。

随着他们逐步解决 session resumption、任务协调、以及关停行为等方面的毛边,代理团队将会成为人们使用 Claude Code 的标准方式之一。

那些现在就提前安装、并开始建立肌肉记忆的人,等它走出预览并成为默认功能时,会拥有明显优势。

如果你想持续跟进这类东西的最新落地方式,我每周都会在 The AI Operator's Playbook 里拆解我在生产环境中真正使用的工作流、工具和实现方法。

加入后你还能拿到 15 个可直接上生产的 n8n 工作流,以及我基于 8 年自动化实践沉淀的 6 份实现 playbook。

👉 https://learnn8nautomation.com/newsletter

Link: http://x.com/i/article/2015727333530091522

相关笔记

OpenClaw's community was already orchestrating multi-agent sessions with custom skills. Now Anthropic shipped it natively into Claude Code. Here's how to set it up and start using it today.

OpenClaw 社区早就用自定义技能编排多代理会话了。如今 Anthropic 已把它原生做进 Claude Code。下面是如何完成设置,并从今天开始真正用起来。

OpenClaw built it first, now Anthropic made it official

OpenClaw 先做出来,Anthropic 把它官方化了

The OpenClaw community figured this out first.

OpenClaw 社区最先摸索出了这套玩法。

They built custom skills that let you orchestrate multiple Claude Code sessions working together on the same project, coordinating tasks, sharing context, running in parallel.

他们做了自定义技能,让你能把多个 Claude Code 会话编排到一起,在同一个项目上协同工作:协调任务、共享上下文、并行运行。

It was clever, it worked, and it clearly caught Anthropic's attention.

这很聪明,确实能用,而且显然引起了 Anthropic 的注意。

Because they just shipped the same thing natively into Claude Code. No plugins, no workarounds, no custom skills. It's built right in now and they're calling it "agent teams."

因为他们刚刚把同样的东西原生集成进了 Claude Code。无需插件、无需绕路、无需自定义技能。现在它就内置在产品里,并被称为 “agent teams”。

Instead of one agent doing everything in a straight line while you sit there watching it think, a lead agent now breaks your task into pieces, spins up multiple teammates, and they all go to work at the same time while actually coordinating with each other.

不再是一个代理按直线把所有事情从头做到尾,而你只能坐着看它思考;现在,一个领队代理会把任务拆成多个部分,拉起多位队友,并且他们会在彼此协调的前提下同时开工。

Think of it like going from one freelancer doing everything solo to a project manager who shows up with a full crew and delegates across all of them.

你可以把它理解为:从“一个自由职业者单打独斗包办一切”,升级成“项目经理带着完整团队到场,把活分派给所有人”。

It's in research preview right now, most people don't know about it yet, and this guide covers everything you need to install it, configure it, and actually use it properly.

它目前处于研究预览阶段,大多数人还不知道它的存在。本指南会覆盖你需要的一切:如何安装、如何配置、以及如何真正正确地使用它。

One agent used to do everything solo, now it shows up with a team

过去一个代理单干,现在它带着一支队伍出现了

Up until this update, Claude Code worked like a single employee.

在这次更新之前,Claude Code 更像一个单人员工。

You'd give it a job, it would start at step one, finish it, move to step two, finish that, and keep going until the whole thing was done. Sequentially. One task at a time.

你给它一个任务,它会从第一步开始,做完再到第二步,做完再到第三步……直到把整件事做完。串行。一次只做一件。

Agent teams change that completely.

代理团队彻底改变了这一点。

You describe what you want, and instead of one agent grinding through it alone, a lead agent looks at the task, breaks it into pieces, and spins up separate teammates to handle different parts at the same time.

你描述你想要什么,领队代理会先审视任务,把它拆解成多个部分,并拉起不同的队友,让他们同时处理不同板块。

One teammate might be researching your codebase while another is debugging a function while another is writing tests.

一个队友可能在研究你的代码库,另一个在调试某个函数,还有一个在写测试。

They each have their own context window, their own workspace, and they can message each other directly to share what they're finding.

他们各自拥有独立的上下文窗口、独立的工作区,并且可以直接互相发消息,分享各自发现。

The lead agent stays on top of all of it, coordinating the work, managing a shared task list, and pulling everything together once the teammates finish.

领队代理会盯住全局:协调推进、维护共享任务清单,并在队友完成后把所有成果汇总起来。

You can even jump in and talk to any teammate directly if you want to redirect them or ask a follow-up question without going through the lead.

如果你愿意,你甚至可以直接插入、和任何一个队友对话——不必一定通过领队——比如重定向他们的方向,或追问一个补充问题。

"But wait, aren't sub-agents already a thing?" - yes, and here's the difference

“等等,sub-agents 不早就有了吗?”——是的,但区别在这里

If you've been using Claude Code for a while, you've probably already used sub-agents.

如果你用 Claude Code 有一阵子了,你大概率已经用过 sub-agents。

They spin up inside your session, do a focused task, and report the result back to the main agent. Simple, effective, and relatively cheap on tokens.

它们会在你的会话里被拉起,完成一个聚焦的小任务,然后把结果汇报给主代理。简单、有效,而且相对省 token。

Agent teams are a different animal.

代理团队是另一种完全不同的东西。

Each teammate is a fully independent Claude Code session with its own context window.

每个队友都是一个完全独立的 Claude Code 会话,拥有自己的上下文窗口。

They don't just report back to the lead, they talk to each other directly, share findings, challenge each other's work, and self-coordinate through a shared task list.

它们不只是向领队汇报,还会彼此直接沟通、共享发现、互相质疑彼此的工作,并通过共享任务清单自我协同。

Sub-agents are like sending an assistant to go grab you an answer. Agent teams are like putting a group of specialists in a room and letting them work through a problem together.

Sub-agents 像是派一个助理去帮你拿个答案。代理团队更像把一群专家关进同一个房间,让他们一起把问题推演清楚。

The practical difference comes down to one question: do your workers need to communicate with each other? If the answer is no and you just need a quick result, sub-agents are the move. If the answer is yes and the work benefits from collaboration, that's where agent teams come in.

实用层面的差异归结为一个问题:你的“工人们”需要彼此沟通吗?如果答案是否,你只是要一个快速结果,那就用 sub-agents。如果答案是,并且协作会让工作受益,那就是代理团队的用武之地。

Sub-agents are cheaper on tokens and better for focused tasks.

Sub-agents 更省 token,更适合聚焦任务。

Agent teams cost more but they handle complex, multi-part work that would take a single agent significantly longer to get through.

代理团队更贵,但它能处理复杂的、多部分的工作——这些工作若由单一代理来做,往往要花显著更长的时间。

When agent teams actually make sense and when they're overkill

什么时候用代理团队真正合适,什么时候是用力过猛

Agent teams are not a "use this for everything" feature.

代理团队不是一个“什么都用它”的功能。

They add coordination overhead and they burn through tokens significantly faster than a single session.

它会带来协调开销,而且消耗 token 的速度远快于单一会话。

So you want to be intentional about when you spin one up.

所以你需要有意识地选择何时拉起团队。

The sweet spots are tasks where parallel exploration genuinely adds value.

最适合的是:并行探索确实能带来增益的任务。

Research and review is a great one, where multiple teammates investigate different angles of a problem at the same time and then compare notes. Building new features where each teammate owns a separate module or file is another.

研究与评审就是典型场景:多个队友从不同角度同时调查一个问题,然后对照笔记、互相校验。另一个好场景是开发新功能:让每个队友负责一个独立的模块或文件。

Debugging is where it gets really interesting. Instead of one agent going down a single path and potentially wasting time on the wrong theory, you can spin up multiple teammates to test competing hypotheses in parallel. The one that finds the answer first wins, and the others can stop.

调试更是有趣。与其让一个代理沿着一条路径走到黑、还可能在错误假设上浪费时间,你可以拉起多个队友并行验证相互竞争的假设。谁先找到答案谁就“赢”,其他人就可以停止。

Cross-layer work is solid too. One teammate on the frontend, one on the backend, one writing tests. Each owns their own piece without stepping on each other.

跨层工作也很稳:一个队友做前端,一个做后端,一个写测试。各自负责自己的部分,不互相踩脚。

Where agent teams don't make sense is anything sequential.

不适合代理团队的,是任何强串行的工作。

If step two depends on step one being finished first, there's no benefit to parallelizing. Same-file edits are a bad idea because two teammates touching the same file leads to overwrites. And simple tasks where the coordination overhead costs more than just letting one agent handle it quickly.

如果第二步必须等待第一步完成,并行就没有收益。同一个文件的并行修改也很糟,因为两个队友同时改同一文件会导致覆盖。还有一些简单任务:协调成本比让一个代理快速搞定还要高。

Before you spin up a team, ask yourself if the work can genuinely be split into independent pieces. If yes, go for it. If not, a single session or sub-agents will serve you better and cost you less.

在拉起团队之前,先问自己:这项工作能否真正拆成彼此独立的部分?能,就上;不能,单一会话或 sub-agents 往往更合适、也更省钱。

How to enable agent teams in your settings (takes 30 seconds)

如何在设置中启用代理团队(30 秒搞定)

Agent teams are experimental and disabled by default, so you need to flip them on before you can use them. There are two ways to do it.

代理团队是实验性功能,默认关闭,所以你需要先把它打开才能使用。有两种方式。

The first way is through your settings.json file. Open it up and add this:

第一种是通过你的 settings.json 文件。打开它并加入下面这些:

{

{

"env": {

"env": {

"CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1"

"CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1"

}

}

}

}

The second way is to set it as an environment variable directly in your shell. Either approach works, but settings.json is cleaner if you want it to persist across sessions.

第二种是直接在 shell 里设置为环境变量。两种方式都可用,但如果你希望跨会话持久生效,settings.json 更干净。

That's it. Once that's in place, Claude Code will recognize agent team commands and you can start spinning up teams.

就这样。配置好之后,Claude Code 就能识别代理团队相关命令,你也就可以开始拉起团队了。

If you want to dig into the full documentation beyond what this guide covers, Anthropic has it all here: https://code.claude.com/docs/en/agent-teams

如果你想深入阅读超出本文范围的完整文档,Anthropic 在这里都写好了:https://code.claude.com/docs/en/agent-teams

Starting your first agent team and what to actually say

启动你的第一个代理团队:到底该怎么说

You don't need to learn any special syntax. You just describe what you want in plain language and tell Claude to create a team.

你不需要学任何特殊语法。只要用自然语言描述你想要什么,并告诉 Claude 创建一个团队即可。

Here's an example prompt that works well because it gives the lead clear, independent roles to assign:

下面是一段很实用的示例提示词,因为它给领队提供了清晰、彼此独立的角色可以分派:

I'm designing a CLI tool that helps developers track TODO comments

我在设计一个 CLI 工具,帮助开发者在整个代码库中追踪 TODO 注释。创建一个代理团队,从不同角度探索:一个队友关注 UX,一个关注技术架构,一个扮演唱反调者(devil's advocate)。

across their codebase. Create an agent team to explore this from

随后 Claude 会创建团队、为每个角色拉起队友、通过共享任务清单分配任务,并让他们开始工作。你会在领队的终端里看到所有活跃队友,以及他们正在做什么。

different angles: one teammate on UX, one on technical architecture,

一个好的首次提示词关键在于:给领队足够的抓手。

one playing devil's advocate.

明确每个队友要聚焦什么,并确保角色之间不要过度重叠。任务如果太含糊,领队就得自己先把结构捋出来——这会消耗你的 token,而且通常会得到更不聚焦的结果。

From there Claude creates the team, spins up teammates for each role, gives them their assignments through a shared task list, and lets them get to work. You'll see the lead's terminal listing all active teammates and what they're working on.

你也可以明确告诉它要多少位队友,以及用哪个模型:

The key to a good first prompt is giving the lead enough to work with.

创建一个包含 4 位队友的团队,并行重构这些模块。

Be specific about what each teammate should focus on and make sure their roles don't overlap too much. If the tasks are too vague, the lead has to figure out the structure on its own, which eats into your tokens and usually produces a less focused result.

每位队友都使用 Sonnet。

You can also tell it exactly how many teammates you want and which model to use:

团队运行后,你有两种显示模式可选。默认是 in-process mode:所有队友都在你的主终端里运行,你用 Shift+Up/Down 在他们之间切换。

Create a team with 4 teammates to refactor these modules in parallel.

如果你想同时看到所有人的输出,split-pane mode 会为每个队友分配一个独立窗格,但这需要 tmux 或 iTerm2。

Use Sonnet for each teammate.

团队运行后如何控制

Once the team is running, you have two display modes to choose from. The default is in-process mode where all teammates run inside your main terminal and you use Shift+Up/Down to cycle between them.

当你的团队已经启动,有几件事你会立刻想知道怎么做。

If you want to see everyone's output at once, split-pane mode gives each teammate their own pane, but it requires tmux or iTerm2.

第一,你可以直接和任何一个队友对话,不必经过领队。在 in-process mode 下,按 Shift+Up 或 Shift+Down 选中某个队友,然后直接输入即可。在 split-pane mode 下,点进他们的窗格,像普通的 Claude Code 会话一样与其交互。

How to control your team once it's running

第二,有个叫 delegate mode 的东西,它能解决一个常见问题:有时候领队会决定自己动手做事,而不是等队友做完。

Once your team is live, there are a few things you'll want to know how to do right away.

Delegate mode 会把领队锁定为“只负责协调”,也就是说它只能拉起队友、分配任务、发送消息、管理任务清单。团队运行后按 Shift+Tab 可切换开启。

First, you can talk to any teammate directly. You don't have to go through the lead. In in-process mode, hit Shift+Up or Shift+Down to select a teammate and just start typing. In split-pane mode, click into their pane and interact with them like any normal Claude Code session.

第三,任务既可以由领队分配,也可以由队友自行认领。当某个队友完成当前任务后,它可以从共享清单中自动捡起下一个未分配的任务。

Second, there's something called delegate mode and it solves a common problem. Sometimes the lead decides to start doing the work itself instead of waiting for teammates to finish.

如果你想更强控制力,就直接告诉领队:哪个任务交给哪个队友。

Delegate mode locks the lead into coordination-only, so it can only spawn teammates, assign tasks, send messages, and manage the task list. Press Shift+Tab to toggle it on once your team is running.

第四,当某个队友完成工作后,你可以让领队把他关掉。

Third, tasks can be assigned by the lead or self-claimed by teammates. When a teammate finishes their current task, they can automatically pick up the next unassigned one from the shared list.

领队会发送关闭请求,队友确认后会优雅退出。整个团队完成后,告诉领队做清理,它会移除所有共享的团队资源。但在运行清理之前,务必先把所有队友都关掉。

If you want more control, just tell the lead which task goes to which teammate.

最佳实践:别靠踩坑来浪费 token

And fourth, when a teammate is done with their work, you can ask the lead to shut them down.

代理团队消耗 token 很快,因为每个队友都是一个并行运行的独立 Claude Code 会话。有几件事能帮你省下不少钱和挫败感。

The lead sends a shutdown request, the teammate confirms, and they exit gracefully. When the whole team is finished, tell the lead to clean up and it will remove all shared team resources. Just make sure all teammates are shut down first before you run cleanup.

给队友写更细的 spawn prompt。他们会自动从你的 CLAUDE.md 和 MCP servers 加载项目上下文,但他们不会继承领队的对话历史。

Best practices so you don't waste tokens figuring this out yourself

所以如果有某些特定上下文能让他们把事情做得更好,一开始在领队拉起他们时就写进 prompt。你前置得越具体,后续来回沟通就越少。

Agent teams burn through tokens fast because every teammate is its own Claude Code session running in parallel. A few things will save you a lot of money and frustration.

把任务切得合适。太小的话,协调开销会超过收益;太大的话,队友长时间不汇报,浪费努力的风险会变高。

Give your teammates detailed spawn prompts. They load project context automatically from your CLAUDE.md and MCP servers, but they don't inherit the lead's conversation history.

甜 spot 是“自包含”的单元,并且能产出清晰的交付物,比如一个函数、一个测试文件,或一次评审结论。

So if there's specific context they need to do their job well, put it in the prompt when the lead spawns them. The more specific you are upfront, the less back-and-forth they need.

让每个队友尽量改不同的文件。两个队友同时编辑同一个文件很容易互相覆盖,这种头疼完全没必要。拆分工作时,让每个人负责自己的一组文件。

Size your tasks properly. Too small and the coordination overhead costs more than the benefit. Too large and teammates work too long without check-ins, which increases the risk of wasted effort.

如果你刚开始用代理团队,先从研究与评审类任务入门,再跳到并行实现。比如让队友从不同角度评审一个 PR,或用不同理论并行排查一个 bug。这些任务能让你看到并行协作的价值,又不会像并行写代码那样带来复杂的协调成本。

The sweet spot is self-contained units that produce a clear deliverable like a function, a test file, or a review.

并且要定期查看团队进展。让他们长时间无人看管,会显著提高无效劳动的概率,尤其当某个队友走进了一条不产出的路径时。

Keep each teammate working on different files. Two teammates editing the same file leads to overwrites and that's a headache you don't need. Break the work so each one owns their own set of files.

目前还不支持什么(免得你怪工具)

If you're new to agent teams, start with research and review tasks before jumping into parallel implementation. Have teammates review a PR from different angles, or investigate a bug with competing theories. These tasks show you the value of parallel work without the coordination complexity of building code simultaneously.

这是实验性功能,在你开始依赖它之前,有一些“毛边”你需要提前知道。

And check in on your team regularly. Letting them run unattended for too long increases the chance of wasted effort, especially if one teammate goes down a path that isn't productive.

Session resumption 在 in-process 的队友上不生效。如果你用了 /resume 或 /rewind,你的队友不会回来。领队可能会尝试给他们发消息,但他们已经不存在了。遇到这种情况,直接让领队重新拉起新的队友即可。

What doesn't work yet (so you don't blame the tool)

任务状态可能会延迟。有时候某个队友已经完成工作,但没有把任务标记为 completed,这会卡住依赖该任务的后续任务。如果看起来像是卡住了,先确认工作是否真的完成,然后要么手动更新状态,要么让领队去提醒(nudge)队友。

This is an experimental feature and there are some rough edges you should know about before you start relying on it.

每个会话只能运行一个团队,而且队友不能再拉起自己的团队。创建团队的会话会在整个生命周期里一直是领队,所以不存在把某个队友“升职”,或在会话中途转移领导权。

Session resumption doesn't work with in-process teammates. If you use /resume or /rewind, your teammates won't come back. The lead might try to message them but they won't exist anymore. If this happens, just tell the lead to spawn new ones.

Split-pane mode 只支持 tmux 或 iTerm2。在 VS Code 的集成终端、Windows Terminal 或 Ghostty 中不支持。不过默认的 in-process mode 在任何地方都能用。

Task status can lag. Sometimes a teammate finishes their work but doesn't mark the task as completed, which blocks any tasks that depend on it. If something looks stuck, check whether the work is actually done and either update the status manually or tell the lead to nudge the teammate.

这些都不算致命问题,但提前知道它们意味着你不会把时间浪费在排查“只是预览阶段限制”的东西上。

You can only run one team per session and teammates can't spawn their own teams. The session that creates the team stays the lead for its entire lifetime, so there's no promoting a teammate or transferring leadership mid-session.

这只是开始,而且只会越来越好

Split-pane mode only works with tmux or iTerm2. It's not supported in VS Code's integrated terminal, Windows Terminal, or Ghostty. The default in-process mode works everywhere though.

代理团队处于研究预览阶段,这意味着 Anthropic 正在积极开发它。你今天看到的是基线,不是天花板。

None of these are dealbreakers, but knowing about them upfront means you won't waste time troubleshooting something that's just a current limitation of the preview.

随着他们逐步解决 session resumption、任务协调、以及关停行为等方面的毛边,代理团队将会成为人们使用 Claude Code 的标准方式之一。

This is just the beginning and it's only going to get better

那些现在就提前安装、并开始建立肌肉记忆的人,等它走出预览并成为默认功能时,会拥有明显优势。

Agent teams are in research preview, which means Anthropic is actively developing this and what you see today is the baseline, not the ceiling.

如果你想持续跟进这类东西的最新落地方式,我每周都会在 The AI Operator's Playbook 里拆解我在生产环境中真正使用的工作流、工具和实现方法。

As they iron out the rough edges around session resumption, task coordination, and shutdown behavior, this is going to become a standard part of how people work with Claude Code.

加入后你还能拿到 15 个可直接上生产的 n8n 工作流,以及我基于 8 年自动化实践沉淀的 6 份实现 playbook。

The people who install this early and start building muscle memory with it now are going to have a serious edge when it moves out of preview and becomes a default feature.

👉 https://learnn8nautomation.com/newsletter

If you want to stay on top of stuff like this as it drops, I break down the workflows, tools, and implementation methods I'm actually using in production every week inside The AI Operator's Playbook.

Link: http://x.com/i/article/2015727333530091522

You also get 15 production-ready n8n workflows and 6 implementation playbooks from 8 years of building automations when you join.

相关笔记

👉 https://learnn8nautomation.com/newsletter

Link: http://x.com/i/article/2015727333530091522

How to Install and Use Claude Code Agent Teams (Complete Guide)

  • Source: https://x.com/tomcrawshaw01/status/2019778646043758957?s=46
  • Mirror: https://x.com/tomcrawshaw01/status/2019778646043758957?s=46
  • Published: 2026-02-06T14:22:09+00:00
  • Saved: 2026-02-07

Content

OpenClaw's community was already orchestrating multi-agent sessions with custom skills. Now Anthropic shipped it natively into Claude Code. Here's how to set it up and start using it today.

OpenClaw built it first, now Anthropic made it official

The OpenClaw community figured this out first.

They built custom skills that let you orchestrate multiple Claude Code sessions working together on the same project, coordinating tasks, sharing context, running in parallel.

It was clever, it worked, and it clearly caught Anthropic's attention.

Because they just shipped the same thing natively into Claude Code. No plugins, no workarounds, no custom skills. It's built right in now and they're calling it "agent teams."

Instead of one agent doing everything in a straight line while you sit there watching it think, a lead agent now breaks your task into pieces, spins up multiple teammates, and they all go to work at the same time while actually coordinating with each other.

Think of it like going from one freelancer doing everything solo to a project manager who shows up with a full crew and delegates across all of them.

It's in research preview right now, most people don't know about it yet, and this guide covers everything you need to install it, configure it, and actually use it properly.

One agent used to do everything solo, now it shows up with a team

Up until this update, Claude Code worked like a single employee.

You'd give it a job, it would start at step one, finish it, move to step two, finish that, and keep going until the whole thing was done. Sequentially. One task at a time.

Agent teams change that completely.

You describe what you want, and instead of one agent grinding through it alone, a lead agent looks at the task, breaks it into pieces, and spins up separate teammates to handle different parts at the same time.

One teammate might be researching your codebase while another is debugging a function while another is writing tests.

They each have their own context window, their own workspace, and they can message each other directly to share what they're finding.

The lead agent stays on top of all of it, coordinating the work, managing a shared task list, and pulling everything together once the teammates finish.

You can even jump in and talk to any teammate directly if you want to redirect them or ask a follow-up question without going through the lead.

"But wait, aren't sub-agents already a thing?" - yes, and here's the difference

If you've been using Claude Code for a while, you've probably already used sub-agents.

They spin up inside your session, do a focused task, and report the result back to the main agent. Simple, effective, and relatively cheap on tokens.

Agent teams are a different animal.

Each teammate is a fully independent Claude Code session with its own context window.

They don't just report back to the lead, they talk to each other directly, share findings, challenge each other's work, and self-coordinate through a shared task list.

Sub-agents are like sending an assistant to go grab you an answer. Agent teams are like putting a group of specialists in a room and letting them work through a problem together.

The practical difference comes down to one question: do your workers need to communicate with each other? If the answer is no and you just need a quick result, sub-agents are the move. If the answer is yes and the work benefits from collaboration, that's where agent teams come in.

Sub-agents are cheaper on tokens and better for focused tasks.

Agent teams cost more but they handle complex, multi-part work that would take a single agent significantly longer to get through.

When agent teams actually make sense and when they're overkill

Agent teams are not a "use this for everything" feature.

They add coordination overhead and they burn through tokens significantly faster than a single session.

So you want to be intentional about when you spin one up.

The sweet spots are tasks where parallel exploration genuinely adds value.

Research and review is a great one, where multiple teammates investigate different angles of a problem at the same time and then compare notes. Building new features where each teammate owns a separate module or file is another.

Debugging is where it gets really interesting. Instead of one agent going down a single path and potentially wasting time on the wrong theory, you can spin up multiple teammates to test competing hypotheses in parallel. The one that finds the answer first wins, and the others can stop.

Cross-layer work is solid too. One teammate on the frontend, one on the backend, one writing tests. Each owns their own piece without stepping on each other.

Where agent teams don't make sense is anything sequential.

If step two depends on step one being finished first, there's no benefit to parallelizing. Same-file edits are a bad idea because two teammates touching the same file leads to overwrites. And simple tasks where the coordination overhead costs more than just letting one agent handle it quickly.

Before you spin up a team, ask yourself if the work can genuinely be split into independent pieces. If yes, go for it. If not, a single session or sub-agents will serve you better and cost you less.

How to enable agent teams in your settings (takes 30 seconds)

Agent teams are experimental and disabled by default, so you need to flip them on before you can use them. There are two ways to do it.

The first way is through your settings.json file. Open it up and add this:

{

"env": {

"CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1"

}

}

The second way is to set it as an environment variable directly in your shell. Either approach works, but settings.json is cleaner if you want it to persist across sessions.

That's it. Once that's in place, Claude Code will recognize agent team commands and you can start spinning up teams.

If you want to dig into the full documentation beyond what this guide covers, Anthropic has it all here: https://code.claude.com/docs/en/agent-teams

Starting your first agent team and what to actually say

You don't need to learn any special syntax. You just describe what you want in plain language and tell Claude to create a team.

Here's an example prompt that works well because it gives the lead clear, independent roles to assign:

I'm designing a CLI tool that helps developers track TODO comments

across their codebase. Create an agent team to explore this from

different angles: one teammate on UX, one on technical architecture,

one playing devil's advocate.

From there Claude creates the team, spins up teammates for each role, gives them their assignments through a shared task list, and lets them get to work. You'll see the lead's terminal listing all active teammates and what they're working on.

The key to a good first prompt is giving the lead enough to work with.

Be specific about what each teammate should focus on and make sure their roles don't overlap too much. If the tasks are too vague, the lead has to figure out the structure on its own, which eats into your tokens and usually produces a less focused result.

You can also tell it exactly how many teammates you want and which model to use:

Create a team with 4 teammates to refactor these modules in parallel.

Use Sonnet for each teammate.

Once the team is running, you have two display modes to choose from. The default is in-process mode where all teammates run inside your main terminal and you use Shift+Up/Down to cycle between them.

If you want to see everyone's output at once, split-pane mode gives each teammate their own pane, but it requires tmux or iTerm2.

How to control your team once it's running

Once your team is live, there are a few things you'll want to know how to do right away.

First, you can talk to any teammate directly. You don't have to go through the lead. In in-process mode, hit Shift+Up or Shift+Down to select a teammate and just start typing. In split-pane mode, click into their pane and interact with them like any normal Claude Code session.

Second, there's something called delegate mode and it solves a common problem. Sometimes the lead decides to start doing the work itself instead of waiting for teammates to finish.

Delegate mode locks the lead into coordination-only, so it can only spawn teammates, assign tasks, send messages, and manage the task list. Press Shift+Tab to toggle it on once your team is running.

Third, tasks can be assigned by the lead or self-claimed by teammates. When a teammate finishes their current task, they can automatically pick up the next unassigned one from the shared list.

If you want more control, just tell the lead which task goes to which teammate.

And fourth, when a teammate is done with their work, you can ask the lead to shut them down.

The lead sends a shutdown request, the teammate confirms, and they exit gracefully. When the whole team is finished, tell the lead to clean up and it will remove all shared team resources. Just make sure all teammates are shut down first before you run cleanup.

Best practices so you don't waste tokens figuring this out yourself

Agent teams burn through tokens fast because every teammate is its own Claude Code session running in parallel. A few things will save you a lot of money and frustration.

Give your teammates detailed spawn prompts. They load project context automatically from your CLAUDE.md and MCP servers, but they don't inherit the lead's conversation history.

So if there's specific context they need to do their job well, put it in the prompt when the lead spawns them. The more specific you are upfront, the less back-and-forth they need.

Size your tasks properly. Too small and the coordination overhead costs more than the benefit. Too large and teammates work too long without check-ins, which increases the risk of wasted effort.

The sweet spot is self-contained units that produce a clear deliverable like a function, a test file, or a review.

Keep each teammate working on different files. Two teammates editing the same file leads to overwrites and that's a headache you don't need. Break the work so each one owns their own set of files.

If you're new to agent teams, start with research and review tasks before jumping into parallel implementation. Have teammates review a PR from different angles, or investigate a bug with competing theories. These tasks show you the value of parallel work without the coordination complexity of building code simultaneously.

And check in on your team regularly. Letting them run unattended for too long increases the chance of wasted effort, especially if one teammate goes down a path that isn't productive.

What doesn't work yet (so you don't blame the tool)

This is an experimental feature and there are some rough edges you should know about before you start relying on it.

Session resumption doesn't work with in-process teammates. If you use /resume or /rewind, your teammates won't come back. The lead might try to message them but they won't exist anymore. If this happens, just tell the lead to spawn new ones.

Task status can lag. Sometimes a teammate finishes their work but doesn't mark the task as completed, which blocks any tasks that depend on it. If something looks stuck, check whether the work is actually done and either update the status manually or tell the lead to nudge the teammate.

You can only run one team per session and teammates can't spawn their own teams. The session that creates the team stays the lead for its entire lifetime, so there's no promoting a teammate or transferring leadership mid-session.

Split-pane mode only works with tmux or iTerm2. It's not supported in VS Code's integrated terminal, Windows Terminal, or Ghostty. The default in-process mode works everywhere though.

None of these are dealbreakers, but knowing about them upfront means you won't waste time troubleshooting something that's just a current limitation of the preview.

This is just the beginning and it's only going to get better

Agent teams are in research preview, which means Anthropic is actively developing this and what you see today is the baseline, not the ceiling.

As they iron out the rough edges around session resumption, task coordination, and shutdown behavior, this is going to become a standard part of how people work with Claude Code.

The people who install this early and start building muscle memory with it now are going to have a serious edge when it moves out of preview and becomes a default feature.

If you want to stay on top of stuff like this as it drops, I break down the workflows, tools, and implementation methods I'm actually using in production every week inside The AI Operator's Playbook.

You also get 15 production-ready n8n workflows and 6 implementation playbooks from 8 years of building automations when you join.

👉 https://learnn8nautomation.com/newsletter

Link: http://x.com/i/article/2015727333530091522

📋 讨论归档

讨论进行中…