Claude Code Sub-Agents — 5 Different Personalities

  • Channel: Nate Herk
  • Video: Watch on YouTube
  • Tags: nate herk claude code sub agents

Overview

Nate Herk demoes Claude Code spinning up 5 sub-agents with different personalities — beginner, senior engineer, designer, investor, founder — all collaborating on a single project.

Key Takeaways

  • So i don’t know what’s going on up here, but i just told claude code to spin up five different sub-agents and they all have different personalities. one is going to be a complete beginner, one will be a software
  • See that this is now running four agents, the fifth one’s about to spin up, and on the bottom, if i click into a different session, so we’ve got the main or we’ve got like the beginner, and i enter
  • Elementary school teacher, you are a complete beginner to ai. and then we see the actual task, which is to read all the chapters and give a bit of a review. and so all of the other sub-agents probably have
  • What we can do is have our main session up here, and the main session can delegate to as many different sub-agents as we want, and all the sub-agents can have different chat models, different personas, different skills, different subject
  • They are, when you need to use them, and how you can use them better than 99% of people using cloud code. so let’s not waste any time and get straight into the days video. okay, so what is the
  • And then it comes back with an overall review. apparently i need to do some work on this book because i only got about an eight. more info on my book will be coming soon. but anyways, the main session
  • Can assign the work. go read these files, go do this research, go fix that book, and then you come back to me with a report of what you did, and i’ll communicate that back to nate. so there are
  • Just talking, hello, how are you doing, what’s going on? let’s build something, right? like maybe we’re doing research, maybe we’re building an app, whatever it is. you start to fill up your context window, which you guys can see
  • Something off to a sub-agent, as you guys saw earlier, it’s a completely fresh chat. so just to show you guys another real quick visual demo, i’m in the desktop app, which is a little bit easier to see, and
  • Session. i can talk to this thing, it’ll help me do research on different tools, and then what happens is it kicks off a researcher agent to do the research. and what’s cool is right now, you’ll notice i’m using
  • If i click on this agent here, you can see this is basically the prompt that the main agent sent over to this sub-agent, which was, hey, research fireflies.au.i. give us what it is, core features, how it works, pricing,
  • Of research or reading a ton of stuff, that you don’t want to fill up your main context window, right? so that’s one thing. there’s also built-in sub-agents, which is the one we just saw, right? that was basically a
  • In the demo, when we spun up those different agents, i said, hey, one should be a software engineer, one should be a beginner, blah, blah, blah. you remember those also said general purpose. so those were still built-in native
  • Be a markdown file. so if i opened up my vs code, you guys know in the dot-cloud folder, we have different things. and the one you probably know the best is called skills. so in the skills folder, let’s
  • Could send it to my team. and also what i have to do is put this markdown file in their dot-cloud in a skills folder and then they’re able to use it. and so a sub-agent is the exact same

Transcript

So I don’t know what’s going on up here, but I just told Claude Code to spin up five different sub-agents and they all have different personalities. One is going to be a complete beginner, one will be a software engineer, one will be a business owner, one will be a publisher. And it comes back and it says, okay, I’m kicking off all five now, each with a distinct persona and lens, these will run in parallel. You can see that this is now running four agents, the fifth one’s about to spin up, and on the bottom, if I click into a different session, so we’ve got the main or we’ve got like the beginner, and I enter this conversation, we can actually see what’s going on here, meaning if I scroll up, I can see the actual prompt that the main session kicked off to this sub-agents. So here we have Linda, 58 years old, a retired elementary school teacher, you are a complete beginner to AI. And then we see the actual task, which is to read all the chapters and give a bit of a review. And so all of the other sub-agents probably have a very similar prompt, if I go to like the Enterprise exec, so same exact prompt except for here, you’re role-playing as David 52, a COO at a 12,000 person, Fortune 500 financial services company. So anyways, the point being, what we can do is have our main session up here, and the main session can delegate to as many different sub-agents as we want, and all the sub-agents can have different chat models, different personas, different skills, different subject matter expertise. And if you watch my video where I ranked all of my favorite cloud code features, sub-agents ranked number six. So today what I’m gonna do is I’m gonna tell you guys, exactly how to use them, what they are, when you need to use them, and how you can use them better than 99% of people using cloud code. So let’s not waste any time and get straight into the days video. Okay, so what is the sub-agent? You guys just saw a demo, we have a main chat, so right here is where I said, hey, can you spin up five different sub-agents, and what it did is it right here, kicked off five different ones, and then it comes back with an overall review. Apparently I need to do some work on this book because I only got about an eight. More info on my book will be coming soon. But anyways, the main session is basically the orchestrator. It says, okay, cool, so I am the one who’s actually talking to Nate, but what I can do is I can spin up a bunch of sub-agents, I can only talk to me, and I can assign the work. Go read these files, go do this research, go fix that book, and then you come back to me with a report of what you did, and I’ll communicate that back to Nate. So there are a ton of different reasons why these sub-agents are useful and why they exist. So let’s just start with this first one, which is that it keeps your context clean. So let’s say I’m in Cloud Code, right? And I’m just talking, hello, how are you doing, what’s going on? Let’s build something, right? Like maybe we’re doing research, maybe we’re building an app, whatever it is. You start to fill up your context window, which you guys can see right here with my status line. You can see right now where about 48,000 tokens in, 5% of the way up. And so as this starts to fill up, it starts to get polluted with information, but if you kick something off to a sub-agent, as you guys saw earlier, it’s a completely fresh chat. So just to show you guys another real quick visual demo, I’m in the desktop app, which is a little bit easier to see, and it’s visually more pleasing than the terminal sometimes. But let’s say I said, hey, Cloud Code, go ahead and kick off a sub-agent to do some research for me about a product called fireflies.au. And so this is my main session. I can talk to this thing, it’ll help me do research on different tools, and then what happens is it kicks off a researcher agent to do the research. And what’s cool is right now, you’ll notice I’m using Opus, right? Which is obviously the most expensive model, but we can have a sub-agent kick off and do research with high-coo or so on it. So we’re getting this research for cheaper, and we’re getting a fresh context. So if I click on this agent here, you can see this is basically the prompt that the main agent sent over to this sub-agent, which was, hey, research fireflies.au.i. Give us what it is, core features, how it works, pricing, give us all the stuff. And now this agent is the one over here searching the web and creating its opinions, rather than our main session. So this helps preserve your main context, in case you’re ever doing a ton of research or reading a ton of stuff, that you don’t want to fill up your main context window, right? So that’s one thing. There’s also built-in sub-agents, which is the one we just saw, right? That was basically a built-in cloud code research agent that will, you’ve probably seen a get-in-voked automatically without you even asking it to be invoked. And then you’ve got custom sub-agents that you’re actually able to build yourself. And if you guys remember earlier in the demo, when we spun up those different agents, I said, hey, one should be a software engineer, one should be a beginner, blah, blah, blah. You remember those also said general purpose. So those were still built-in native generic agents that just had a prompt. So that doesn’t mean that we built those custom agents, that was just a general purpose agent that cloud code prompted differently. If we wanted to actually build a custom agent, that would be a markdown file. So if I opened up my VS code, you guys know in the dot-cloud folder, we have different things. And the one you probably know the best is called skills. So in the skills folder, let’s just take a look at real quick, my agent builder skill. What this is is it’s a markdown file. This lives as markdown so that I could send it to you guys. I could put it in my community. I could send it to my team. And also what I have to do is put this markdown file in their dot-cloud in a skills folder and then they’re able to use it. And so a sub-agent is the exact same actual tangible thing as a skill.md file. It’s just called something else. You know, we’ve got the YAML front matter up here. And then we have the instructions of what the skill does and the actual steps to take. So if I open up my agents folder, also in my dot-cloud, you can see I’ve got a different, a couple different A to two, right? So this one let’s just look at is called the clickup-searcher.md. And that’s an agent that’s called clickup-searcher. We’ve got the YAML front matter up here, name clickup-searcher, we’ve got the description, we’ve got the model, which I’ve defined here, we’ve got the color, which means if I actually use the clickup-searcher agent, it shows the color. So actually let me just show you. Can you go ahead and use the clickup-searcher agent to show me what we’ve talked about today in the weekly commitment’s channel? And so what you’ll notice is I invoked that with completely natural language, I’ll have the clickup-searcher agent pull today’s messages. And then right here I can see the green color. So that’s all it means when you actually assign an agent, a color, it’s just so you can actually see it right there. And down here, you know, earlier, right here is where it’s a general purpose. What it says now is clickup-searcher, and that’s how we know that that’s a custom agent that we built ourselves. So anyways, those are the two differences. And like I said, it’s just one markdown file. And what this is called up here, the YAML front matter, that’s called progressive disclosure, which basically means if you say, hey, go do X, Y, and Z for me, cloud code will naturally go search through your subagents and your skills to see if you have any subagents or skills to you. And so for the rest of this video, I’m just gonna say subagents not skills, but they both work with this kind of progressive disclosure process. But the idea is that cloud code is able to read, just the front matter, just the name and the description, and then decide does this apply to this prompt. If so, I’ll pull in this subagent and I’ll run all of the extra stuff and read it. But otherwise, I’m not gonna waste my tokens by reading everything. If I’m not going to end up invoking that subagent. So that’s why we have the CML front matter and that’s why that’s very important. Besides the fact that it also defines things like tools, model. And then there’s tons of other lovers you can pull there, but not gonna dive into that right now. So anyways, settings up top and then your instructions go below that. And these are the four that I think matter the most, the name obviously so you can reference the subagent. The description is really important. This is basically the trigger. And this is how you can make sure that your subagents are getting invoked without you actually saying, hey, go invoke this x, y, and z subagent. So the more precise that your descriptions are, the more often cloud code will actually trigger them. And you won’t get misfires. Misfires basically meaning you want it to invoke a subagent, but it doesn’t or you don’t want it to invoke a subagent, but it does. And so sometimes the only way that you can really make sure that you’re tuning the actual front matter so that you’re not getting this misfires is you just have to test it out. And you just have to use it more and more. And then like when it doesn’t fire and you think it should, you just think about, okay, why didn’t that happen? And then you update the description and then same thing if it’s the opposite way around. And then if you go to the actual cloud code documentation on these subagents, you can see all of the different things that you can actually put in the front matter. You can put tools like we just mentioned, but you can also put disallowed tools. So if you don’t want it to ever write or edit files, you can put that so that these subagents are explicitly read only. You can also define things like which MCP servers it’s allowed to use. And you can even give it skills. So basically any setting that you want to configure for your custom subagents, you can pretty much do. Just come to the documentation, have cloud code read the documentation and say, hey, I want to set up a subagent that does X, Y, and Z. It should not be able to do X, Y, and Z. It should be able to look at this data, not look at this data. And it will help you build the right EMF front matter. So how do you actually write a great subagent? So obviously, not having a weak description. So having a very precise type of description,

(Transcript truncated — full length available on YouTube)

0 items under this folder.