name create-agent description Create a new custom subagent for Task() delegation. Use when adding a reusable agent prompt, when the user asks to "add an agent", or when a complex workflow should be delegated to a specialized agent.
Creating a New Agent
Official Documentation
File Location
Create .claude/agents/<agent-name>.md
Agent File Format
---
name: agent-name
description: What the agent does and when to delegate to it. Be specific about trigger conditions.
tools: Read, Grep, Glob, Bash
disallowedTools: Edit, Write
model: sonnet
permissionMode: default
skills: skill-a, skill-b
---
You are a [role description ].
When invoked:
1 . First step
2 . Second step
3 . Third step
- Specific instruction
- Another instruction
Describe expected output format.
Built-in Subagent Types
Before creating a custom agent, consider if a built-in type suffices:
Type Purpose Tools ExploreFast codebase search, file discovery Read-only PlanArchitecture, implementation planning Read-only BashCommand execution Bash only general-purposeComplex multi-step tasks All tools
Design Principles
Focus : One agent, one job. Don't create jack-of-all-trades agents.
Minimal Tools : Grant only necessary tools. Read-only agents can't accidentally break things.
Clear Workflow : Numbered steps help the agent stay on track.
Good Description : Claude uses the description to decide when to delegate. Include:
What the agent specializes in
When to use it (trigger conditions)
"Use proactively when..." if appropriate
Example: Read-Only Reviewer
---
name: lore-checker
description: Verify lore consistency across campaign materials. Use when adding new lore, after writing session logs, or when the user asks to check for contradictions.
tools: Read, Grep, Glob
model: haiku
---
You are a lore consistency checker for TTRPG campaigns.
1 . Identify the new or modified lore element
2 . Search for related existing
[ ]
[ ]
[ ]
Checklist
Before committing a new agent:
Name is lowercase-with-dashes
Description explains what AND when to delegate
Tools are minimal for the task
Workflow steps are clear and numbered
Output format is specified
Tested via Task() delegation