In Claude Code, when you define an 'agent,' you are actually creating a subagent for the main Cloud agent; subagents are specialized assistants that break down complex tasks into smaller, manageable pieces to prevent context window overflow, and they can be configured to run sequentially (one after another) or in parallel (simultaneously), with each subagent having its own context window, tools, and execution conditions.
Deep Dive
Prerequisite Knowledge
- No data available.
Where to go next
- No data available.
Deep Dive
همه درباره Claude Code اشتباه میکنند! بررسی کامل Subagent و Parallel Agents
Added:Hello, we said all this in the Cloud video, but there is a misunderstanding for all the people in the world. For many, this sub-agent that you are talking about means that we define an agent and then define a sub-agent for it, and what are its types? How is it?
Now in this video we take a look at this issue again. We define an agent when we define a sub-agent. That is, for example, we have a directory and a subdirectory, something like that, which we have a subagent. Let's clear this up a bit and then let's go inside VS and take a look and talk about it a little bit. Let's move forward. Look, the real agents of the human world now, when we are working with the cloud, are the cloud itself. That means these are them. See, when I tell Cloud to go do something, it becomes my agent. Now, any custom agent I define becomes a subagent. It's not like we're going to define an agent, we're going to define a subagent. What we're going to define under the title of agent now is actually a subagent for the main agent that Cloud created. This is a point that many people don't pay attention to and are looking for ways to define an agent that their sub-agents will learn to define later. No. When we are defining an agent, we are actually defining a subagent. For whom? For the main agent who created the cloud himself. Now let's get into the discussion of subagents. Look at this cloud. For example, I have a window context, it's running, now it's performing an action, and it's filling up. Now my window context is filled somewhere else.
So, if I had a big operation, immediately after I gave it my commands, it would start executing and fill my context window, tick, and occupy, which is not interesting. Now, is there a solution? Yes, see, this is doing its job.
I'm going to break the workflow, meaning that instead of telling the main agent, which is the main agent, a subagent, I'm going to define a big task.
Well, I can define subagents that take orders from the main agent itself, which is Cloud Code.
That is, they have a body and a body command that is for themselves. The main agent gives them the command, which is the cloud code itself, saying, "Go do this and that, what happens here?
See what happens here." It goes, does the job, gets the result, and brings it back to the main agent, who is the cloud code. Now what's the good of this? The good thing about this is that the context of the windows is separated. This means that we are not working on the context of the main window at the moment the subject is working.
Several context windows will appear for me.
That is, like the topic of macro services, for example, where we break the functionality, we are struggling to make a promise of requests to Cloud Code itself. At the same time, one of the points that is important to me here is that I have a context window. I do my work in the context of other windows, instead of making a huge request to Cloud Code and having it come and do these things for me in a context window. Is that right? Now let's go inside the code and take a look at some stories.
Look, I'm not going to explain the structure of a project we just had on the cloud. I have no intention of doing such a thing. But let's take a look at some basics.
See, we had a cl.m file where we said, for example, if we have a project that we want to adhere to, for example, clean architecture, we'll mention it here.
Camel case is always going to be respected. We'll cover those basics here. We don't skimp on details. We don't perform any operations here. It's not supposed to be in the cloud. Let's say, for example, if so-and-so wants to do something, you go do it this way. No, only the main policies will be mentioned here. Is that right? So this is Claude. We have nothing to do with this, so no operations will occur here. Now I'm going to this dot-cloud folder, which now, if you haven't seen that video, you should go see what this story is about.
If my operations are very [snoring] deep and large, it should define a skill. Look, I have a skill here now that runs a Python script, runs MCP, runs a bunch of bash commands, and uses these very deep [snoring] In places like this, it's better to use skills. Don't take it, go to the agent, which is basically the same sub-agent.
Don't do this if you're going to, because it doesn't allow you to do it at all. Many times, or you have to go to it with checks and kicks, and nothing interesting comes out.
If you can't give it a series of external events outside of plain English commands, go define a skill. Don't go to an agent to define you. I intentionally put this skill here because it requires a script and many other things. If you're going to do deepfake moves, don't go to these agents. I explained the definition of skills and their types, how to access scripts, in the same video about the cloud. Now we have nothing to do with this. Let's go to the agents. This is interesting. Here, someone might make a mistake and say, "So these are agents, not sub-agent folders." So we have no, we are actually defining sub-agent code for the entire cloud.
Where is it in this agents folder? Try not to put too many sub-folders and these here. It will get lost. Then go to the whole configuration and you will be miserable. Let them all stay here in the agents folder inside the cloud. Now see, this is a simple sub-agent structure. It has a name and a description.
Now, of course, I explained these in that video.
But now, the tools that you want to use are not for these tools. These are meant to be readable. Now, I explained these there.
What should be the model? Which one of these cloud models should you use? And what color should it be when you have something in the command prompt and so on?
What color does it let you put it in? Now look, it has a body, a senior Python code reviewer. Do this yourself. If you don't know how, you can tell Cloud to produce it for you. Or go to GitHub and get these.
These are plenty. Well, now this is a simple subject.
Now look, it can be conditional, meaning it can be run based on a condition. Now look at this code, Reviver. You know this: it has an installation, a description, its tools, what access it has, its model, its color, and its body. This is a security review.
Now this is Explorer. This here determines what happens.
That means you can call the others with one of them, for example. Do you see?
This does the job very quickly.
This one, for example, look, this is deeper, this is all about security.
This is a document editor. Look, there's no need for us to sit down and teach you these.
Now, here's the video for you. These are the types of so-called sub-agents that can be defined. Well, now, look, our goal was to define an agent, namely a sub-agent and a parallel sub-agent. These were agent variants. Look, what's the difference between parallel and sequential? Look, we can have sequential, for example, meaning that one is executed one by one. For example, one is executed, then it goes on to execute the next. For example, let's combine these together and let's call the next one, for example. One by one, we can have parallel [snoring sound].
What's wrong with parallel? At the same time, you say, "Come on, let's go and check it out, for example, in terms of security and performance." We won't wait for that one. These are called parallel sub-agents. That is, for example, in one, we can simultaneously say, "Come on, go, check all three of these with one prompt. We can say, "Go, check," because we don't have to wait for that one. None of them can be executed simultaneously. All three can be executed together. It was created. There are also models that, for example, we can say that if the effort that we want, for example, is to execute a medium with a center, for example, a review with a hive, for example, it was created in other modes. This is one of the stories that can be had. So now we were able to know that we have both a parallel subagent and a normal subagent, which can now also be sequential. Now, look at this doc here.
Here, we have explained it. See, I can simultaneously say this one prompt, this source code, for example, both security check and performance. Now, when you did this, you didn't leave the word " parallel" in front of you anymore. I created this for teaching material. You say, "Go, do security viewer at the same time." That is, check, perform, test, and run simultaneously. Now, these don't have a symbol anymore. It will run simultaneously for you. But if you want sequential, for some reason, one thing needs to be done, then the next thing needs to be done.
See here. The security and the Pfaff are sequential like this. It's done. Now, now, here's an interesting thing that you've brought, but a little bit, sometimes it may not work the way you want it to.
Let me take this prompt from here. So what do I do? Let me type cloud in the terminal here.
And now, give it this prompt.
Now, if we tell it, Cloud Agent, in many cases, Cloud Agency, you see what's happening here. That is, Cloud Agency is actually showing me what activities are currently being done by the subagents.
This is interesting.
But I'm saying it's a bit like that. That is, sometimes it may not work properly.
Now, see, we implemented this. It's showing itself here. It seems that at the same time, I'm going to look at this one now.
It's showing the activities that are happening.
But now, it's definitely showing us this here all the time. Sometimes it has a bit of a story because it might mix up the session or not show a procedure that it doesn't like. I can't emphasize this too much, but in many cases, depending on the type of agent we have, it shows us which of the agents is currently working and executing. So now you are familiar with parallel agents, which are a type of subagent that is also a regular subagent, which now has a sequential type or now a conditional type. They are the same variety. And if you want to do deep work, which is supposed to go to skills, I said this so that you don't make a mistake, because it is still working for itself. That is, you can see that the agents are working neatly, and you can see that the background agent is working in the finish. Basically, if it 's in the background, it won't show any agency in that cloud. That's why sometimes you see now that it worked. He did a series of reviews and such and gave us the results. This is from this.
Now go and do what you need to do with these things and take the bag.
God bless.
Related Videos

TOP 15 Data compression Interview Questions and Answers 2019 Part-2 | Data compression | Wisdom jobs
wisdomjobs
281 views•2019-06-28

CTS 158: 802.11w Management Frame Protection
ClearToSend
4K views•2019-02-04

NDSS 2019 Send Hardest Problems My Way: Probabilistic Path Prioritization for Hybrid Fuzzing
NDSSSymposium
496 views•2019-04-02

How realistic is Cities: Skylines?
CityBeautiful
159K views•2019-02-14

GUIs & TUIs: Choosing a User Interface for Your Python Project | Real Python Podcast
realpython
2K views•2025-04-04

The OSI Model - Explained by Example
hnasr
225K views•2019-05-12

Cloud Computing - Introduction
elithecomputerguy
98K views•2019-10-07

From Traveler's Dilemma to Dynamic Routing | Demystifying Networking
IITBombayJuly
5K views•2019-08-04
Trending

Playstation NO DISC/NO BUY Fight Is Over...
DavidJaffeGames
4K views•2026-07-23

Americans Confused in Australia for 17 Minutes Straight
IWrocker
17K views•2026-07-23

Bitcoin Social Interest: Dozens of us Left
benjaminjcowen
12K views•2026-07-23

Tesla Profits Plunge & SpaceX Stock Continues Fall
TheJohnJohnstonLounge
6K views•2026-07-23