Anthropic's Claude Code Sub-Agents: Build Your Own AI Dev Team
Anthropic has just released sub-agents for Claude Code. This feature allows you to essentially create your own team of specialized AI agents for different aspects of your development workflow. You can equip each agent that operates independently with its own context and expertise, as well as their respective MCP tools or system prompt. This lets you delegate specific workflows like code reviews, debugging, or testing to dedicated AI specialists that you define, while keeping the conversation focused on the big picture.
Now, in this article, we're going to explore how you can set up sub-agents and how you can think about potentially leveraging them within your application development.
Setting Up Your First Sub-Agent
Once you're within Claude Code, all you need to do to create new agents is use the /agent
command. From there, you can create a new agent. You can specify whether the agent will live within the project or be globally available on your machine for any project. Then, you can either manually configure the agent or generate it with Claude.
For instance, you could provide the following prompt:
"I want to create a front-end engineer that is an expert in Next.js, Tailwind CSS, as well as shadcn/ui."
Claude will then generate a markdown file that you can iterate on to build out that agent. A great aspect of this is the ability to specify which tools you want to give the agent access to. You have all the core Claude Code functions, like listing files, reading or editing files, and numerous other features you might already be familiar with. Additionally, if you have any MCP servers, you can leverage those within the agent. You can turn on or off any of the MCP tools or core functionalities you want the agent to access.
For this particular agent, we'll grant it access to everything. This granular control is helpful; for example, you could have a backend agent with access to read your database, run SQL commands, and read infrastructure logs. In contrast, a front-end agent might have access to a different host of tools.
Furthermore, if you're using a brand-new front-end framework whose documentation isn't in the LLM's training data, you can specify for it to leverage different MCP tools to retrieve the relevant information.
Understanding the Agent's Markdown Configuration
You can customize the agent's appearance, such as its color, and modify its title and any other content within the markdown file. The structure of the markdown is straightforward:
-
name
: The name of the agent. -
location
: The path relative to your directory. -
tools
: A list of tools the agent can access. These can be comma-separated or set toall_tools
to grant full access. -
description
: A summary of how Claude Code will invoke this agent (e.g., "Use this agent when you need to build, modify, or debug front-end components..."). -
system_prompts
: This is a powerful section where you can add biases and preferences over time. If there are certain quirks in a model's output you dislike—such as linear gradients, thick fonts, or excessive emojis—you can specify those constraints here.
All agent configurations are stored in a hidden directory named .cloud
, within an agents
subfolder. This is where all the relevant context for each agent you set up will live.
Example: A Web Research Agent
Now, let's create a new research agent. We'll specify its location in the root of our directory and provide a prompt:
"You are an expert web researcher that's going to be able to search the web. You're great at googling different things, but you're also really good at finding the relevant information on particular web pages."
For this agent, we'll give it access to scrape web pages, map URLs from those pages, and search for various queries on the web. The resulting markdown file will list these specific tools.
A convenient feature is the ability to update the agent's configuration directly through the chat interface by instructing Claude. It can find the agents
directory and apply the requested updates.
Practical Use Case: Building a SaaS Landing Page
Let's consider a practical example: building a SaaS landing page with a pricing table and an FAQ section. Specifically, we want the main area of the website to feature the top 5+ AI news stories from July 2025. Before building the website, we'll have the agent research the web to find these details.
Upon kicking off the task, Claude first breaks down the request into a to-do list. It researches the stories, and we can see the query it generates. Once the research is complete, it moves on to the Next.js development process.
The Power of Specialized, Composable Agents
This workflow allows for the creation of both project-specific agents and global agents that are useful across multiple projects. We can spawn numerous different agents, and it will be fascinating to observe the creative use cases that emerge from the community in the coming weeks, essentially allowing developers to build a mini-workforce of AI assistants.
Another interesting use case for Claude Code is setting it up to access several MCP servers that aren't necessarily coding-related. For instance, you could hook it up to Gmail, Linear, or a Canva MCP to unlock a ton of different capabilities. Instead of trying to squeeze all the facets of your application's functionality into a single system prompt, we can provide very poignant instructions to each respective agent. We can tell it what to do, what not to do, and engineer its context to be highly relevant for its specific tasks.
Because the agents are configured within markdown files, their context is highly portable, and you can commit them directly to your repository.
The Final Product
The result of our example is a simple Next.js application. It includes a pricing section and functional FAQs. More importantly, the main section of the application displays up-to-date information that was researched by our agent. We see over five different relevant AI stories, such as "Meta's $300 million talent war" and "GPT-5 is coming next month." All of these pieces were leveraged from searching the internet and using that context to build out the application.
Conclusion
This article provided a brief overview of how to leverage sub-agents in Claude Code. The potential for these customizable agents is immense, especially with the ability to equip them with various MCP tools and specific contextual knowledge. It's truly exciting to think about how we can leverage these different agents to streamline and enhance our development workflows.
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.