Latest / AI Fire Daily / #47 Robin: The End of Mega-Prompts - Building an AI Workforce with Claude Code Subagents
Transcript
- 0:00Imagine feeding a single book draft into an AI.
- 0:04Instantly, you get five completely different
- 0:06reviews back. One review is from Linda. She's
- 0:09a retired teacher, brand new to AI. Another is
- 0:12from David, a corporate executive. Right. It's
- 0:14the exact same text draft, but you get completely
- 0:18distinct parallel perspectives. It feels like
- 0:22actual magic, but it's really just smart engineering.
- 0:25It really is. It's a fascinating shift in how
- 0:27we interact. Okay, let's unpack this. Welcome
- 0:30to our deep dive today. We're exploring the hidden
- 0:32power of Claude Code's sub -agents. We're going
- 0:35to look at what they actually are. We'll see
- 0:36why they save massive time and money. Then we'll
- 0:39help you build a custom plan roaster. We'll also
- 0:42set up vital safety guardrails you need. And
- 0:44finally, we'll scale up to dynamic workflows.
- 0:47I'm joined by our expert guide today. Let's dive
- 0:50right in. Hey there. I'm incredibly excited to
- 0:53get into this topic. That opening scenario with
- 0:55the book reviews sounds incredible, but I want
- 0:56to understand the mechanics here first. How does
- 0:59that parallel work actually happen behind the
- 1:01scenes? Well, it's a beautifully simple system
- 1:03of delegation. You can think of the main chat
- 1:05as your boss. The sub -agents are the workers.
- 1:07You only ever talk directly to the boss. Sub
- 1:10-agents don't talk to you directly either. They
- 1:12don't even talk to each other. They just do their
- 1:14job and report back. So it's kind of like a bustling
- 1:17restaurant kitchen. The main session is the head
- 1:19chef talking to customers. The sub -agents are
- 1:22prep cooks chopping onions in the back. Yeah,
- 1:24that's a perfect analogy. And setting up your
- 1:26kitchen this way gives four massive benefits.
- 1:29The very first one is keeping a pristine context
- 1:33window. Long AI chats get polluted incredibly
- 1:37fast. Yeah, because you make the AI read up on
- 1:40stuff. Like reading about Firefly's AI, just
- 1:43for a quick summary, that junk stays in its memory
- 1:45forever. Nobody wants that useless noise clogging
- 1:48up the conversation. Exactly. Every single token
- 1:50matters. The second benefit is a drastically
- 1:53lower overall cost. You use the really smart
- 1:56Opus model for planning, but you spin up cheaper
- 1:59Haiku models for heavy reading. That makes perfect
- 2:02financial sense right there. You don't pay a
- 2:04head chef to peel potatoes. Spot on. The third
- 2:07benefit is pure parallel work. You can review
- 2:1015 book chapters at the exact same time. You
- 2:13could research five different competitors all
- 2:14at once. That speed is just incredible. I know
- 2:18trying 15 chapters normally makes the AI hallucinate,
- 2:21so parallel work clearly fixes that issue. But
- 2:24what about the actual quality of the feedback?
- 2:27That brings us right to the fourth huge benefit.
- 2:30You get a truly fresh review every time. Subagents
- 2:34always start with completely blank memories.
- 2:37They give you honest and unbiased feedback. They
- 2:39aren't trying to be agreeable. Is context pollution
- 2:41really that big of a deal in normal workflows?
- 2:44Yes. It's a massive problem. Forcing one model
- 2:47to hold every file degrades its focus. It loses
- 2:49its logic over time. So crowded memory makes
- 2:52the AI lose focus and logic. Exactly. The kitchen
- 2:55analogy makes total sense to me. I definitely
- 2:57want those prep cooks saving me time. But if
- 2:59I'm the head chef here. How do we actually hire
- 3:01them? How are they given their specific instructions?
- 3:04It's surprisingly simple under the hood. A custom
- 3:06subagent is literally just a single markdown
- 3:08file. You usually store it in a hidden .clodagents
- 3:11folder. Wait, hold on. Just a standard text file?
- 3:14I assumed we were talking about complex Python
- 3:16scripts here. Nope. Just a standard markdown
- 3:18file. It has two completely distinct parts. The
- 3:22top part is the YAML front matter. Let's pause
- 3:25for a second. Define YAML front matter for us.
- 3:27A small... settings block at the top of a file.
- 3:31Got it. It holds the name and the trigger description.
- 3:34It also holds the model you want to use. Just
- 3:36basic configuration then. So what is the second
- 3:39part of the file? The second part is the main
- 3:41body. That's the actual workflow. It tells the
- 3:44agent exactly how to think. It lists the exact
- 3:46steps and the required output format. I read
- 3:49that Claude uses progressive disclosure here.
- 3:51Why is that specific feature so important? Think
- 3:54about it like RAM on your computer. If Claude
- 3:58loaded massive instruction sets every time you
- 4:00said hello, it would just grind to a total halt.
- 4:03Progressive disclosure means it only reads that
- 4:05tiny trigger description first. Ah, I see. So
- 4:08if the trigger matches, it loads the full body.
- 4:10That saves a massive amount of processing power.
- 4:13It's exactly right. Let's look at a concrete
- 4:15example to make this real. We call it the plan
- 4:18roaster. I really love that name. It's a phenomenal
- 4:21tool. The trigger description is kept remarkably
- 4:24simple. It just says to use this agent to critique
- 4:28a plan. I have a confession to make here. I still
- 4:32wrestle with prompt drift and misfires myself.
- 4:35Beat. It's frustrating when the AI just ignores
- 4:38your tools. Here's where it gets really interesting,
- 4:41though. People fall into a psychological trap
- 4:43when building these. They make those trigger
- 4:46descriptions way too long. They really do. It's
- 4:48a very classic mistake. A long description confuses
- 4:51the whole routing system. You must keep it remarkably
- 4:53short and punchy. Put the real heavy lifting
- 4:56down on the body instead. Right. The body is
- 4:58where you get highly specific. You tell the agent
- 5:01to find the absolute weakest points. Yeah, and
- 5:04you tell it to explain what could go wrong. You
- 5:06want it to be totally ruthless. What happens
- 5:08if the sub -agent just doesn't fire when I want
- 5:11it to? Well, that's called a misfire. It usually
- 5:13means your description is too vague. You fix
- 5:16it by trimming the description down. If it ignores
- 5:18you, make the trigger description shorter and
- 5:20sharper. Precisely. Okay, we know how to build
- 5:23one now. But once we write this text file down,
- 5:26where do we actually put it? We don't want these
- 5:28prep cooks getting lost. You need to understand
- 5:30skills versus subagents first. Skills run directly
- 5:34inside your main session context. Subagents run
- 5:38in a separate, fresh session entirely. But they
- 5:41aren't totally isolated from each other, right?
- 5:43They can actually work together. Absolutely.
- 5:44A subagent can actually invoke a skill. Right.
- 5:47Imagine spinning up five subagents at once. They
- 5:50all use a LinkedIn research skill simultaneously.
- 5:53That is an incredibly powerful combination. It's
- 5:55like giving your prep cooks power tools. It really
- 5:58is. Now, for storing these files, you have two
- 6:00main choices. You have project -level folders
- 6:02and global -level folders. Let's break down why
- 6:05you'd use one over the other. Project -level
- 6:08agents live inside your specific code repository.
- 6:11They're best for dedicated team workflows. Think
- 6:15about a strict security reviewer agent. That
- 6:17makes total sense. Because when you push the
- 6:20code to GitHub, your entire team gets that specific
- 6:24agent automatically. It stays directly with the
- 6:27project it belongs to. Exactly. Global agents
- 6:30live in your personal user directory instead.
- 6:33You use those across all your different projects.
- 6:36A personal writing reviewer is a great example.
- 6:38If I put an agent in the wrong folder, am I stuck?
- 6:41Not at all. Since they're literally just standard
- 6:43markdown files, you can just drag and drop them
- 6:45to a new folder later. They are just text files.
- 6:48You can move them anywhere, anytime. Exactly
- 6:50right. It's highly flexible. Midroll sponsor
- 6:52read placeholder. All right, let's get back to
- 6:55it. Okay, we have an army of cheap parallel workers
- 6:57now. We know how to build them and store them.
- 7:00But if we let them run wild, they could completely
- 7:03break our systems. We need to talk about security
- 7:05guardrails. Security is absolutely non -negotiable
- 7:08here. You have to adopt a zero -trust mindset.
- 7:11If an AI can touch something, assume it might.
- 7:14That is a slightly terrifying but deeply realistic
- 7:17rule. How do we actually enforce that zero trust
- 7:21policy? You must use strict tool restrictions.
- 7:24Always use read -only tools for your review agents.
- 7:27Our plan roaster doesn't need permission to write
- 7:29files. It only needs to read your plan and return
- 7:32feedback. So you only give edit access when strictly
- 7:34necessary. Never do it by default. Exactly. You
- 7:38also have to carefully limit your MCP access.
- 7:41Let's define MCP servers for the listener really
- 7:43quickly. Tools letting AI talk to your private
- 7:46databases and apps. Got it. So you don't give
- 7:48a writing critic database access. Please don't.
- 7:51That's a recipe for absolute disaster. Imagine
- 7:54a rogue subagent accidentally dropping your user
- 7:56tables. You also need to enforce max turns in
- 7:59your settings. What does the max turn setting
- 8:01actually do? It firmly caps how long an agent
- 8:04works. It prevents them from getting stuck in
- 8:06infinite loops. And it stops them from burning
- 8:09through your wallet. What about downloading community
- 8:11agents from public repositories? People really
- 8:13love sharing their custom setups online. Be incredibly
- 8:17careful with those. They're still just basic
- 8:19instruction files. They can easily contain malicious
- 8:21prompt injection or data leaks. You know what
- 8:24I think is a brilliant idea here? Building an
- 8:27AI agent specifically to act as a bouncer? Its
- 8:30entire job is just to inspect third -party agents.
- 8:33That's a fantastic safety practice. Build a read
- 8:36-only verifier subagent just for that exact purpose.
- 8:39It reviews the code before the boss ever sees
- 8:42it. Why isn't a prompt like, do not edit files
- 8:44enough to keep an agent safe? Because text instructions
- 8:48can be ignored or hallucinated away. Real permission
- 8:51limits physically block the AI from taking dangerous
- 8:54action. Never trust a polite request. Use hard
- 8:58permission blocks instead. That is the golden
- 9:00rule of agent security. So our system is safely
- 9:02locked down and isolated now. How far can we
- 9:05actually push this boss -worker relationship?
- 9:08What is the true ceiling here? We can push it
- 9:10remarkably far. Your main session can spin up
- 9:13massive numbers of sub -agents. We're not just
- 9:15talking about three or five agents. We're talking
- 9:17about serious dynamic scale. You can deploy 40.
- 9:20100 or even 200 agents. And they all run in perfect
- 9:24parallel simultaneously. I've seen developers
- 9:26trigger this by typing ultra code. It's kind
- 9:29of become a meme online. Yeah, that's a dramatic
- 9:32trigger phrase people use. The use cases for
- 9:34this scale are completely wild. You can review
- 9:37a massive legacy code base instantly. You can
- 9:40test dozens of experimental bug fixes all at
- 9:42once. Or review a massive thousand page book
- 9:45chapter by chapter. Two sec silence. Whoa, imagine
- 9:48scaling to 200 agents testing code -based fixes
- 9:51at once. That's a whole tech company inside your
- 9:53laptop. It really is. It fundamentally changes
- 9:56how fast you can iterate. But there's a very
- 9:58serious warning here. This burns through your
- 10:01session limits incredibly fast. It eats through
- 10:04your API tokens like crazy. Yeah, I can see how
- 10:07that gets expensive quickly. If you aren't paying
- 10:08attention, that's a massive bill. Exactly. Don't
- 10:12use dynamic workflows for small, trivial edits.
- 10:15Save this incredible power for the truly massive
- 10:17parallel tasks. When should I absolutely avoid
- 10:20using a subagent or dynamic workflow? Avoid them
- 10:23when the task is tiny, or if it depends heavily
- 10:26on previous chat history, or if it requires constant
- 10:29back -and -forth conversation with you. Keep
- 10:31small, highly conversational tasks in the main
- 10:34chat window. Exactly. Don't overcomplicate the
- 10:36simple stuff. So... Stepping back from all the
- 10:39technical execution, what does this all mean
- 10:41for us? If we connect this to the bigger picture,
- 10:44the core philosophy here is delegation. You have
- 10:47to change how you think. Ask yourself a simple
- 10:49question. Is this task going to dump a huge pile
- 10:53of text into my chat window? Stuff that I'll
- 10:55never actually read again. If the answer is yes,
- 10:58you delegate it immediately. Exactly. Keep the
- 11:01boss smart on Opus. Make the workers cheap on
- 11:04Haiku. Keep your context completely clean. And
- 11:07start small by building highly specific narrow
- 11:09specialists. We're moving into a really strange
- 11:12new era. You're no longer just an AI user typing
- 11:15prompts. You're an actual AI middle manager right
- 11:18now. Think about the implications of that for
- 11:20a second. What happens when your subagents eventually
- 11:23get the ability to hire their own subagents?
- 11:25At what point do we lose track of the bureaucracy?
- 11:27There's going to be this massive invisible bureaucracy
- 11:30happening inside our own computers. Beat. That
- 11:33is a mildly terrifying but utterly fascinating
- 11:35thought. It changes the whole definition of personal
- 11:38computing. It really does. I want to challenge
- 11:41you, the listener, go into your .cloud agents
- 11:43folder today. Just write one simple read -only
- 11:46subagent. See what happens when you delegate
- 11:48a tiny piece of your workflow. Thanks for joining
- 11:50us on this deep dive. Let those prep cooks get
- 11:53to work.