Intro to AI Agents and Subagents (Claude + Codex) — Transcript
Full transcript
- 0:00Welcome to your beginner's guide to AI
- 0:02agents. No prior knowledge is required,
- 0:04but having done some work with Claude,
- 0:06Codeex, or other AI tools would be
- 0:08helpful. The goal of this video is
- 0:09really to get you up to speed as quickly
- 0:11as possible with agents and how to use
- 0:13them effectively with mainly Claude and
- 0:16Codeex. These same principles will apply
- 0:18for other tools as well, but those are
- 0:20the main two that people are going to be
- 0:22using. And this is different than just a
- 0:23general how to use Claude or Codeex
- 0:25video. We're specifically going to focus
- 0:27in on agents or sub agents. By the end,
- 0:29you'll know what an agent really is, how
- 0:31the agent loop works, agent permissions
- 0:34and tools, how to define your own
- 0:36agents, the difference between agents
- 0:38and skills, and sub agent delegation. By
- 0:41the end of this video, I have no doubt
- 0:42you'll have a much stronger
- 0:44understanding of agents and how to use
- 0:46them effectively. This video will give
- 0:47you the intro, but there's so much more
- 0:49that you can learn about AI than what we
- 0:51can cover here. So, for that extended
- 0:52learning, I've partnered with Corsera. A
- 0:55great place to start for additional
- 0:56learning is the Google AI Professional
- 0:58Certificate. This is a series of applied
- 1:00AI courses designed to help you build
- 1:02practical AI skills through hands-on
- 1:04learning. You'll cover areas such as AI
- 1:06fundamentals, prompting, research,
- 1:08writing, data analysis, and app
- 1:11development while getting experience
- 1:12with Google AI tools such as Gemini and
- 1:15Notebook LM. After completing eligible
- 1:17certificate programs, you'll earn a
- 1:19certificate that you can add to your
- 1:20LinkedIn and resume. Corsera is
- 1:22currently offering 40% off Corsera Plus
- 1:25monthly for the first three months. So
- 1:27if you want to learn and grow, check out
- 1:29the link in the description. So let's
- 1:30now talk about what an agent actually
- 1:32is. Well, you can think of plain AI as
- 1:35giving a prompt and getting a response.
- 1:37Whereas an agent will do that in a loop
- 1:39working towards a goal. So it's
- 1:41basically going to continually execute,
- 1:43providing everything it needs to an AI
- 1:45model and using the response to execute
- 1:48on certain actions. So you can think of
- 1:50an AI agent as basically an AI that
- 1:52works towards a goal likely using
- 1:54various tools for searching the web
- 1:56making changes to your code or using
- 1:58bash to invoke different CLIs and so
- 2:01forth. So if you've used cloud code or
- 2:03codecs working on a project, you've used
- 2:06agents. However, there are various
- 2:07things to know and things you can do to
- 2:09improve your effectiveness with agents
- 2:11so that they can do more stuff for you
- 2:13and that you're using the right models,
- 2:15tools, and structure to get the best
- 2:17results possible. So, we talked about
- 2:19running AI in a loop and that's what
- 2:21makes it an agent. You might just hear
- 2:23the agent loop. What exactly is this?
- 2:25Well, basically the AI is going to
- 2:27gather context. It will read files, read
- 2:30the message you sent it, and get enough
- 2:32information to be able to create a good
- 2:34response. The goal here being the agent
- 2:36picking the next tool or the next
- 2:38action. So, let's say the action is to
- 2:40invoke some script. Well, that script is
- 2:43then going to give a response and that's
- 2:45going to be pulled into context. context
- 2:48just being all of the information that
- 2:49the agent has available to it, which the
- 2:51agent can then observe and make another
- 2:54decision. The agent will continue to do
- 2:56this until there are no more tool calls
- 2:58to execute or there is a decision that
- 3:00needs made by you or there might be some
- 3:02permissions preventing the agent from
- 3:04continuing. So to see this you can
- 3:06invoke claude from the terminal and here
- 3:08we can say what we want claude to do and
- 3:10I'll say something like how many files
- 3:12are in my top level markdown vault and
- 3:15then we can do output format JSON enter
- 3:19we're going to get a lot of stuff here
- 3:20it's not very easy to read so I'm going
- 3:22to take all of this JSON and format it
- 3:24so you can see it so this will give you
- 3:26the total run length and the stop reason
- 3:29as well as the total cost and if you
- 3:32scroll through here you'll find
- 3:33something numbum turns and this is what
- 3:37I'm talking about with the agent loop.
- 3:39There's also a reason for why we
- 3:41stopped. So we have the stop reason
- 3:42which was end turn. But why did it end
- 3:44the turn? It's because it decided that
- 3:46the job was completed. If we do
- 3:48something similar within a running
- 3:50session of Claude, you'll see the
- 3:52different things that it does obviously.
- 3:54So it ran this shell command,
- 3:58got a response, and then gave us back an
- 4:00output. So with this run, you'll have a
- 4:01model. In this case, we're running
- 4:02sonnet, but this runs within cloud code,
- 4:05and that is the harness. So, different
- 4:07harnesses are going to display
- 4:09differently. So, the harness is what
- 4:11basically translates those model inputs
- 4:13and outputs into actions, invoking
- 4:15tools, making file changes, and actually
- 4:18doing the work. The model is like the
- 4:20intelligence behind the scenes. Here's
- 4:22Deep Sea Carness. I really like the way
- 4:23it shows everything, so you can see
- 4:25every single step very clearly and any
- 4:27very clear failures. It also shows like
- 4:30tokens per second and all of these
- 4:31things as well. So sometimes the results
- 4:33you get from a model depends on the
- 4:35harness that you're using to invoke that
- 4:37model. So every agent is going to have
- 4:39context. You can see in this situation I
- 4:41ran out of context as I was using a very
- 4:44small context size. This is everything
- 4:46that the agent reads and with every chat
- 4:49you will send the entire context to the
- 4:52model and it will give the response. So
- 4:54it's going to continually grow. Many of
- 4:57those tokens will be cached and will not
- 4:59be as expensive. But it is still
- 5:01recommended to clear the context or
- 5:02compact the context regularly so that
- 5:05you're not using more context than you
- 5:07really need. So instead of keeping
- 5:09everything within context, just have the
- 5:10agent read for certain things where it
- 5:13needs. Generally though, the agent is
- 5:15always going to read cloud MD or
- 5:17agents.mmd if you're using codeex or any
- 5:19other model. And if you want to
- 5:21basically reduce the amount of context
- 5:23that the agent is using, you can have
- 5:24sections that reference different files
- 5:26that the agent will only read if it
- 5:28needs to. So for example, you could have
- 5:30a dedicated file for the mobile app or
- 5:33dedicated files for Over it might be.
- 5:36Additionally, when you have something
- 5:37like MCP, all of these different
- 5:40connections
- 5:42take up tools that the agent needs to
- 5:44consider. So often times these are read
- 5:46into the context as well so that it
- 5:49knows about the different actions that
- 5:50it can do. Keeping this list relevant is
- 5:53important so that you don't bloat your
- 5:54agent with a bunch of tools that are
- 5:56irrelevant for the work that it's doing.
- 5:58So let's talk now a little bit about
- 5:59agents versus sub aents. Are these the
- 6:01same thing? And also how are they
- 6:03different than skills? So you can think
- 6:05of two different approaches. You could
- 6:07create a sub agent which is an agent
- 6:10focused on a very specific type of task
- 6:12or you could describe this task in a
- 6:14skill that the agent you're using reads
- 6:17and it will describe everything that it
- 6:18needs to know. The major difference
- 6:20between these is that if you have a sub
- 6:21agent that is an agent that goes and
- 6:23does the work on its own and gives back
- 6:26a result whereas a skill is brought into
- 6:28the current context. So say for example
- 6:31I had a process for running tests and
- 6:33verifying my code. If I crafted that as
- 6:36a sub agent, we would create another
- 6:39agent that goes and does all that work
- 6:41and then that gives the primary agent a
- 6:43response saying whether or not the
- 6:45results were successful. If we did that
- 6:48as a skill, the primary agent would read
- 6:50that skill and then do the actions
- 6:53itself.
- 6:54So I use sub agents as a context
- 6:57management solution. If you don't want
- 6:59to bloat your primary agent, you can
- 7:01craft sub aents to do that work
- 7:03separately and in parallel to your
- 7:05primary agent. So, I utilize sub agents
- 7:08a lot, but they do have some downsides
- 7:09that you should be aware of. The biggest
- 7:11one is that there is a cost to creating
- 7:13sub aents because you have to instruct
- 7:15that sub aent what to do and that sub
- 7:17aent has to give the response back to
- 7:19the primary agent. So, here's an example
- 7:21where I instruct Claude to have a sub
- 7:23agent research sub aents. This is going
- 7:26to create a general purpose research
- 7:28agent here. And you can see it
- 7:30immediately started with 70,000 tokens.
- 7:32And I'm just going to stop that.
- 7:35Basically, every agent you create,
- 7:37you're going to have an initial cost.
- 7:39And then if there's any kind of
- 7:40communication issues, you know, it
- 7:42doesn't give the response back that you
- 7:44want and you have to do it again, you're
- 7:45going to have just a maintenance cost.
- 7:47To get around this, you can craft formal
- 7:49agents and you can just ask Claude or
- 7:51Chad GPT to help you create these that
- 7:53are limited in what they're able to do
- 7:55so that they can focus on a specific
- 7:57task. So, this is called the front
- 7:59matter of the agent and it describes the
- 8:01purpose, the model, and any tools. And
- 8:03when I launch this agent, it uses like
- 8:0520 to 30k tokens instead of that 70k.
- 8:08That's just the start. You can
- 8:09drastically save over time by keeping
- 8:11the focus of the agent very narrow. So
- 8:14it doesn't scan your entire repo or do
- 8:16anything crazy like that. So for
- 8:17example, keeping this agent focused on
- 8:19working, keeping this agent focused on
- 8:21verifying and running some tests. It
- 8:23doesn't need to understand every single
- 8:25detail. So when you have your main agent
- 8:28run one of these, it'll show up with the
- 8:30actual type of the sub agent there. And
- 8:32you can see it starts with a much
- 8:33smaller token set and already knows
- 8:35exactly what its purpose is. The last
- 8:37thing you should know to get the most
- 8:39out of agents when you're getting
- 8:40started is to understand how to utilize
- 8:42cross harness agents. So let's say I
- 8:44wanted to run an agent from codeex or
- 8:47claude. There are various approaches to
- 8:50this. And if you're going to start with
- 8:51this, there's actually a plugin for
- 8:53claude to run codeex agents and it's an
- 8:56official thing from codeex. But what I
- 8:58tend to do is usually a bit simpler. I
- 9:00just define those agent files in a
- 9:02general location and point any defined
- 9:05agents to them. So for example, here are
- 9:07a list of some of my agents and then
- 9:09this is defined as a markdown file. What
- 9:11I can do from here is define a formal
- 9:13claude code agent and a formal codeex
- 9:15agent and tell those agents to read the
- 9:18markdown from this file here. So then it
- 9:21doesn't matter what harness I'm using or
- 9:23what model I'm using, it all reads from
- 9:25the same place. And then just ask your
- 9:26AI to identify any issues with the
- 9:28definition. So for example, you might
- 9:30need to make some minor changes such as
- 9:31how the model is defined or whatever it
- 9:33might be. But I think that's a general
- 9:35approach and I do a very similar thing
- 9:37for skills as well. So that's an
- 9:38overview crash course of sub agents.
- 9:39There's so much more that I could go
- 9:41into. I would love to do a deep dive of
- 9:43agents, learning all of the different
- 9:44ways they interact and how to utilize
- 9:46them effectively. What types of models
- 9:48to use for what purposes and how to
- 9:49orchestrate a large number of sub aents.
- 9:52But I think this is a good starting
- 9:54point. At this point, you know how to
- 9:55define your sub aents and to start
- 9:57working with them. Because if you're
- 9:58just doing everything from your primary
- 10:00agent, you're going to slow things down.
- 10:02you're going to bloat that context and
- 10:04you're going to get worse results. So,
- 10:06thank you so much for watching. Let me
- 10:07know what other questions you have and
- 10:08what content you would like to see. Be
- 10:10sure to subscribe and like this video
- 10:12and stay tuned. And I'll have all the
- 10:13important links down in the description
- 10:15below.
About this transcript
This page contains the full transcript of Intro to AI Agents and Subagents (Claude + Codex) by Caleb Curry, generated from the public captions YouTube serves with the video. The transcript has 2,144 words across 302 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 choose a caption track available on the video.
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, caption language selection, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.