From the course: Build with AI: Leverage Claude Code Subagents in Software Projects

Create an implementation plan using subagents

- Most engineers and web coders use Claude Code in a suboptimal manner, and I keep hearing about two issues, first, the context window is too short, and second, getting stuck with errors. One feature implementation breaks another feature, so the execution is not smart enough. In this course, we learn how to solve both of these issues with Claude Code subagents. Now, Claude Code subagents are specialized AI assistants that are created for task-specific workflows and improved context management. So let's build this internal CRM software for a payment processing company. We learn how to leverage subagents to plan, develop, review, test, and audit this entire software, so let's start with the planning phase. Here, I am in Visual Studio Code editor. I can see, the file explorer, there are no files at the moment, so this is a brand-new project. I have my terminal opened up, so I will kickstart Claude within my terminal by writing the command Claude, hit enter. Yes, proceed. So I am in my project directory, and I have kickstarted Claude Code from my project directory. The command that I want to showcase first is slash agents to manage agent configurations. If I show you what is present in this, I have some agents already provided by Claude Code, so the built-in available subagents are general purpose subagent, which is using Sonnet model, status line setup, explore, plan, and Claude Code guide. Now, there are two subagents, which is explore and plan. These are the latest additions, and if I press escape and come out of this toolbox, we can ask questions to Claude Code, "What is the plan subagent all about? Does it have access to the web? How is it different from explore agent?" Now, Claude Code would tell us all about the plan subagent, what it does internally for us when we are using the plan agent. Now, we should understand, there are two different things here. One is plan mode, and second is plan agent. Now, this plan agent, as you can see from this response, the plan agent, software architect agent for design, implementation plans. Use it when you need to plan the implementation strategy for a task, get step-by-step plans, identify critical files, consider architectural trade-offs, and key differences between plan and explore, you can see over here. Now, you use plan agent when you're already working in a codebase. For us, this is a brand-new project, so I already have the prompt, which is the initial prompt to get started with the project. Now, if I paste this and we go over this entire prompt, "Act as a senior software architect. Design minimal, but scalable system to implement an internal merchant CRM for a payments processor with merchant-centric views for sales, support, and ops. Use Supabase for the backend and database and React for the frontend," so I have figured out some details about this project. We'll be using Supabase as our backend, and we'll build our frontend using the React framework. Now, this entire system, where we want to store merchant, contact, transaction, support tickets, activity, everything will get stored in the Supabase database, and that will also serve as our backend service. Now, I have provided this initial prompt. You can get this initial prompt by asking Claude as well. Specify what you want in your software and ask it to create sort of a PRD, and this is my initial prompt, and this is going to use the general purpose agent, so I can specify here, "Use general purpose subagent to create this plan." Now, general purpose subagent is the inbuilt subagent within Claude Code that I'm gonna be using, because plan agent works only when you already have a codebase. Let's run this. We'll wait for the plan to get ready. All right, so you can see I have an implementation, TECHNICAL_DESIGN.md. This is a new file that Claude Code has created for us, so I'll hit yes. There's a Markdown file which is generated for us, and our main chat, which is the main orchestrator, the main context window for us, every subagent will have its own context window, so they will not pollute the main chat, the main context window, so here, the general purpose subagent together is creating this entire TECHNICAL_DESIGN.md, so this is, by default, available in the main chat always. Still working on the technical design. Great, so we have the complete technical design summary here, all the tables, core RPC functions, and project structure as well. Now, before we move on to actually implementing, the planning phase is the most important phase when it comes to Claude Code.

Contents