Use Specialized Subagents
Suppose you want to use specialized AI subagents to handle specific tasks more effectively.
View Available Subagents
> /agentsThis displays all available subagents and allows you to create new ones.
Use Subagents Automatically
Claude Code automatically delegates appropriate tasks to specialized subagents:
> review my recent code changes for security issues> run all tests and fix any failuresExplicitly Request a Specific Subagent
> use the code-reviewer subagent to check the auth module> have the debugger subagent investigate why users can't log inCreate Custom Subagents for Your Workflow
> /agentsThen select “Create New subagent” and follow the prompts to define:
- Subagent type (e.g.,
api-designer,performance-optimizer) - When to use it
- Which tools it can access
- Its specialized system prompt
Tips:
- Create project-specific subagents in
.claude/agents/for team sharing - Use a descriptive
descriptionfield to enable automatic delegation - Restrict tool access to only what each subagent actually needs
- See the subagent documentation for detailed examples