sub-agents
Create and manage specialized sub-agents with unique system prompts and tool sets for specific workflows.
Install
mkdir -p .claude/skills/sub-agents && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/3322" && unzip -o skill.zip -d .claude/skills/sub-agents && rm skill.zipInstalls to .claude/skills/sub-agents
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Create and configure Claude Code sub-agents with custom prompts, tools, and modelsKey capabilities
- →Define custom system prompts for specialized roles
- →Configure tool access for isolated agent contexts
- →Select specific models for agent tasks
- →Manage agent configurations via CLI or file system
- →Chain multiple agents for complex workflows
How it works
The skill creates and manages sub-agents by defining YAML configurations that specify system prompts, tool permissions, and model selection within the .claude/agents/ directory.
Inputs & outputs
When to use sub-agents
- →Create a custom code reviewer agent
- →Configure model selection for specific tasks
- →Set up specialized system prompts
- →Manage multiple agent configurations
About this skill
Sub-Agents Reference
Create specialized AI agents with isolated contexts for specific tasks.
When to Use
- "How do I create a sub-agent?"
- "Configure agent tools"
- "What built-in agents exist?"
- "Agent model selection"
- "Agent chaining patterns"
Quick Start
Interactive (Recommended)
/agents
Opens menu to create, edit, and manage agents.
Manual Creation
mkdir -p .claude/agents
cat > .claude/agents/reviewer.md << 'EOF'
---
name: reviewer
description: Code review specialist. Use proactively after code changes.
tools: Read, Grep, Glob, Bash
model: sonnet
---
You are a senior code reviewer focusing on quality and security.
## Review Checklist
- Code clarity and naming
- Error handling
- Security vulnerabilities
- Test coverage
EOF
CLI-Based
claude --agents '{
"reviewer": {
"description": "Code reviewer",
"prompt": "Review for quality and security",
"tools": ["Read", "Bash"],
"model": "sonnet"
}
}'
Agent File Format
---
name: agent-name
description: When/why to use this agent
tools: Read, Edit, Bash # Optional, inherits all if omitted
model: sonnet # sonnet, haiku, claude-opus-4-5-20251101, inherit
---
System prompt content here...
Configuration Fields
| Field | Required | Options |
|---|---|---|
name | Yes | lowercase, hyphens |
description | Yes | When to use |
tools | No | Tool list (inherits all if omitted) |
model | No | sonnet, haiku, claude-opus-4-5-20251101, inherit |
Built-In Agents
| Agent | Model | Tools | Purpose |
|---|---|---|---|
| General-purpose | Sonnet | All | Complex multi-step tasks |
| Plan | Sonnet | Read-only | Plan mode research |
| Explore | Haiku | Read-only | Fast codebase search |
Model Selection
| Model | Speed | Best For |
|---|---|---|
| Haiku | Fastest | Search, quick lookups |
| Sonnet | Fast | Most tasks (default) |
| Opus | Slower | Complex reasoning |
Tool Combinations
# Code Reviewer (read-only)
tools: Read, Grep, Glob, Bash
# Debugger
tools: Read, Edit, Bash, Grep, Glob
# Implementer
tools: Read, Write, Edit, Bash, Glob
Example Agents
Code Reviewer
---
name: code-reviewer
description: Reviews code for quality and security. Use after code changes.
tools: Read, Grep, Glob, Bash
model: sonnet
---
Review code for:
- Security vulnerabilities
- Code quality issues
- Missing error handling
- Test coverage gaps
Output findings by priority: Critical > Warning > Suggestion
Debugger
---
name: debugger
description: Debug errors and test failures.
tools: Read, Edit, Bash, Grep, Glob
model: inherit
---
Debugging process:
1. Capture error details
2. Identify failure location
3. Form hypotheses
4. Test and verify
5. Implement fix
File Locations
| Type | Location | Priority |
|---|---|---|
| Project | .claude/agents/ | Highest |
| User | ~/.claude/agents/ | Lower |
Advanced Patterns
Resumable Agents
[Agent returns agentId: "abc123"]
# Later: resume with context
claude -r "abc123" "Continue analysis"
Agent Chaining
Use code-analyzer to find issues,
then use optimizer to fix them
Best Practices
- Single responsibility - One clear purpose per agent
- Restrict tools - Only grant what's needed
- Clear descriptions - Action-oriented, include "proactively"
- Version control - Check
.claude/agents/into git
When not to use it
- →When a single general-purpose agent is sufficient for the task
- →When the task does not require isolated context or specific tool restrictions
Limitations
- →Requires manual configuration of tool permissions
- →Limited to the models supported by the underlying platform
How it compares
It provides a structured way to create specialized, isolated AI contexts rather than relying on a single, broad system prompt.
Compared to similar skills
sub-agents side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| sub-agents (this skill) | 1 | 7mo | Review | Advanced |
| prompt-optimizer | 43 | 6mo | No flags | Beginner |
| context-compression | 13 | 2mo | Review | Advanced |
| learner | 2 | 3mo | No flags | Advanced |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by parcadei
View all by parcadei →You might also like
prompt-optimizer
solatis
Optimize system prompts for Claude Code agents using proven prompt engineering patterns. Use when users request prompt improvement, optimization, or refinement for agent workflows, tool instructions, or system behaviors.
context-compression
muratcankoylan
This skill should be used when the user asks to "compress context", "summarize conversation history", "implement compaction", "reduce token usage", or mentions context compression, structured summarization, tokens-per-task optimization, or long-running agent sessions exceeding context limits.
learner
Yeachan-Heo
Extract a learned skill from the current conversation
skillforge
tripleyak
Intelligent skill router and creator. Analyzes ANY input to recommend existing skills, improve them, or create new ones. Uses deep iterative analysis with 11 thinking models, regression questioning, evolution lens, and multi-agent synthesis panel. Phase 0 triage ensures you never duplicate existing functionality.
reflect
llama-farm
Analyze the current session and propose improvements to skills. **Proactively invoke this skill** when you notice user corrections after skill usage, or at the end of skill-heavy sessions. Also use when user says "reflect", "improve skill", or "learn from this".
skill-name
2025Emma
What it does + when to use (activation triggers).