
Lesson Description
The "Tips for Using Subagents" Lesson is part of the full, Cursor & Claude Code: Professional AI Setup course featured in this preview video. Here's what you'd learn in this lesson:
Steve shares a few tips for working with subagents. Git worktrees are a nice solution because they allow multiple branches to be in the filesystem at one time, allowing multiple submages to execute in parallel.
Transcript from the "Tips for Using Subagents" Lesson
[00:00:00]
>> Steve Kinney: So the rough edges around these sub agents is again, I'm kind of mentioning it. It's kind of like the MCP stuff we saw earlier, where I'm kind of mentioning it. But it's somewhat like I hope that it chooses the right agent, right? And I have noticed that unless I mention the agent by name, no chance.
[00:00:18]
Which considering some of these other things, I'm okay. So like I said before, it has its own context window, it does its own thread, and then it only does the return value effectively back to the main agent, which means that if you reject that, that's gone, it's not in that context thread anymore.
[00:00:35]
Which means those tokens kiss them goodbye. Maybe you could find them in those files that live in your home directory. I have not checked. The other thing is we see that constant flow of information from the main agent. You can see that. All I can see is that front end architect is doing something or the junior engineer is doing something.
[00:00:56]
I don't know necessarily what they're doing. Like I said, as we saw token and time bloat say I was setting something up, token and time bloat splitting stuff up. And in this case, we're serializing, not parallelizing, it is gonna take extra time. And then obviously too many chefs in the kitchen.
[00:01:18]
And those prompts that we saw, I would probably edit them down over time. Like again, this is a feature that came out four or five days ago. So those will probably be things I edit and tweak as time goes on, but time has not gone on yet. So like I said, I would probably start small and keep them short because they will eat up your token budget.
[00:01:48]
I have never had it pick one on its own just yet and honestly, I don't want it to. So name the ones when you wanna pull them in, make sure they're clear, and don't let them do things they shouldn't be able to do. Especially with the MCP servers we talked about before with Cursor and with Claude, really we have this problem which is like, hey, if you have all these CP servers, all of the information is getting sent as options that the LLM can choose, even if you don't want to use them.
[00:02:19]
With now these sub agents, you can say, hey, test engineer, you have the ability to spin up playwright, front end architect, you're not allowed to contribute code anymore. Get out of here. You have the ability to edit markdown files and Google Docs and go to meetings. You can have an agent who is allowed to touch the ESLint files and, and the rest of them aren't.
[00:02:48]
You know what I mean? I think there's a lot to play with here in terms of like permissioning and how you play with that context. And again, a lot of this is very new and is an emerging field. But I think that there's definitely. It's like I'm like, I could see already like having used this for like five days now, I'm like, I'm into it.
[00:03:08]
So yeah, keep it, you know, just keep it small and limited, cuz it's all part of what we said before. A few other things we talked about git work trees but I got a few slides so we're going to talk about them again. So the question came up earlier, we answered it with background agents of how do you parallelize stuff?
[00:03:26]
Because if they're all working on the same branch, you're going to have a gitastrophe. Git work trees are a feature in git that let you spin off multiple timelines from the sacred timeline and like have different things happening all on your same file system. I, you know, have played with it.
[00:03:50]
At one point I was like, this is the way. First of all, you will just hit your rate limits 4 times faster, 5 times faster, 10 times faster. So that's the thing. Two, if you are reviewing all this code, are you really moving any faster? And three, it's now you've got all these directories you gotta clean up and like bun install.
[00:04:11]
So they exist, I think a lot of people talk about them and like them. The people who are like posting that they have nine terminal windows open. When anthropic tightened the rate limits, they were definitely saying because the people who are using this 24/7 are ruining it for everyone.
[00:04:28]
Yeah, there's a piece to that. So you can go spin them up, basically git worktree add. I have found that having. And I'll show you this in the repo in a second. I have a subdirectory so that my node modules will still work and I get ignore and everything, ignore ESLintIgnore that folder.
[00:04:48]
I don't use it anymore because I personally found that I don't need. When I was vibing all the time in the earliest days, I'm like, now I can vibe four times at the same time. That's a lot of vibes. Then I realized that I had to be responsible to review plans and read everything.
[00:05:08]
And I'm like, I'm still the main thread, I'm still blocking. And so you can do these. This is a pattern that I think a lot of people like the Anthropic team recommends. So I think it's worth mentioning there is this app called Crystal which will effectively it's like Electron Apple as is everything that will let you spin up multiple work trees in a graphical user interface.
[00:05:32]
The problem is all your clotting now lives in this little box in here. But it'll show you the git diff. It's an open source project and as I mean for an open source project that is pretty young. It's good, it's definitely every version is a noticeable improvement over the previous one.
[00:05:50]
That is both a compliment to the current version. I'll leave it there. And so if one wanted to try it I found that this was way more sane than doing it myself. Other things that you could try is having some commands and letting Claude make and destroy the trees itself.
[00:06:12]
I don't have the stomach for that. It's worth it if you are interested in it, so definitely worth checking out as well.
Learn Straight from the Experts Who Shape the Modern Web
- In-depth Courses
- Industry Leading Experts
- Learning Paths
- Live Interactive Workshops