Podcast Title

Author Name

0:00
0:00
Album Art

Cloud Code's Sub-Agents Explained in 5 Minutes

By 10xdev team August 03, 2025

Anthropic has recently released sub-agents in Cloud Code, a powerful new feature for developers. But what exactly is a sub-agent?

What Are Sub-Agents?

A great way to think about sub-agents is by considering the many roles we play as developers. In a single day, we might act as a product manager, write automation scripts, review UI/UX designs, and finally, write application code. A sub-agent is Cloud Code’s method for defining and isolating each of these distinct roles into a specialized assistant.

Key Configuration Options

When setting up a sub-agent, you can configure several key aspects to tailor its functionality:

  • Purpose: Define a clear purpose and area of expertise.
  • Tools: Assign a specific set of tools it can use, including MCPs (Multi-Component Processes).
  • System Prompt: Provide a custom system prompt to guide its behavior and tone.

You have the flexibility to set up these sub-agents on a per-project basis or make them available globally across all your projects.

Pricing and Access

Currently, the sub-agents feature is available to all Cloud Code users with a Pro or Max subscription. The impact on token usage is still being evaluated, but it's a factor to keep in mind as you integrate them into your workflow.

Creating Your First Sub-Agent in Just a Few Steps

Ready to create your first sub-agent? The process is straightforward.

  1. Initiate the Command: Start by using the /aents command in the Cloud Code interface. If you don't see this command, you may need to update to the latest version of Cloud Code.

  2. Choose Configuration Scope: You will be prompted to configure the agent for the current project or globally. For this example, we'll select the project-level configuration.

  3. Select a Generation Method: You are presented with two ways to create the sub-agent:

    • Generate with Claude
    • Manually

We will proceed with the "Generate with Claude" option and then review the resulting configuration file to understand the manual setup process.

A Practical Example: The Automation Expert

Let's create a sub-agent designed to write automations. We can describe its purpose as follows:

An expert automation writer that handles all levels of tests, including unit, integration, and end-to-end.

Next, you must configure its tool access. While it's possible to select all tools by default, it is highly recommended to manually select only the necessary ones to prevent unexpected actions or repository issues. You can define permissions for:

  • Read-only tools
  • Edit tools
  • Execution tools
  • MCPs and other specialized tools

For our automation expert, we want it to have access to the Playwright MCP. You will need to select each function within the MCP that the agent is allowed to use.

Understanding the Configuration File

Once created, the sub-agent's configuration is stored in a markdown file located in a hidden .cloud/agents/ directory. For our example, the file might be named test-automation-expert.md.

If you were to set up an agent manually, you would need to define these attributes in the file:

  • name: The agent's name.
  • description: A brief summary of its purpose.
  • context prompt: The detailed instructions guiding its behavior.
  • context: Any additional context or data attached to the agent.

How to Use Your Sub-Agent

The final step is to run a prompt with your newly created sub-agent. To do this, simply enter the Cloud Code environment and mention the agent in your prompt.

For example:

@Test Automation Expert review my end-to-end tests.

The interface will indicate that the sub-agent is running, often with a unique color identifier.

A Word on Token Usage

Sub-agents are a powerful addition to the Cloud Code ecosystem. However, as any tool becomes more intelligent and capable, it can also become more expensive in terms of token consumption. It is wise to monitor your usage to ensure you are optimizing costs effectively.

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