Building Agents In Claude Code | Generative AI

The Code Cruise · Intermediate ·🤖 AI Agents & Automation ·11mo ago

Key Takeaways

This video teaches how to build and orchestrate custom agents in Claude Code using sub-agents and Markdown

Full Transcript

What's up everybody? Welcome back to another video within the generative AI tool series. And in this video, we'll be talking about clot code which also resides within your terminal just like Gemini CLI. So, if you haven't seen my previous video, it was about Gemini CLI and the top four things that you would do as a developer or Gemini CLI can help you do to become like uh a more productive developer. And uh so yeah, it's an interesting video. If you want to check it out, go ahead. So this video is more like a continuation because there are certain things and there are certain advantages that you can gain by using Gemini CLI but there are certain things which are very specific to cloud code and one of those key things are building agents. So you cannot build agents in Gemini CLI. So you can build agents and they would operate in their own delegated memory. And even if you prompt a particular user, uh the cloud code would actually go ahead and decide which agent to delegate that task to which I'll demonstrate in this video and how you can build specific agents. what are the key best practices uh that you can follow to build a particular agents and what are the other resources that you can use in building those agents and yeah let's just jump into it all right let's get into our terminal let's type in cloud and here we go so if you type in slash you'll see there are certain things you can do you can do add directory uh agents bashes list and manage background bash shells. So there are couple of things which Gemini CLI also offers and there are couple of things which for example MCP is here me memory management is here u but one thing that is uh specifically new is like you can create your own output style which if you've been a cloud user for quite long you would know that you know uh this is more like a niche clot thing. So it's set to default by by default. So it's like the most basic thing you would get some precise uh you know explanations. Explanatory is the most verbose output style where you would actually get stepwise explanation of why Claude made a certain choice. And within learning obviously it's more like a human in the loop. Um you can actually have your own input and the claude would actually uh you know learn from asking different questions. All right. So, uh for this video, we're going to talk about agents. So, the thing is you have certain agents uh which you can see over here which are more like purposeuilt agent and by default they're set to sonnet. But the good thing is you can create your own agents. So for example, if you're a developer and if you're a full stack developer, so it would make sense for you to have a front-end developer agent and a back-end developer agent, a code reviewer agent, maybe a UI researcher agent. So there's a specific site that you can go to which is known as claude code agents and it has a lot of different agentic prompts that you can you can even go to browse and there are certain other categories that you can explore but currently I'm just interested in you know having a front-end developer uh and backend architect. So if you hit preview you would see the prompt itself. So all these prompts are generated and refined through cloud. So you can go ahead and copy content. You can come back to the CLI create agent. This is a personal agent and generate with cloud which is recommended but I would go ahead with my manual configuration. So let's say our front end developer. Now here we'll paste the prompt that we copied. We're going to hit uh next. And I think this has a description. So, we can go ahead and copy this description over here. Whoa, this is a long one. >> A few moments later. >> It's a very long one. All right. So, there you go. Hit enter. Now, it's going to question you about the tools. So, yeah. So you can actually select the tools from here. Execution tools, I think we need it. And you can even hit advance option. So these are all the tools that are selected. It it also has uh you know the web fetch tool. So yeah, I think we're good here. Uh we can hit continue. And now we get to select uh the model. Okay, here's the thing. Uh so in Gemini CLI you have access to Google's probably the best model which is 2.5 pro uh with like 1 million tokens. So with claude the highest token context window that you can get is like 200k uh I think 200k or 250k. So again uh Google is a bit more generous in terms of context window and access to its best model. Uh, Sonnet is not their best model. Currently, Opus 4 is their best model and recent uh recently released 4.1 is also their best model, but they're quite expensive. So, we'll just go with Sonnet. And you can select a particular color. And there you go. This is the summary for your agent. And I'm going to hit enter. So, I have an active agent which I can select and delegate my task to. I'm going to go ahead and create another agent uh which will be uh more like a backend engineer. Let me adjust my scroll. Uh now I need the system prompt which I'm going to go ahead and copy from and I'll select blue and enter. And that's it. Uh my agents are ready to be used and let's go ahead and use it. So I have to hit escape to go back to my prompting window. And as you can see output style set to default agents front end agent is uh our front end and backend agents are both accessible. So I'm just going to go ahead and type in generate me a to-do list app. uh first generate the backend using now by typing in uh this I can now select my agent. So agent backend engineer uh using our backend engineer and once you're done use front end developer to [Music] generate the front end and It should use the APIs built by the [Music] backend engineer. I think I forgot to Oh, yeah. Generate me a to-do list app. First generate da da da. I think we're good to go. Let's hit enter. So, it first drafted its to-dos. Generate backend API using backend engineer agent. And now our backend engineer is assigned its task. So this is going to go on for a while. All right. So I think the very first task is done. Uh generate backend API using backend engineer and now it's proceeding to the front-end developer agent. So I think this is a sequential workflow. uh since we mentioned it that way uh but we can also orchestrate it a bit differently in terms if you need parallelization uh to some extent so it can also achieve that but this was just for the sake of demonstration. So now it's going to take a while and create the front-end repository and once it's done we're going to come back to it and we'll review it together what it actually built. So yeah. All right. So, our uh to-do list app is also created and our to-do list server is also created. Let's go ahead and run it. I'm going to run the uh front end first. And there we go. Something went wrong because we did not start the server first. So, let's go ahead and do that. And this is our server. Perfect. It's running to-do list API and slashdocs. Uh this is our swagger and these are all the endpoints that have been created for to-dos. So all the CRUD operations are here. Perfect. Uh for the front end, let's try again. And this is our to-do list app. Uh seems nice. Let's go ahead and check. Uh this is a dummy task add to-do nice to-do list created. If I check it uh it goes on to completed and then I can even clear all perfect. So um nice outlook nice presentation uh very verbose messages on the terminal as well. So for the sake of demonstration like this is what you can expect while you're using clot code. uh you have segregated agentic workflows. It has a built-in orchestrator. Uh you get separate memory for each agent. You get the MCP integration. I also reiterated in in the last video within the Gemini CLI that uh MCP integrations are all over the place. You'll find them everywhere in every agent uh you know whether they're in um within your VS code or within the terminal. So it's everywhere. Not a big takeaway. And uh you have the memory management feature. Uh one thing which is really nice about claude uh which you have to do manually within Gemini CLI is Claude uh maintains history by summarizing it just to you know save tokens but for Gemini CLI uh they don't actually do that and I get it because they're very generous in terms of their context window which is like 1 million for clot since it's 200k. So they have this automatic memory management thing uh where they shrink uh your messages and the system messages just to save uh the tokens. In terms of pricing, obviously uh Gemini CLI with Gemini 2.5 Pro uh it's more developer friendly. They're more generous in terms of you know your daily API request. You get like a thousand requests per day which is a lot for cloud code. Uh again the models are expensive. Claude is expensive. Um I think it's a word that everybody uh is very well aware of. Um especially uh the high-end models are very expensive. Uh Opus 4 and Office 4.1. So yeah uh if you're using Sonnet 3.7 or the old versions, you're good to go. You're probably even get a more cheaper experience uh than Gemini 2.5 Pro. uh but overall there are other things that you can do which I'll explore in the later videos how you can create your own custom commands if you want an active uh you know reviewer before you for example if you want to hook up a workflow to review your code every single time you commit. So you can actually build your custom commands uh which can enable you to do that and not just that even a couple of more cool stuff. So we'll explore that in the next video. Thank you so much for watching and I'll see you around.

Original Description

In this video, I dive into how to build and orchestrate custom agents in #claude code, #Anthropic’s powerful agentic coding assistant. You’ll see how sub-agents, defined via Markdown with tailored prompts, tool permissions, and isolated context windows, empower Claude to delegate specialized tasks, such as code review or test generation, more effectively and reliably. I demonstrate how these task-specific agents help maintain clean, modular workflows and improve consistency across your projects while fitting seamlessly into your terminal-based development environment. Whether you're building AI-coordinated developer teams or automating complex workflows, this guide demonstrates how Claude Code sub-agents provide unmatched flexibility and control. 0:00-1:25 Introduction 1:26-2:04 Claude Code CLI Walkthrough 2:05-2:40 Output Styles 2:41-5:55 Building Frontend Developer Agent 5:56-6:44 Building Backend Developer Agent 6:45-8:59 Building An App 9:00-10:14 Demo 10:15-12:43 Conclusion #ClaudeCode #AgenticCoding #Subagents #AITerminalTools #DeveloperTools #AgenticWorkflows #AICoding #CodingWithClaude #genai #generativeai #ai #aitool #aiagents #aiautomation #anthropic #claudecode #machinelearning #naturallanguageprocessing #agentworkflows #
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Related Reads

Up next
AI Agents Explained 🤖
Learn With Shopify
Watch →