Subagents are specialized assistants that Claude Code can delegate work to.
Each subagent has:
- A focused role
- A custom prompt
- Its own context window
In aibuilder.sh, subagents are referred to as agents and installed as Markdown files at:
.claude/agents/<agent-name>.mdHow Subagents work
When Claude encounters a task that matches a subagent's role, it can delegate that work to the subagent.
This allows:
- Better focus
- Cleaner separation of responsibilities
- More predictable outputs
Examples:
- A code review agent
- A frontend testing agent
- A documentation agent
When to use a Subagent
Use a subagent when:
- The task benefits from a specialist mindset
- You want clear boundaries between responsibilities
- The work is complex or multi-step
Subagents pair well with skills and commands.
Installing a Subagent
Install an agent with:
npx ai-builder add agent <agent-name>