/claude-code-docs:subagents-referencefrom claude-code-docs
Claude Code subagents configuration reference. Use when creating custom subagents, understanding agent types, configuring agent prompts, or extending the Task tool with specialized agents.
Ships in claude-code-docs. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Subagents are specialized AI assistants that Claude can spawn for specific tasks. Define custom agents to extend Claude's capabilities.
~/.claude/agents/ # User agents (all projects)
.claude/agents/ # Project agents (team shared)
---
name: agent-identifier
description: What this agent does and when to use it
model: sonnet
tools:
- Read
- Grep
- Glob
- Bash
---
# Agent Name
Detailed instructions for the agent's behavior.
## Capabilities
- Specific task the agent handles
- Another capability
## Approach
How the agent should tackle problems.
| Field | Required | Type | Description |
|---|---|---|---|
name | No | string | Agent identifier for Task tool |
description | Yes | string | When/why to use this agent |
model | No | string | haiku, sonnet, opus |
tools | No | array | Available tools |
allowed_tools | No | array | Alias for tools |
| Agent | Purpose | Tools |
|---|---|---|
Explore | Codebase exploration | Read, Grep, Glob |
general-purpose | Multi-step tasks | All tools |
Bash | Command execution | Bash |
Plan | Implementation planning | All tools |
---
name: security-reviewer
description: Review code for security vulnerabilities. Use when checking for injection, XSS, auth issues.
model: sonnet
tools:
- Read
- Grep
- Glob
---
# Security Review Agent
You are a security specialist reviewing code for vulnerabilities.
## Review Checklist
1. SQL injection
2. XSS vulnerabilities
3. Authentication bypass
4. Sensitive data exposure
5. Insecure dependencies
## Process
1. Read the target files
2. Search for common vulnerability patterns
3. Report findings with severity ratings
Claude uses Task tool with:
- subagent_type: "security-reviewer"
- prompt: "Review the auth module for vulnerabilities"
Reference agent in CLAUDE.md or skills:
When reviewing security, use the security-reviewer agent.
Limit what agents can do:
tools:
- Read # Read files
- Grep # Search content
- Glob # Find files
# No Bash, Write, Edit = read-only agent
| Model | Use Case |
|---|---|
haiku | Fast, simple tasks |
sonnet | Balanced (default) |
opus | Complex reasoning |
---
name: code-reviewer
description: Review code changes for quality, patterns, and issues
model: sonnet
tools:
- Read
- Grep
- Glob
---
# Code Review Agent
Review code for:
- Logic errors
- Performance issues
- Code style violations
- Missing error handling
## Output Format
For each issue found:
1. File and line number
2. Issue description
3. Severity (high/medium/low)
4. Suggested fix
---
name: test-writer
description: Write unit tests for functions and modules
model: sonnet
tools:
- Read
- Write
- Bash
---
# Test Writing Agent
Write comprehensive unit tests.
## Approach
1. Read the target code
2. Identify testable functions
3. Write test cases covering:
- Happy path
- Edge cases
- Error conditions
4. Run tests to verify
Agents receive:
Agents return:
# List available agents
/agents
# Check agent loading
claude --debug
For complete documentation, see:
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub dunc4nj/entropy-plugins --plugin claude-code-docs7 skills in this plugin
/hooks-referenceClaude Code hooks configuration reference. Use when creating hooks, understanding hook events (PreToolUse, PostToolUse, Stop, SessionStart, etc.), debugging hook behavior, or implementing automation./mcp-referenceClaude Code MCP (Model Context Protocol) server configuration reference. Use when adding MCP servers, configuring external tools, or integrating third-party services./memory-referenceClaude Code memory (CLAUDE.md) configuration reference. Use when setting up project memory, understanding memory hierarchy, or configuring persistent instructions./plugins-referenceClaude Code plugins configuration reference. Use when creating plugins, bundling commands/agents/hooks/skills/MCP servers, setting up marketplaces, or distributing extensions./settings-referenceClaude Code settings configuration reference. Use when configuring Claude Code behavior, understanding settings hierarchy, or customizing project/user settings./skills-referenceClaude Code skills (Agent Skills) configuration reference. Use when creating skills, understanding skill activation, SKILL.md format, user-invoked vs model-invoked skills, or skill best practices.