Podcast Title

Author Name

0:00
0:00
Album Art

Build Your Own AI Agent Army with Claude Code's Custom Sub-Agents

By 10xdev team August 03, 2025

Claude Code just launched custom sub-agents, and they are a game-changer for developers. I created one to help me pick the best tech stack for my next project, and the results were impressive. These sub-agents can be as specific or as broad as you need them to be, and the best part is they are completely customizable.

What Are Sub-Agents and Why Are They So Helpful?

You have probably seen many people creating agent-like systems inside of Claude itself. While it was possible to create mini-agents using custom slash commands for tasks like generating UI iterations, Claude has now given us the ability to create fully customized agents directly within Claude Code using the /agents command.

So, what are the main benefits? According to Anthropic, there are several key advantages:

  • Specific Expertise: Each agent has a specific purpose and an area of expertise. This is similar to creating a custom GPT in ChatGPT, where you can give an agent its own persona and a specific job to do. It knows its role and can execute it flawlessly.
  • Isolated Context Window: Agents use their own context window, separate from the main conversation. This is incredibly useful because it allows you to have a side conversation with a custom agent about user interface, testing, design, marketing, or product definition. Whatever you discuss with the agent won't creep into the context of the main project you're working on.
  • Configurable Tool Access: You can configure agents with specific tools they are allowed to use. You can customize these agents by going through a checklist of which tools they can access, including MCP servers. You can even specify a broader range of permissions, like read-only access or full control.
  • Reusability: The sub-agent definition lives in a markdown file under the .claude directory, which you can place at either the user or project level. Because these sub-agents are defined in a file, you can check this file into a repository, move it between projects, or customize it as needed.

Creating a Tech Stack Advisor Agent

For my first sub-agent, I decided I needed a tech stack advisor. My front-end development knowledge is limited, and my back-end skills are somewhat outdated. There's a lot I don't know, and even more that I don't know I don't know.

So, I went into Claude Code and asked it to create a new agent with a simple prompt:

"You are an experienced software engineer. The user will come to you with a project idea but won't necessarily know the best kind of tech stack to use. The user won't even know if it should be a website, a standalone app, or just a Python script. Your job is to help the user understand what tech stack to use and to explain your choices."

You can find these agent markdown files in the .claude/agents/ directory within your project or user directory structure. Here’s a look at the tech-stack-advisor.md file that Claude generated:

Name: Tech Stack Advisor

Description: An agent that helps users determine the optimal technology stack for their project ideas.

Examples: - Context: User wants to build something but isn't sure what technology to use. - User: "I want to create something that helps people track their daily habits, but I'm not sure if I should make a website or an app or what." - Assistant: "Let me use the text advisor agent to help you determine the best technology approach for your habit tracking project."

Definition: You are a senior software architect and technology consultant with over 15 years of experience. Your primary mission is to help users identify the optimal technology stack.

Approach: 1. Ask clarifying questions to understand the project's core functionality. 2. Perform analysis on scalability, performance, and user experience. 3. Provide a detailed recommendation with clear justifications.

Goal: Empower the user to make informed decisions about their technology choices.

All I did was provide the initial high-level request, and Claude Code took care of the rest, building out this comprehensive agent definition.

Putting the Agent to Work

With my tech stack advisor ready, it was time to get some advice. I told Claude I wanted to create a small sketchpad project where flowers would trail behind the cursor as you draw.

The tech stack advisor sub-agent thought for a few seconds and came back with a set of recommendations, detailing the platform, core technologies, and architecture it would use. It then asked if I wanted help creating a basic prototype. Of course, I said yes.

In no time, I had a working flower sketch pad with an adjustable brush size. A great result from my new expert agent.

Building a UI Project Auditor

Next, let's create another agent. This time, I want a UI engineer to review my project and suggest improvements.

I used the command: bash /agents create new I chose to create it at the project level and generated the definition with Claude. My prompt was:

"I would like a UI engineer agent to take a look at the project we have so far and make recommendations for best coding practices and usage of the project. It should also recommend any enhancements it thinks might be a good idea."

Next, you select the tool usage. You can grant access to everything or restrict it to read-only. For this task, I gave the agent full access to be a true expert. You can also assign a color to the agent so you know when it's running.

After confirming the settings, the UI-project-auditor.md agent was created. Here’s a summary of its definition:

Description: Audits UI projects for best practices, identifies potential issues, and recommends enhancements.

Focus Areas: - Code Quality & Structure - Performance Optimization - Accessibility Compliance - User Experience

Final Guidelines: Always provide specific, actionable advice with clear reasoning.

I then instructed the new agent to get to work: "Use the UI project auditor and take a look at this project and see what recommendations for improvement you have."

The agent, highlighted in orange, began its analysis and returned with a list of critical issues, including security risks, potential memory leaks, and significant accessibility gaps.

Top Recommendations: * Refactor the drawing logic to improve performance. * Implement proper memory management to prevent leaks. * Add ARIA attributes to enhance accessibility.

I asked the agent to apply the changes, and it updated the code accordingly. It mentioned throttling the flower creation to manage memory, and indeed, there were fewer flowers. A quick follow-up request to "update the flowers" brought them back in full force.

Claude Code's sub-agents are a simple, elegant solution to many common development challenges. This powerful feature adds even more superpowers to an already impressive tool, and I will definitely be using them to enhance my code in ways I wouldn't have thought of on my own. Go ahead and build your own agent army!

Join the 10xdev Community

Subscribe and get 8+ free PDFs that contain detailed roadmaps with recommended learning periods for each programming language or field, along with links to free resources such as books, YouTube tutorials, and courses with certificates.

Recommended For You

Up Next