Claude Code's Agent Teams Are Insane - Multiple AI Agents Coding Together in Real Time — Transcript
Full transcript
- 0:00Take a look at this. I have four
- 0:02instances of Claude code working at the
- 0:05exact same time together to perform a
- 0:07code review on my codebase. And this is
- 0:10all thanks to the new agents teams
- 0:12feature that Enthropic has built into
- 0:14cloud code. And man, let me tell you, it
- 0:17really does look like I'm peering into
- 0:19the future of agentic engineering when I
- 0:21am using it. So, we have our primary
- 0:24lead agent on the lefth hand side. And
- 0:26in real time, I watched it spin up each
- 0:28one of these T-Mux terminals to create
- 0:31these agents to collaborate on the same
- 0:33task. Now, people have been doing this
- 0:35sort of split pane multi-teux terminal
- 0:38sort of setup for a while now. So, it's
- 0:41not really new, but there are a couple
- 0:43of things that make this super novel.
- 0:46The first is that our primary agent, it
- 0:49actually decided the team to form based
- 0:52on the request that I gave it. And the
- 0:54other part of this that makes it so
- 0:55powerful is that under the hood, each
- 0:57one of these agents is working on the
- 0:59exact same task list together. So this
- 1:02goes way beyond sub agents. These agents
- 1:05actually talk to each other like, "Oh,
- 1:06let me complete this before you work on
- 1:08this." They have that kind of
- 1:09communication that makes it so that we
- 1:11can take this idea of parallel agents a
- 1:13lot further. So in this video, I want to
- 1:16cover how agent teams works with you.
- 1:18It's a new experimental feature that you
- 1:20have to enable. We'll talk about how to
- 1:22set it up. I also really want to cover
- 1:24how agent teams is different from sub
- 1:27aents. A lot of people are confused by
- 1:29this right now because they operate
- 1:31really similarly. The main difference is
- 1:33we have collaboration versus isolation.
- 1:36There are pros and cons here that I want
- 1:37to cover. Agent teams is really powerful
- 1:40but it is not perfect. So we'll get into
- 1:42that which will also lead into a
- 1:44template that I have for you. This is a
- 1:46command that I've built. Basically, you
- 1:48can use this to give instructions for
- 1:50cloud code on to how to use agent teams
- 1:53better because believe it or not, even
- 1:55though this is a feature built into
- 1:56cloud code, it's not actually that good
- 1:58at using it. And so, I'll show you how
- 2:00to really take advantage of this new
- 2:02feature to do some pretty incredible
- 2:04things. Now, this code review
- 2:06demonstration that I have for you is
- 2:08just a really simple example what we can
- 2:10do with agent teams. Anthropic has
- 2:13published a couple of articles where
- 2:14they've shown how far we can push this
- 2:17idea. For example, Anthropic used 16
- 2:20agents running together with this new
- 2:22agent teams feature to build an entire C
- 2:25compiler. And let me tell you, building
- 2:27a compiler from scratch is not easy. If
- 2:30you were to hire a dev team to do this,
- 2:32it would probably be hundreds of
- 2:33thousands of dollars. But they were able
- 2:35to do it with only $20,000 in API costs,
- 2:38which yes, that is still an insane
- 2:40amount of money. agent teams is very
- 2:43tokenheavy, which is one of the
- 2:44downsides we'll talk about in a little
- 2:46bit. But it's still really cool to see
- 2:48how far they were able to push what is
- 2:50possible with coding agents just running
- 2:52together, collaborating autonomously.
- 2:54They literally just threw this in
- 2:56essentially a RA loop where they forced
- 2:58it to write, I believe, hundreds of
- 3:00thousands of lines of code to create
- 3:01this. So, it's very, very incredible.
- 3:04the kind of thing that they say later in
- 3:05this article, there's no way that a
- 3:07single agent would have been able to do
- 3:09even if you were to give this whole task
- 3:11to, you know, Opus 4.6, for example. All
- 3:14right, so really quickly, I want to show
- 3:15you how you can get your first agent
- 3:17team up and running in just a couple of
- 3:19minutes, and then we'll get into how
- 3:21it's different from sub agents because
- 3:23it is really important to understand.
- 3:25So, I will have a link to this page in
- 3:28the description. This is the official
- 3:29guide on agent teams from Anthropic.
- 3:32However, there is a lot of information
- 3:34here. It's pretty overwhelming and so I
- 3:36just want to break it down nice and
- 3:37simple for you right now. So, the first
- 3:39thing you have to do because this is an
- 3:41experimental feature that is far from
- 3:43perfect, trust me, you have to enable
- 3:45it. And so, you can either set this
- 3:47environment variable on your computer or
- 3:49in just a terminal session or you can
- 3:52add this to your settings.json. So, this
- 3:54is one of the config files for cloud
- 3:56code. You've probably worked with this
- 3:58before because it's where you set things
- 3:59like your MCP servers and your hooks.
- 4:01And so we can set this at either the
- 4:03global.cloud level or in the docloud
- 4:06project directory. And so you can enable
- 4:09agent teams just for specific projects
- 4:11if you want. So the other thing that you
- 4:13have to set up if you want that split
- 4:15pane mode where you can see all the
- 4:17terminals at the exact same time is you
- 4:19need to install either T-Mox or iTerm 2.
- 4:22These are terminal applications that
- 4:24support the split pane mode and these
- 4:25are just the two that are supported by
- 4:27claude code right now. So if you install
- 4:29T-Mox which is my recommendation or
- 4:31iTerm 2 then claude code can leverage
- 4:34that directly to create those terminals
- 4:36and you can watch them appear in real
- 4:38time. We'll see that in a second. It is
- 4:39really really cool. And so the
- 4:41instructions is a bit different
- 4:42depending on your operating system. But
- 4:45actually in the agent team skill
- 4:47resource that I have for you I have a
- 4:48readme that gives you the installation
- 4:50instructions. So really really easy.
- 4:52Just keep in mind for Windows you do
- 4:54need WSL. And so I actually have that.
- 4:57So I got my Linux subsystem here on
- 4:58Windows. I'm running on Windows right
- 5:00now. And so the first thing you have to
- 5:02do is you have to set that environment
- 5:04variable. So either like this or in that
- 5:06settings.json file. So cloud code
- 5:08experimental agent teams. Boom. There we
- 5:10go. And so now the next time I go into
- 5:12claude agent teams is available to me.
- 5:15So now, just like with sub agents, all
- 5:17we have to do is tell Claude we want to
- 5:19use the agent team feature, and it's
- 5:21going to know exactly what we mean. And
- 5:23so for a very simple example, I'm going
- 5:26to send in this request right here. So
- 5:28I'm asking it to create an agent team to
- 5:30review my codebase. Similar to the demo
- 5:32I showed you earlier, that was a lot
- 5:33longer of a prompt, though. But for
- 5:35simplicity, I'm just going to say have
- 5:36one agent focus on security, one on code
- 5:39quality, and the other on documentation.
- 5:41Now, we could use sub agents for this as
- 5:44well, but the collaboration we have
- 5:46here, even for a simple example like
- 5:48this, I think is really powerful
- 5:50because, for example, the review on
- 5:51security might affect the way that we
- 5:53see documentation. Like maybe we need to
- 5:55make sure we document any potential
- 5:57security issues that exist in the
- 5:59codebase. I think you get the idea of
- 6:00how that collaboration even for a
- 6:02review, but especially for when we're
- 6:04diving into actually writing code, that
- 6:06is really, really necessary. And so the
- 6:09lead agent here, it's going to do its
- 6:12initial analysis, think about the team
- 6:14to generate, and then it'll spin those
- 6:16off. So I'll pause and come back once
- 6:18we've gotten to that point. So here we
- 6:20go. Usually the indicator is something
- 6:21like, let me create the tasks and spawn
- 6:24all three review agents because it
- 6:26defines the task list that is shared
- 6:28between all the agents once they
- 6:30collaborate. And then in just a second
- 6:32here, we'll see the first pane spin up
- 6:34on the right hand side. And then it'll
- 6:36do all three one by one. And boom, there
- 6:39we go. We have our security reviewer to
- 6:42start. And you can see the command that
- 6:44the lead agent runs. It's just starting
- 6:46another cloud code session, but it's
- 6:48passing in the prompt to give it that
- 6:49context around its role. It is the
- 6:52security reviewer. And then giving it
- 6:53the task list and access to manage that
- 6:55with the other agents. And yeah, a lot
- 6:57is happening here. a lot of buzz on my
- 6:59screen but it has started all three
- 7:00agents now really really quickly and
- 7:03each one of them is focused on their
- 7:04individual task but they'll start
- 7:06communicating with each other. Now one
- 7:08thing that I will say is you have to
- 7:10watch the logs very very closely just to
- 7:13get a sense for when the agents are
- 7:16actually talking to each other. So maybe
- 7:18that's one of the gripes that I have
- 7:19with agent teams right now is there's
- 7:20really not that much visibility into the
- 7:23actual collaboration. And so I have seen
- 7:26examples as I've been testing things.
- 7:28And if you ask the lead agent after how
- 7:30the agents collaborated, it will give
- 7:32you a good answer, but for a lot of it,
- 7:34I just feel like I'm trusting that the
- 7:36agents really are working on the task
- 7:38list together. There's not a really good
- 7:39way to dive into it. Now, one thing you
- 7:42can do is you can press CtrlB and then
- 7:45you can press an arrow key to navigate
- 7:48between the different T-Mox terminals.
- 7:49And so I can chat with any one of the
- 7:51agents here to ask it like what are you
- 7:53currently working on? How are you
- 7:54collaborating with this agent? It's also
- 7:56really powerful to go to the primary
- 7:58agent ask that as well. It give me a
- 8:00status update on the task list and what
- 8:02the agents are working on. And then by
- 8:04the way once all of the agents in the
- 8:06team are done the lead agent will spin
- 8:08down all those terminals and you're
- 8:09brought back to the simple view here
- 8:11where you can continue to work with the
- 8:12primary cloud code agent or spin up
- 8:14another team if you want. So, I want to
- 8:17take a little bit of a different break
- 8:18from the video than I usually do. I'm
- 8:21speaking at an event this March, which I
- 8:22am super excited to tell you about. It
- 8:24is the Sonar Summit, which is Sonar's
- 8:27first ever global virtual event. And I'm
- 8:29doing a fireside chat on building self-
- 8:32validation and guardrails into AI coding
- 8:34systems. And this has been a big focus
- 8:36of mine because here's the thing, AI is
- 8:39already writing 30 to 40% of new code at
- 8:42major tech companies. So, adoption is
- 8:44pretty much universal. But teams are
- 8:46realizing that shipping code faster does
- 8:49not necessarily mean also shipping
- 8:51quality faster. Review times are
- 8:53climbing, incidents are up, and security
- 8:55vulnerabilities just slip through. So
- 8:57for my session, I'll be covering what I
- 8:59call the AI validation pyramid. This is
- 9:02a framework that allows us to define the
- 9:04validation requirements before we even
- 9:06write a single line of code. So it's a
- 9:08part of our plan. And we have our agent
- 9:10handle the foundation, all the easy
- 9:12things like the type checking and
- 9:14linting and our initial round of
- 9:16testing. And then we as the humans
- 9:17control the layers that matter most. And
- 9:20besides my event, there is a lot more
- 9:22going on at the Sonar Summit. There are
- 9:24four tracks in total with keynotes on
- 9:26the future of software development in
- 9:28the AI era, deep dives into Sonar Cube,
- 9:31sessions on integrating code quality
- 9:33into CI/CD pipelines, a lot of awesome
- 9:36events to attend. And by the way, it's
- 9:38free to come to Sonar Summit and they
- 9:40are running this virtual event in pretty
- 9:42much every single time zone. And so if
- 9:44you want to know how to ship quality at
- 9:46speed, not just code at speed, I would
- 9:49highly recommend checking it out and I
- 9:50will have a link in the description. So
- 9:52hopefully the value of agent teams and
- 9:55how to run them is clear to you. Now I
- 9:57want to talk about how they are
- 9:58different from sub aents. And this is a
- 10:01really important distinction because now
- 10:03whenever you want to do parallel work
- 10:04with claude code, you have to make that
- 10:07decision. Should I ask Claude to use sub
- 10:09agents or should I ask Claude to spin up
- 10:11an agent team? And spoiler, there still
- 10:14are a lot of times where you want to use
- 10:16sub agents instead, especially because
- 10:18of a couple of problems with agent teams
- 10:20that I'll talk about that'll lead really
- 10:22nicely into the skill that I have built
- 10:24for you. This makes Claude a lot better
- 10:27at using agent teams. So, I'm really
- 10:29excited to show you this, but first,
- 10:31let's talk about sub aents. So, the
- 10:33primary idea with sub agents is context
- 10:36isolation. We want some way to be able
- 10:38to dish out a request that could take
- 10:40tens or even hundreds of thousands of
- 10:42tokens, but all we need back is a
- 10:45summary. So, our primary agent knows
- 10:47generally what happened, but it doesn't
- 10:49have to be polluted by the context of
- 10:51the entire task. And this is important
- 10:54because context is the most precious
- 10:56resource when you're using an AI coding
- 10:59assistant. But this context isolation
- 11:01has downsides to it because there is no
- 11:03coordination between sub aents and the
- 11:05entire process is just a black box
- 11:08because it is only the summary, the
- 11:10final output that is given back to our
- 11:12primary agent. And so that is why I say
- 11:14that sub aents are generally used for
- 11:17focused tasks usually something like
- 11:19research because all we care about is
- 11:21the result that summary at the end of
- 11:24the research. If we're doing something
- 11:26like coding and we have a sub agent
- 11:28actually write code then we don't have
- 11:30any idea into the process of the sub
- 11:33aent and so the main agent loses a lot
- 11:35of context as to what was actually
- 11:37implemented which is why I say research
- 11:39over implementation. There's no
- 11:41coordination at all. These sub agents
- 11:43work completely in isolation, which does
- 11:46make them very token efficient because
- 11:48they're honed in on a single task and
- 11:50they're only communicating a little bit
- 11:52back to the primary agent. But sometimes
- 11:55you need a lot more than that. Sometimes
- 11:57you need your agents to coordinate with
- 11:58each other, manage a task list together,
- 12:01and that is where agent teams comes in.
- 12:04With agent teams, we still have a
- 12:06primary agent spinning off these
- 12:07subprocesses, but the difference here is
- 12:10they're actually talking to each other.
- 12:12So, they have this shared task list.
- 12:14They're updating each other on their
- 12:15progress, communicating to the main
- 12:17agent as well. And you can instruct
- 12:19Cloud Code in a lot of different ways
- 12:21how this communication actually takes
- 12:23place. We'll talk about that in a little
- 12:25bit. So, we have true peer-to-peer
- 12:27coordination. And this is so powerful
- 12:30for implementation because for example,
- 12:32our back-end agent might change
- 12:34something in an API endpoint where it
- 12:36would have to tell the front-end agent,
- 12:37hey, I changed this API. Make sure you
- 12:39update the front-end component that uses
- 12:42the API as well. And it can actually do
- 12:44that. When we had sub agents in the past
- 12:46doing that kind of implementation, those
- 12:48kinds of things would break all the time
- 12:50because they're not talking to each
- 12:51other. So, they'd step on each other's
- 12:53toes, but not know they're doing so. And
- 12:55so it was up to the main agent after to
- 12:57find all those bugs and fix it. And it
- 12:59was just a complete mess. And so agent
- 13:02teams is a lot better for
- 13:03implementation. But you have to keep in
- 13:06mind that sub agents are a lot more
- 13:09token efficient. It takes a lot of
- 13:11tokens to set up this task list,
- 13:14maintain that collaboration and the
- 13:16communication between the lead agent and
- 13:19all of the other agents in the team. And
- 13:21so this is a really really rough
- 13:22estimate but yeah often times when
- 13:24you're using agent teams it's like two
- 13:26to four times the token usage compared
- 13:28to just using cloud code by itself or
- 13:30using sub aents and so you oftentimes
- 13:33need the collaboration for coding. So
- 13:36generally I would say if you want a
- 13:38really simple rule of thumb right now
- 13:40you should use sub aents for any kind of
- 13:42research like diving into a codebase or
- 13:45searching the web and then you should
- 13:46use agent teams for your actual
- 13:48implementation. And so a lot of times
- 13:50when you're working with a single
- 13:52conversation of cloud code, you might
- 13:54start with sub agent research like
- 13:56analyzing the codebase and then create
- 13:58that task list and spin up the agent
- 14:00team to knock out the plan that you
- 14:02created from the research. So again,
- 14:04it's sub agents for research, feed that
- 14:06into a plan, and then send that plan
- 14:09into an agent team. Now, as powerful as
- 14:12Asian teams are, there are two more
- 14:14issues that I want to talk about with
- 14:16you and then we'll get into the template
- 14:18where I've been starting to address this
- 14:20and experiment with some things to make
- 14:22Asian teams more reliable. So, the first
- 14:24problem that I've encountered as I've
- 14:26done a lot of testing on both Linux and
- 14:29Mac is that a lot of times you have to
- 14:31be very specific with Claude. Like you
- 14:34have to say, create an agent team with
- 14:36four teammates to do this and this and
- 14:37this. If you aren't really specific, it
- 14:40just kind of hallucinates. It'll make
- 14:41weird teams. Sometimes it doesn't
- 14:43understand how to handle the T-Mux
- 14:45terminals. Most of the time it will
- 14:47work. But there's just those odd
- 14:49instances I ran into where it just
- 14:50totally fell flat on its face. And then
- 14:53the other problem that I've encountered
- 14:55is sometimes even with the agents
- 14:57communicating with each other, they
- 14:59can't truly run in parallel. For
- 15:01example, I had it happen once where I
- 15:03had my database and backend agent run at
- 15:06the same time. the database agent
- 15:08defined a bunch of the schema and then
- 15:10by the time it told the backend agent
- 15:12what the schema actually was, the
- 15:14backend agent almost was done with its
- 15:16work. So it created this entire backend
- 15:18based on a completely incorrect schema.
- 15:20So it had to go back and do a lot of
- 15:22work. And so yes, the communication was
- 15:24there for it to fix itself, but it would
- 15:27have been a lot more token efficient if
- 15:29we just did database agent first, then
- 15:32the backend agent. And so I have been
- 15:34working hard through a lot of
- 15:35experimentation to address both of these
- 15:37things with the skill that I of course
- 15:39will have links in the description. This
- 15:41is giving instructions for cloud code on
- 15:44how to more reliably create agent teams
- 15:47and manage the issue of sometimes things
- 15:49can't be totally parallel and being
- 15:51really specific for how to use the
- 15:53terminals and how to create good teams.
- 15:57And so I have this clone locally ready
- 15:59to go to create a brand new project. And
- 16:01by the way, you can use this skill, and
- 16:02I'll show you how to in a little bit, to
- 16:04create brand new projects or features in
- 16:07existing code bases. And so everything
- 16:09is driven from these instructions here,
- 16:11which I'm not going to get too in the
- 16:13weeds with this right now, but
- 16:14essentially all we have to do is give it
- 16:16a plan, something we've created with sub
- 16:18aent research or whatever. Like here's
- 16:20the next feature we want to build. So we
- 16:22give it the plan, and then it'll use
- 16:23these instructions to figure out what's
- 16:26the optimal team to address this plan.
- 16:28Should we create a backend front end and
- 16:30database agent for the team? Like what
- 16:32should it be? Also giving instructions
- 16:34for how to manage the terminals
- 16:35effectively to reduce some of those
- 16:37hallucinations. And then most
- 16:38importantly, I have this process called
- 16:41contract first spawning. So we're not
- 16:42doing everything in parallel. We we're
- 16:44setting the stage up front for some of
- 16:47that work that has to be done before we
- 16:49can just kick off all the agents like
- 16:50here's our database schema for example.
- 16:53Then we send the agents to work in
- 16:55parallel. And this has gotten very
- 16:57reliable results for me versus just
- 16:59telling Claude, "Spin up an Asian team
- 17:01to do XYZ" without any additional
- 17:03instructions. And running this is super
- 17:05easy. So, all you have to do is follow
- 17:07the instructions in the readme. And like
- 17:09I showed earlier, I even have
- 17:10instructions for how to install T-Mux
- 17:13and then enable the experimental
- 17:15feature. Copy this into the skills
- 17:17directory, either global or for your
- 17:18project. And then that'll give you the
- 17:20command. And so you can run /build with
- 17:23agent team. You give it the path to the
- 17:25plan that you've created already and
- 17:26then you can define the number of agents
- 17:29for the team or also let cloud code
- 17:31figure that out based on your plan. So
- 17:33it can be very very dynamic. So I have
- 17:35an example here in my team terminal. I
- 17:37pointed it to a plan for a brand new
- 17:39project. So I'm starting something from
- 17:41scratch and I'm going to have a team of
- 17:43three agents. And so I'll send this in
- 17:45and it'll look very similar to the demo
- 17:48that I showed you earlier for the code
- 17:49review, but this one's a lot more
- 17:51intricate. We're building an entire
- 17:53project. It has to think quite deeply
- 17:54about the agent team that it'll create.
- 17:56And we'll see it spin that up in a
- 17:58little bit here. All right. So, take a
- 18:00look at this. It's a fresh project and
- 18:02it's defined the contract chain. So, we
- 18:04need things to be set up at least partly
- 18:07in the database before we can even go to
- 18:09the back end. And then same thing with
- 18:10backend before we go to the front end.
- 18:12So, it made the decision here. This is
- 18:14all dynamic just based on the
- 18:15instructions I gave it to spawn the
- 18:17database agent first. So, it's the most
- 18:19upstream in the contract chain. So its
- 18:21first job, oh I lost that there. Its
- 18:24first job is to build the database layer
- 18:26and then send me its contract. So it
- 18:28doesn't have to be done done. It just
- 18:29has to send the contract, then it can
- 18:31spin up the backend agent. So we're
- 18:33still going to have some parallel work,
- 18:35but there's a little bit of the
- 18:36groundwork it has to lay first. And
- 18:39there we go. The database agent sent the
- 18:41contract back to the lead agent. So the
- 18:44groundwork was done. The lead agent knew
- 18:46that. And so it started the back-end
- 18:47agent as well. And then I kicked off
- 18:50another request. So the database agent
- 18:51keeps working actually. And so we're
- 18:54seeing this all happen in parallel
- 18:56still, but we had a much smarter flow.
- 18:59And so we'll see the front end start in
- 19:01a bit as well. I'm not going to show
- 19:02this full example here because the point
- 19:04more is to show the intelligence up
- 19:06front. And I really encourage you to try
- 19:08this command for yourself. Just see the
- 19:10consistency for creating these teams
- 19:13based on the plans, managing the
- 19:14terminals. It's so powerful once you
- 19:17have a bit of instruction to claw code
- 19:19for how you specifically want to use
- 19:21agent teams. So, I'd also encourage you
- 19:23to adjust the skill and the command as
- 19:25you're using it. Make it mold to your
- 19:27use case and how you want to work with
- 19:29these teams because there's a lot of
- 19:31customization that you can do for the
- 19:33specific coordination as well. Like I'm
- 19:34doing this contract first approach. You
- 19:37can do whatever your heart desires. So,
- 19:39that my friend is all that I got for you
- 19:41right now on the new agent team feature.
- 19:43Super powerful stuff. Like I said at the
- 19:45start of the video, I really feel like I
- 19:47am peering into the future of agentic
- 19:49development. But like we've talked
- 19:50about, it is far from perfect right now.
- 19:52And so I'll definitely be covering it in
- 19:54the future as anthropic continues to
- 19:57improve it once it's beyond the
- 19:58experimental feature and also once I
- 20:01work on the skill and continue to use
- 20:03agent teams better and better. And so if
- 20:06you appreciate this video and you're
- 20:07looking forward to more things on agent
- 20:09teams and agent coding, I would really
- 20:11appreciate a like and a subscribe. And
- 20:13with that, I will see you in the next
About this transcript
This page contains the full transcript of Claude Code's Agent Teams Are Insane - Multiple AI Agents Coding Together in Real Time by Cole Medin, generated from the public captions YouTube serves with the video. The transcript has 4,206 words across 582 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.
What you can do with it
Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to translate the transcript into 100+ languages.
Free YouTube transcript tool
YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, translation to 100+ languages, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.