YouTube2Text

Agentic Coding ENDGAME: Build your Claude Code SDK Custom Agents — Transcript

by IndyDevDan · 3,180 words · 463 segments · language en · Watch on YouTube

Full transcript

  1. 0:00Agentic engineering leads every engineer
  2. 0:03down one single path. Better agents,
  3. 0:07more agents, and then custom agents. If
  4. 0:11you can prompt engineer and context
  5. 0:13engineer a single agent successfully,
  6. 0:15then the next step is to add more
  7. 0:17agents. Scale your compute to scale your
  8. 0:20impact. Then once you learn to delegate
  9. 0:23work to sub agents and new primary
  10. 0:26agents, there's only one place left to
  11. 0:29go. Custom agents. But why isn't Cloud
  12. 0:32Code, Codeex CLI, or the Gemini CLI
  13. 0:35enough? The out ofthe-box agents are
  14. 0:37incredible, but there's a massive
  15. 0:39problem with these tools. They're built
  16. 0:42for everyone's codebase, not yours. This
  17. 0:44mismatch can cost you hundreds of hours
  18. 0:47and millions of tokens scaling as your
  19. 0:50codebase grows. This lesson is about
  20. 0:52flipping that equation. Here we master
  21. 0:56custom agents so your compute works for
  22. 0:58your domain, your problems, your edge
  23. 1:01cases. This is where all the alpha is in
  24. 1:04engineering. It's in the hard specific
  25. 1:07problems that most engineers and most
  26. 1:09agents can't solve out of the box. In
  27. 1:13this advanced lesson, we showcase eight
  28. 1:15unique custom agents built on the Cloud
  29. 1:18Code SDK. Each one showing you how to
  30. 1:21deploy across your stack, products, and
  31. 1:24engineering life cycle. The agents are
  32. 1:27on the horizon. It's time to master
  33. 1:29agents by going all the way to the bare
  34. 1:31metal to the custom agent so you can
  35. 1:33scale your compute far beyond the rest.
  36. 1:37[Music]
  37. 1:41In the building specialized agents
  38. 1:42codebase inside of apps, you can see
  39. 1:45eight custom agents. Let's start simple
  40. 1:47with the pong agent.
  41. 1:53So, here is a simple agent that's going
  42. 1:55to showcase the most important aspect of
  43. 1:58custom agents. You can see we have a
  44. 2:00simple, concise user prompt and agent
  45. 2:03response. And we have some session
  46. 2:04stats. Let's run this again. All right,
  47. 2:06let's go ahead and change our prompt.
  48. 2:07Hello. Simple prompt. We're just getting
  49. 2:09started with custom agents. I said
  50. 2:10hello. It just responded with pong.
  51. 2:13Okay. Um, summarize this codebase. Okay,
  52. 2:16there's my user prompt. And once again,
  53. 2:18the pong agent is responding again with
  54. 2:21pong. What's going on here? Let's ask it
  55. 2:23what's happening. Can you do anything
  56. 2:25other than pong? Okay, there's a user
  57. 2:28prompt and okay,
  58. 2:31so all this agent does is ponk. Type one
  59. 2:34more here. Just going to write ping.
  60. 2:35This silly agent encapsulates the most
  61. 2:38important concept when you're building
  62. 2:41custom agents. No matter what we prompt
  63. 2:43here, the response is always pong. Why
  64. 2:45is that? Let's dive in to this file. So
  65. 2:47the first most important concept is none
  66. 2:49other than the system prompt. We are
  67. 2:51using the cloud code SDK and we're
  68. 2:53setting up only two things. We're
  69. 2:56modifying just two aspects of this
  70. 2:58agent, but it changes everything. So you
  71. 3:01can see cloud forson and here the system
  72. 3:04prompt. So let's open up the system
  73. 3:05prompt. You can see we have this
  74. 3:06dedicated load system prompt method.
  75. 3:09There's the path to the prompt. Let's
  76. 3:10open it. We have completely overwritten
  77. 3:14the clawed code system prompt with this
  78. 3:17title of our agent purpose. And we have
  79. 3:19a simple threeline instruction. You are
  80. 3:22a pong agent. Always respond exactly
  81. 3:24with pong. That's it. The system prompt
  82. 3:26is the most important element of your
  83. 3:29custom agents with zero exceptions. We
  84. 3:32are modifying the core for specifically
  85. 3:35the prompt. But now we have two very
  86. 3:37important prompts to pay attention to.
  87. 3:39System prompts and user prompts. The
  88. 3:41system prompt affects every single user
  89. 3:44prompt the agent runs. Every single one.
  90. 3:47So all of your work is multiplied by
  91. 3:50your system prompt. So how does the
  92. 3:52Cloud Code SDK work? Let's go ahead and
  93. 3:53break down the key ideas. The SDK works
  94. 3:56like this. You set up your options. You
  95. 3:58set up your agent. Here we're just
  96. 4:00running the query and then you handle
  97. 4:03the response. The claw code SDK is a
  98. 4:05powerful tool for putting together
  99. 4:07agents as you'll see as we progress. All
  100. 4:09the pieces are there and they're
  101. 4:10incrementally adoptable. And then
  102. 4:12lastly, we're just doing some logging.
  103. 4:14That's it. That's the end of our agent,
  104. 4:15right? A simple 150 line Pong agent.
  105. 4:18Most of this is just logging. We're
  106. 4:19setting up the agent. We're then
  107. 4:21querying the agent. We're then handling
  108. 4:23the response of the agent. And take note
  109. 4:25of these specific blocks that you can
  110. 4:27report. We have our agent message
  111. 4:29blocks. We have a result message. And
  112. 4:31you can parse specific information out
  113. 4:33of these as you'll see as we progress.
  114. 4:35But this is the pong agent and this
  115. 4:37showcases the power of the system
  116. 4:40prompt. Remember all that work that the
  117. 4:42clawed code team has put into making a
  118. 4:45great agent, right? The claw code agent
  119. 4:47that you know and love is now gone.
  120. 4:50Okay, you have to be very careful with
  121. 4:51the system prompt. We now have a new
  122. 4:54product. This is not clawed code
  123. 4:56anymore. Okay, it might be using the
  124. 4:58same model, but the system prompt is
  125. 5:00truly what builds the agent. Now, of
  126. 5:03course, we are still using the tools.
  127. 5:05That's important to call out here as
  128. 5:06you'll see as we progress into more and
  129. 5:09more capable custom agents. Let's move
  130. 5:11on to our second agent, the echo agent.
  131. 5:16Inside of our echo agent, you can see a
  132. 5:18similar structure. We have a single
  133. 5:19Python script here that we're going to
  134. 5:21execute. UV run echo agent py. And we're
  135. 5:24going to see a similar structure, right?
  136. 5:26Right, we have our Echo agent kicking
  137. 5:27off user prompt agent response. But here
  138. 5:29we have something different. Here we
  139. 5:31have of course a custom tool. So our
  140. 5:33agent is saying I'll use this tool and
  141. 5:35then we have this tool call block here.
  142. 5:37And then we have the response of the
  143. 5:39tool call and then our agent response.
  144. 5:41All right. So these are all unique
  145. 5:43elements coming out of our agent. You
  146. 5:46want to be keeping track of these,
  147. 5:47right? Keep track of the core four. If
  148. 5:49you understand the core 4 and how each
  149. 5:52element flows and controls your agent,
  150. 5:54you will understand compute and you'll
  151. 5:56understand how to scale your compute.
  152. 5:58Let's go ahead and echo ourselves. So,
  153. 5:59I'm going to say echo this string and
  154. 6:01then I want it in reverse in uppercase.
  155. 6:04Repeat two times here. We're just
  156. 6:06playing with the tool that our custom
  157. 6:08agent has. All right. So, there's the
  158. 6:10user prompt. There's that call in
  159. 6:12reverse. This text comes out to custom
  160. 6:14agents are powerful. We ask it to repeat
  161. 6:16and go uppercase. So that's exactly what
  162. 6:18our agent has done. Okay, we're scaling
  163. 6:20up a little more. We're adding a few
  164. 6:22more capabilities to our agent as we
  165. 6:24explore custom agents. Let's understand
  166. 6:26what's going on here in the Echo agent.
  167. 6:28Same structure. I always love collapsing
  168. 6:30everything and you can just quickly
  169. 6:32understand what's going on. We have
  170. 6:33main, we have a tool, and we have our
  171. 6:36system prompt. Always look for the
  172. 6:38system prompt and then look for the
  173. 6:40custom tools. We have a couple
  174. 6:41parameters here. Then we have something
  175. 6:43special. So once again, you can always
  176. 6:45just search cloud code options. We have
  177. 6:48an MCP server built in this script
  178. 6:51create SDK MCP server and we're passing
  179. 6:54in a single tool. So this builds an
  180. 6:56entire MCP server in memory for our
  181. 6:59agent. This is super powerful. So let's
  182. 7:01look at our echo tool and understand
  183. 7:02what it does. Tools for your cloud code
  184. 7:05SDK. They're built like this. A
  185. 7:06decorator. We then have the name. We
  186. 7:08have the description. So keep in mind
  187. 7:10the description of your tool tells your
  188. 7:13agent how to use it in addition to the
  189. 7:15actual parameters that get passed in to
  190. 7:18your tool and the actual arguments. You
  191. 7:20just pass in a dict and then you do
  192. 7:22whatever you want to do inside of your
  193. 7:24tool. Here we step back into traditional
  194. 7:26deterministic code, right? It's a tool
  195. 7:28call. Do whatever you want, but be sure
  196. 7:30to respond in the proper format. You can
  197. 7:33see here, here's our log. Here's the
  198. 7:35transforms we were doing, right? Just a
  199. 7:36small example tool call for our agent.
  200. 7:39This is a custom agent with a custom
  201. 7:41tool set. Now something interesting here
  202. 7:43as well. You can see we are running
  203. 7:45clawed haiku. We have downgraded our
  204. 7:47model to a cheaper less intelligent but
  205. 7:50much faster model. Right? This is a
  206. 7:52simple agent. It doesn't need powerful
  207. 7:54intelligence. So we've dropped down the
  208. 7:56model. As we progress through each agent
  209. 7:58keep in mind we have the 12 leverage
  210. 8:01points of agent coding that we're paying
  211. 8:03attention to. But whenever you see cloud
  212. 8:05code options isolate the core four. How
  213. 8:07will the core 4 be managed given this
  214. 8:10setup? Now, we have something else here
  215. 8:12that's important to call out. We're
  216. 8:13using the clawed SDK client class
  217. 8:16instead of our pong agent where we were
  218. 8:18just using that query command. All
  219. 8:20right, so query is for one-off prompts
  220. 8:22and the claw SDK client is for
  221. 8:25continuous conversations. Let me show
  222. 8:27you exactly what I mean here. Let's
  223. 8:28clear this and let's run this once again
  224. 8:30with follow-up. So, if we kick this off,
  225. 8:32our agent is going to run that same
  226. 8:34prompt like normal, but then it's going
  227. 8:36to continue the conversation. We're
  228. 8:38going to pass in another follow-up
  229. 8:40prompt. I'm going to say concisely
  230. 8:41summarize our conversation in bullet
  231. 8:43points. And so, here it is, right? Our
  232. 8:45agent quickly responds, follow-up
  233. 8:46response, concise summary. 1 2 3 4. Our
  234. 8:50agent has kept track of the conversation
  235. 8:53because we're using the clawed SDK
  236. 8:55client. And because we've written
  237. 8:57multiple query calls, you can see we
  238. 8:59have two here, follow-up prompt and the
  239. 9:01original user prompt. All right, so we
  240. 9:03have both the tool use block that we
  241. 9:05care about and we have the text block.
  242. 9:08You can stream all the messages coming
  243. 9:09back out from your agent after you query
  244. 9:11and just take them in, right? Take them
  245. 9:13in, do whatever you want with them.
  246. 9:14Here, of course, we're just logging with
  247. 9:16clean, rich panels, concisely
  248. 9:19communicating what's happening with our
  249. 9:20agent. If you don't know what your agent
  250. 9:22is doing, if you don't adopt your
  251. 9:23agent's perspective, it will be hard to
  252. 9:25improve them and tweak them and manage
  253. 9:27them. So, that's what we're doing here.
  254. 9:29And you can see the follow-up prompt. We
  255. 9:31fired off that additional query and we
  256. 9:33just looked for that one response,
  257. 9:35right? We're looking for a tool use
  258. 9:36block. And really, we only were looking
  259. 9:38for the text block here, right? This is
  260. 9:40not actually that useful. This is a
  261. 9:42custom agent with a few more
  262. 9:44capabilities, right? We've specified the
  263. 9:46model. We've given it a custom tool to
  264. 9:49work with. But here's something
  265. 9:50interesting that if you're using these
  266. 9:52agents left and right, you probably
  267. 9:53haven't been paying attention to. If we
  268. 9:55run this same agent and we just drop
  269. 9:57everything down here and we just say
  270. 9:59list your available tools, we are
  271. 10:03actually still running a lot of the
  272. 10:05clawed code baked in tool set. So check
  273. 10:09this out, right? These are all the cloud
  274. 10:11code tools plus our tool. And so
  275. 10:13everything that's going into your agent
  276. 10:15winds up in the context window at some
  277. 10:18point. We have 15 extra tools, 15 extra
  278. 10:22options that our agent has to choose
  279. 10:24from and select to do the job we've
  280. 10:27asked it. Now, our Echo agent does not
  281. 10:29need any of these tools. All right? And
  282. 10:31so, as we progress, we're going to
  283. 10:32fine-tune. We're going to get more
  284. 10:34control over our agent. If you ever run
  285. 10:36the /context commander, understand
  286. 10:38what's going into your agent. You know
  287. 10:40that these 15 tools consumes context. It
  288. 10:44consumes space in your agent's mind.
  289. 10:46We're going to learn how to control that
  290. 10:47knob in our next agent. The last thing
  291. 10:49we want to point out here is our Echo
  292. 10:51system prompt. Okay, very simple, right?
  293. 10:54Again, it's important to call out this
  294. 10:55is not the claw code product anymore. As
  295. 10:58soon as you touch the system prompt and
  296. 11:01once you start dialing into the tools,
  297. 11:03you change the product, you change the
  298. 11:06agent. All right, so you can see here
  299. 11:08title purpose echo agent use the tool
  300. 11:10when asked. All right. So there's not a
  301. 11:12lot of happening here, but there is a
  302. 11:14lot that was happening that isn't
  303. 11:16happening anymore. Right? If that makes
  304. 11:17sense. We have blown away the clawed
  305. 11:20code system prompt. We have completely
  306. 11:21overwritten it. Now, it is important to
  307. 11:23mention you can append system prompt,
  308. 11:26right? You can just add on to what's
  309. 11:28already there. This is also powerful.
  310. 11:30This is more of a way to extend cloud
  311. 11:32code versus overwrite it and build a
  312. 11:35true custom agent. All right, let's
  313. 11:37continue. Let's progress. Let's get more
  314. 11:39control over our agents. Let's scale
  315. 11:41this up and let's look at a new form
  316. 11:43factor for agents.
  317. 11:47Now we arrive at custom 7 micro SDLC
  318. 11:51agent. Let's understand the structure of
  319. 11:53this codebase. Backend front end
  320. 11:55reviews, specs and a couple of test
  321. 11:57files. So let's go ahead and just kick
  322. 11:59this off. We already have this running
  323. 12:00here. Backend front end. Let's see
  324. 12:03exactly what this is. You probably
  325. 12:04understand what's going on here, right?
  326. 12:06We have an agent by agent task board
  327. 12:09where we hand off work from one agent to
  328. 12:11another agent in a kind of micro
  329. 12:13software development life cycle. Now you
  330. 12:15can see here we have a couple tasks
  331. 12:17already shipped. We have some aired ones
  332. 12:18over here. Let's just go ahead create a
  333. 12:20new task. We're going to do something
  334. 12:22really stupid and simple. I just want to
  335. 12:24showcase the workflow and showcase the
  336. 12:26capabilities that you can build into
  337. 12:28your user interfaces with Asian. So uh
  338. 12:31update titles. This is just going to be
  339. 12:33super simple. update the HTML title and
  340. 12:36header title to be plan build review and
  341. 12:40ship agents. Okay. And now we have that
  342. 12:43here, right? Update titles. Then we just
  343. 12:44drag it into plan. And now this workflow
  344. 12:46is going to kick off. Let's go ahead and
  345. 12:47refocus on the actual agent running on
  346. 12:50the back end. So let's just collapse the
  347. 12:52front end there and let's see what our
  348. 12:53agent is doing. The difference here is
  349. 12:55we have a multi- aent system, right?
  350. 12:57We're not just deploying a single agent
  351. 12:59anymore. We're deploying multiple agents
  352. 13:02inside of our UI. So now we have a
  353. 13:04planner agent. It's noticing it's
  354. 13:06thinking, right? We have planner
  355. 13:07thinking, planner tool calls, uh, hook
  356. 13:10interceptions, right? Tool allowed. We
  357. 13:13have permission system inside of this.
  358. 13:15It has the full structure. And now it's
  359. 13:16going to start updating this code,
  360. 13:18right? It's a simple title change. This
  361. 13:19isn't, you know, rocket science, but we
  362. 13:21should see our title update here. And we
  363. 13:23should see our HTML title update as
  364. 13:25well, right? It is operating on itself.
  365. 13:27Couple cool things, right? You can kind
  366. 13:29of build out your own multi- aent
  367. 13:31orchestration system however you want.
  368. 13:33We have the messages on the left. So the
  369. 13:35total messages getting streamed to the
  370. 13:37front end via websockets. And then we
  371. 13:39have the total tool calls on the right.
  372. 13:41Okay. So our agent is working. You can
  373. 13:43see there the planning is incrementing.
  374. 13:45But you can see here our builder agent
  375. 13:47is now processing. And this is really
  376. 13:50cool, right? Our build agent is now
  377. 13:51processing. So the planner is done. You
  378. 13:53know, you'll notice the UI is going to
  379. 13:54be a little kind of glitchy here because
  380. 13:56it is updating on itself. And so it's,
  381. 13:58you know, actively starting and
  382. 14:00restarting the server and the client.
  383. 14:01Um, but that's fine. Our websocket
  384. 14:03should pick this up and continue
  385. 14:04processing. So there you can see the
  386. 14:06spec. You know, we're operating on that
  387. 14:07plan. We're operating in the review now.
  388. 14:09There we go. We can see that we're in
  389. 14:11the review step now. Okay. So very cool
  390. 14:14way to just kind of see how agents can
  391. 14:16work together and then you just package
  392. 14:17it in a nice UI. Then you can do more
  393. 14:20than you ever could before, frankly.
  394. 14:21Right. We have a dedicated workflow
  395. 14:23working step by step by step. plan,
  396. 14:26build, review, and handing it off to the
  397. 14:28next stage in the process. Okay, you can
  398. 14:30see here our reviewer agent, there's all
  399. 14:32of its tools, and you can see it just
  400. 14:34operating, doing work for us, right?
  401. 14:35We're using a lot of the out of the box
  402. 14:37cloud code tools, right? If you don't
  403. 14:39need to reinvent the wheel, don't do it.
  404. 14:41Let's be super clear about this. The
  405. 14:42Cloud Code SDK running the base Cloud
  406. 14:45Code agent is incredible. We've been
  407. 14:48using it since Cloud Code was released.
  408. 14:50Uh, you can see here we just moved to
  409. 14:52shipped. There we go. Update titles. And
  410. 14:54you can see here, guess what happened?
  411. 14:55Plan, build, review, and ship agents.
  412. 14:57Both titles updated. This work shipped
  413. 14:59with a single prompt outside the loop.
  414. 15:02Right? This is a perfect example of an
  415. 15:04outloop review system using the Peter
  416. 15:07framework. We dialed into this a ton
  417. 15:10inside of TAC. If you haven't finished
  418. 15:11the TAC lessons, you should probably
  419. 15:13stop watching this video immediately and
  420. 15:15finish TAC. It's all about transitioning
  421. 15:17from in loop to outloop to eventually
  422. 15:20ZTE.
  423. 15:21[Music]
  424. 15:25The agent is compute scaled. You want to
  425. 15:27know how to deploy this across your
  426. 15:30tools, products, services for yourself,
  427. 15:33for your engineering work, and for your
  428. 15:35users and customers. And the cloud code
  429. 15:37SDK and other agent SDKs. These are all
  430. 15:40powerful toolkits you can use to control
  431. 15:43the core for within your agents to scale
  432. 15:46them intelligently. If you're doing
  433. 15:48one-sizefits-all work, use the out-
  434. 15:51of-the-box agent. Don't think super hard
  435. 15:53about this. Just deploy compute to get
  436. 15:55the job done. But as your work becomes
  437. 15:56more specialized, as you deploy agents
  438. 15:59across all aspects of your engineering,
  439. 16:01you first want better agents, more
  440. 16:02agents, and then custom agents. This is
  441. 16:05a codebase you're going to want to ultra
  442. 16:07think about and understand how you can
  443. 16:10extend and use the ideas we've discussed
  444. 16:12here. Deploying effective compute and
  445. 16:15deploying effective agents is all about
  446. 16:18finding the constraints in your personal
  447. 16:20workflow and in your products. Think
  448. 16:22about repeat workflows that can benefit
  449. 16:24from an agent inside of a script, a data
  450. 16:26stream, an interactive terminal, all the
  451. 16:28way up to user interfaces that can
  452. 16:30tackle high return on investment
  453. 16:32problems in your tools for your team and
  454. 16:35for your business. Agent coding is not
  455. 16:38so much about what we can do anymore.
  456. 16:39It's about what we can teach our agents
  457. 16:41to do. This is how we push our compute
  458. 16:43to its useful limits. Follow this path
  459. 16:46to unlock massive value for your tools
  460. 16:48and products. Better agents, more
  461. 16:50agents, and then custom agents. I'll see
  462. 16:52you in the next Aentic Horizon extended
  463. 16:55lesson.

About this transcript

This page contains the full transcript of Agentic Coding ENDGAME: Build your Claude Code SDK Custom Agents by IndyDevDan, generated from the public captions YouTube serves with the video. The transcript has 3,180 words across 463 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.