Subagents
Subagents are specialized AI assistants that help you break down complex projects into smaller, focused tasks. Once you set up a subagent, you can reuse it across multiple projects and even share it with your team, ensuring everyone works the same way.
Add a subagent to your application
Create a subagents directory in your project.
Add a .md file to the .builder/agents/ directory, with an appropriate name for your subagent. For example, if you were creating a subagent to review code, you might make a code-reviewer.md file.
Your markdown file should include YAML frontmatter that defines your subagent. Fill in the file with instructions for how the agent should act.
Builder will automatically discover and use your subagent when appropriate, or you can explicitly reference your subagent in the chat. For example:
Other subagent locations
Builder will also discover and use subagents created for other popular AI tools. Subagents will be accessed from any of the following directories:
Effectively use your subagent
Builder proactively delegates tasks based on the task description in your request and the description field in subagent configurations.
To encourage more proactive use, include phrases like "use proactively" or "use immediately after [action]" in your description field.
When explicitly invoking the subagent, use the subagent's name as part of the request. For example:
- "Use the test-runner subagent to fix failing tests."
- "Have the code-reviewer subagent look at my recent changes."
- "Ask the debugger subagent to investigate this error."
Chain subagents
For complex workflows, you can chain multiple by referencing subagents within the main content of the subagent markdown file.
Subagent examples
A few subagent examples are listed below. Use these as starting points for creating your own subagents.
Frontmatter configuration
The YAML inserted at the beginning of each subagent can be customized in the following ways:
| Field | Required | Description |
| Yes | Unique identifier using lowercase letters and hyphens. |
| Yes | When the subagent should be used. A clear description is critical for automatic delegation. |
| No | A comma-separated list of tools. Inherits all tools if omitted. See below for a list of available tools. |
| No | The name of the model you wish to use for the subagent's action, written in kebab-case. For example, |
| No | Include the current conversation's memories within the subagent's context. Defaults to |
| No | Requires a running development server. Defaults to |
| No | Validate the subagent's output before returning to the user. Defaults to |
Available tools
Subagents can make use of the following tools.
| Category | Tools |
File operations |
|
Execution |
|
Information |
|
MCP servers | Use the |
Agent-specific |
|
Best practices
Keep in mind the following when designing and using subagents.
- Design focused subagents with single, clear responsibilities rather than trying to make one subagent do everything.
- Write detailed prompts with specific instructions, examples, and constraints.
- Only grant tools necessary for the subagent's purpose.
- Check project subagents into version control so your team can collaborate on them.
- If a subagent isn't being used automatically, make the description more specific and actionable.
It's important to note that, subagents help preserve main context, enabling longer overall sessions. However, subagents start with a clean slate each time and may add latency as they gather the context they need.
What's next
Continue configuring Builder's AI output with AGENTS.md files or agent skills.