YouTube2Text

Intro to AI Agents and Subagents (Claude + Codex) — Transcript

by Caleb Curry · 2,144 words · 302 segments · language en · Watch on YouTube

Full transcript

  1. 0:00Welcome to your beginner's guide to AI
  2. 0:02agents. No prior knowledge is required,
  3. 0:04but having done some work with Claude,
  4. 0:06Codeex, or other AI tools would be
  5. 0:08helpful. The goal of this video is
  6. 0:09really to get you up to speed as quickly
  7. 0:11as possible with agents and how to use
  8. 0:13them effectively with mainly Claude and
  9. 0:16Codeex. These same principles will apply
  10. 0:18for other tools as well, but those are
  11. 0:20the main two that people are going to be
  12. 0:22using. And this is different than just a
  13. 0:23general how to use Claude or Codeex
  14. 0:25video. We're specifically going to focus
  15. 0:27in on agents or sub agents. By the end,
  16. 0:29you'll know what an agent really is, how
  17. 0:31the agent loop works, agent permissions
  18. 0:34and tools, how to define your own
  19. 0:36agents, the difference between agents
  20. 0:38and skills, and sub agent delegation. By
  21. 0:41the end of this video, I have no doubt
  22. 0:42you'll have a much stronger
  23. 0:44understanding of agents and how to use
  24. 0:46them effectively. This video will give
  25. 0:47you the intro, but there's so much more
  26. 0:49that you can learn about AI than what we
  27. 0:51can cover here. So, for that extended
  28. 0:52learning, I've partnered with Corsera. A
  29. 0:55great place to start for additional
  30. 0:56learning is the Google AI Professional
  31. 0:58Certificate. This is a series of applied
  32. 1:00AI courses designed to help you build
  33. 1:02practical AI skills through hands-on
  34. 1:04learning. You'll cover areas such as AI
  35. 1:06fundamentals, prompting, research,
  36. 1:08writing, data analysis, and app
  37. 1:11development while getting experience
  38. 1:12with Google AI tools such as Gemini and
  39. 1:15Notebook LM. After completing eligible
  40. 1:17certificate programs, you'll earn a
  41. 1:19certificate that you can add to your
  42. 1:20LinkedIn and resume. Corsera is
  43. 1:22currently offering 40% off Corsera Plus
  44. 1:25monthly for the first three months. So
  45. 1:27if you want to learn and grow, check out
  46. 1:29the link in the description. So let's
  47. 1:30now talk about what an agent actually
  48. 1:32is. Well, you can think of plain AI as
  49. 1:35giving a prompt and getting a response.
  50. 1:37Whereas an agent will do that in a loop
  51. 1:39working towards a goal. So it's
  52. 1:41basically going to continually execute,
  53. 1:43providing everything it needs to an AI
  54. 1:45model and using the response to execute
  55. 1:48on certain actions. So you can think of
  56. 1:50an AI agent as basically an AI that
  57. 1:52works towards a goal likely using
  58. 1:54various tools for searching the web
  59. 1:56making changes to your code or using
  60. 1:58bash to invoke different CLIs and so
  61. 2:01forth. So if you've used cloud code or
  62. 2:03codecs working on a project, you've used
  63. 2:06agents. However, there are various
  64. 2:07things to know and things you can do to
  65. 2:09improve your effectiveness with agents
  66. 2:11so that they can do more stuff for you
  67. 2:13and that you're using the right models,
  68. 2:15tools, and structure to get the best
  69. 2:17results possible. So, we talked about
  70. 2:19running AI in a loop and that's what
  71. 2:21makes it an agent. You might just hear
  72. 2:23the agent loop. What exactly is this?
  73. 2:25Well, basically the AI is going to
  74. 2:27gather context. It will read files, read
  75. 2:30the message you sent it, and get enough
  76. 2:32information to be able to create a good
  77. 2:34response. The goal here being the agent
  78. 2:36picking the next tool or the next
  79. 2:38action. So, let's say the action is to
  80. 2:40invoke some script. Well, that script is
  81. 2:43then going to give a response and that's
  82. 2:45going to be pulled into context. context
  83. 2:48just being all of the information that
  84. 2:49the agent has available to it, which the
  85. 2:51agent can then observe and make another
  86. 2:54decision. The agent will continue to do
  87. 2:56this until there are no more tool calls
  88. 2:58to execute or there is a decision that
  89. 3:00needs made by you or there might be some
  90. 3:02permissions preventing the agent from
  91. 3:04continuing. So to see this you can
  92. 3:06invoke claude from the terminal and here
  93. 3:08we can say what we want claude to do and
  94. 3:10I'll say something like how many files
  95. 3:12are in my top level markdown vault and
  96. 3:15then we can do output format JSON enter
  97. 3:19we're going to get a lot of stuff here
  98. 3:20it's not very easy to read so I'm going
  99. 3:22to take all of this JSON and format it
  100. 3:24so you can see it so this will give you
  101. 3:26the total run length and the stop reason
  102. 3:29as well as the total cost and if you
  103. 3:32scroll through here you'll find
  104. 3:33something numbum turns and this is what
  105. 3:37I'm talking about with the agent loop.
  106. 3:39There's also a reason for why we
  107. 3:41stopped. So we have the stop reason
  108. 3:42which was end turn. But why did it end
  109. 3:44the turn? It's because it decided that
  110. 3:46the job was completed. If we do
  111. 3:48something similar within a running
  112. 3:50session of Claude, you'll see the
  113. 3:52different things that it does obviously.
  114. 3:54So it ran this shell command,
  115. 3:58got a response, and then gave us back an
  116. 4:00output. So with this run, you'll have a
  117. 4:01model. In this case, we're running
  118. 4:02sonnet, but this runs within cloud code,
  119. 4:05and that is the harness. So, different
  120. 4:07harnesses are going to display
  121. 4:09differently. So, the harness is what
  122. 4:11basically translates those model inputs
  123. 4:13and outputs into actions, invoking
  124. 4:15tools, making file changes, and actually
  125. 4:18doing the work. The model is like the
  126. 4:20intelligence behind the scenes. Here's
  127. 4:22Deep Sea Carness. I really like the way
  128. 4:23it shows everything, so you can see
  129. 4:25every single step very clearly and any
  130. 4:27very clear failures. It also shows like
  131. 4:30tokens per second and all of these
  132. 4:31things as well. So sometimes the results
  133. 4:33you get from a model depends on the
  134. 4:35harness that you're using to invoke that
  135. 4:37model. So every agent is going to have
  136. 4:39context. You can see in this situation I
  137. 4:41ran out of context as I was using a very
  138. 4:44small context size. This is everything
  139. 4:46that the agent reads and with every chat
  140. 4:49you will send the entire context to the
  141. 4:52model and it will give the response. So
  142. 4:54it's going to continually grow. Many of
  143. 4:57those tokens will be cached and will not
  144. 4:59be as expensive. But it is still
  145. 5:01recommended to clear the context or
  146. 5:02compact the context regularly so that
  147. 5:05you're not using more context than you
  148. 5:07really need. So instead of keeping
  149. 5:09everything within context, just have the
  150. 5:10agent read for certain things where it
  151. 5:13needs. Generally though, the agent is
  152. 5:15always going to read cloud MD or
  153. 5:17agents.mmd if you're using codeex or any
  154. 5:19other model. And if you want to
  155. 5:21basically reduce the amount of context
  156. 5:23that the agent is using, you can have
  157. 5:24sections that reference different files
  158. 5:26that the agent will only read if it
  159. 5:28needs to. So for example, you could have
  160. 5:30a dedicated file for the mobile app or
  161. 5:33dedicated files for Over it might be.
  162. 5:36Additionally, when you have something
  163. 5:37like MCP, all of these different
  164. 5:40connections
  165. 5:42take up tools that the agent needs to
  166. 5:44consider. So often times these are read
  167. 5:46into the context as well so that it
  168. 5:49knows about the different actions that
  169. 5:50it can do. Keeping this list relevant is
  170. 5:53important so that you don't bloat your
  171. 5:54agent with a bunch of tools that are
  172. 5:56irrelevant for the work that it's doing.
  173. 5:58So let's talk now a little bit about
  174. 5:59agents versus sub aents. Are these the
  175. 6:01same thing? And also how are they
  176. 6:03different than skills? So you can think
  177. 6:05of two different approaches. You could
  178. 6:07create a sub agent which is an agent
  179. 6:10focused on a very specific type of task
  180. 6:12or you could describe this task in a
  181. 6:14skill that the agent you're using reads
  182. 6:17and it will describe everything that it
  183. 6:18needs to know. The major difference
  184. 6:20between these is that if you have a sub
  185. 6:21agent that is an agent that goes and
  186. 6:23does the work on its own and gives back
  187. 6:26a result whereas a skill is brought into
  188. 6:28the current context. So say for example
  189. 6:31I had a process for running tests and
  190. 6:33verifying my code. If I crafted that as
  191. 6:36a sub agent, we would create another
  192. 6:39agent that goes and does all that work
  193. 6:41and then that gives the primary agent a
  194. 6:43response saying whether or not the
  195. 6:45results were successful. If we did that
  196. 6:48as a skill, the primary agent would read
  197. 6:50that skill and then do the actions
  198. 6:53itself.
  199. 6:54So I use sub agents as a context
  200. 6:57management solution. If you don't want
  201. 6:59to bloat your primary agent, you can
  202. 7:01craft sub aents to do that work
  203. 7:03separately and in parallel to your
  204. 7:05primary agent. So, I utilize sub agents
  205. 7:08a lot, but they do have some downsides
  206. 7:09that you should be aware of. The biggest
  207. 7:11one is that there is a cost to creating
  208. 7:13sub aents because you have to instruct
  209. 7:15that sub aent what to do and that sub
  210. 7:17aent has to give the response back to
  211. 7:19the primary agent. So, here's an example
  212. 7:21where I instruct Claude to have a sub
  213. 7:23agent research sub aents. This is going
  214. 7:26to create a general purpose research
  215. 7:28agent here. And you can see it
  216. 7:30immediately started with 70,000 tokens.
  217. 7:32And I'm just going to stop that.
  218. 7:35Basically, every agent you create,
  219. 7:37you're going to have an initial cost.
  220. 7:39And then if there's any kind of
  221. 7:40communication issues, you know, it
  222. 7:42doesn't give the response back that you
  223. 7:44want and you have to do it again, you're
  224. 7:45going to have just a maintenance cost.
  225. 7:47To get around this, you can craft formal
  226. 7:49agents and you can just ask Claude or
  227. 7:51Chad GPT to help you create these that
  228. 7:53are limited in what they're able to do
  229. 7:55so that they can focus on a specific
  230. 7:57task. So, this is called the front
  231. 7:59matter of the agent and it describes the
  232. 8:01purpose, the model, and any tools. And
  233. 8:03when I launch this agent, it uses like
  234. 8:0520 to 30k tokens instead of that 70k.
  235. 8:08That's just the start. You can
  236. 8:09drastically save over time by keeping
  237. 8:11the focus of the agent very narrow. So
  238. 8:14it doesn't scan your entire repo or do
  239. 8:16anything crazy like that. So for
  240. 8:17example, keeping this agent focused on
  241. 8:19working, keeping this agent focused on
  242. 8:21verifying and running some tests. It
  243. 8:23doesn't need to understand every single
  244. 8:25detail. So when you have your main agent
  245. 8:28run one of these, it'll show up with the
  246. 8:30actual type of the sub agent there. And
  247. 8:32you can see it starts with a much
  248. 8:33smaller token set and already knows
  249. 8:35exactly what its purpose is. The last
  250. 8:37thing you should know to get the most
  251. 8:39out of agents when you're getting
  252. 8:40started is to understand how to utilize
  253. 8:42cross harness agents. So let's say I
  254. 8:44wanted to run an agent from codeex or
  255. 8:47claude. There are various approaches to
  256. 8:50this. And if you're going to start with
  257. 8:51this, there's actually a plugin for
  258. 8:53claude to run codeex agents and it's an
  259. 8:56official thing from codeex. But what I
  260. 8:58tend to do is usually a bit simpler. I
  261. 9:00just define those agent files in a
  262. 9:02general location and point any defined
  263. 9:05agents to them. So for example, here are
  264. 9:07a list of some of my agents and then
  265. 9:09this is defined as a markdown file. What
  266. 9:11I can do from here is define a formal
  267. 9:13claude code agent and a formal codeex
  268. 9:15agent and tell those agents to read the
  269. 9:18markdown from this file here. So then it
  270. 9:21doesn't matter what harness I'm using or
  271. 9:23what model I'm using, it all reads from
  272. 9:25the same place. And then just ask your
  273. 9:26AI to identify any issues with the
  274. 9:28definition. So for example, you might
  275. 9:30need to make some minor changes such as
  276. 9:31how the model is defined or whatever it
  277. 9:33might be. But I think that's a general
  278. 9:35approach and I do a very similar thing
  279. 9:37for skills as well. So that's an
  280. 9:38overview crash course of sub agents.
  281. 9:39There's so much more that I could go
  282. 9:41into. I would love to do a deep dive of
  283. 9:43agents, learning all of the different
  284. 9:44ways they interact and how to utilize
  285. 9:46them effectively. What types of models
  286. 9:48to use for what purposes and how to
  287. 9:49orchestrate a large number of sub aents.
  288. 9:52But I think this is a good starting
  289. 9:54point. At this point, you know how to
  290. 9:55define your sub aents and to start
  291. 9:57working with them. Because if you're
  292. 9:58just doing everything from your primary
  293. 10:00agent, you're going to slow things down.
  294. 10:02you're going to bloat that context and
  295. 10:04you're going to get worse results. So,
  296. 10:06thank you so much for watching. Let me
  297. 10:07know what other questions you have and
  298. 10:08what content you would like to see. Be
  299. 10:10sure to subscribe and like this video
  300. 10:12and stay tuned. And I'll have all the
  301. 10:13important links down in the description
  302. 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.