Build Custom Claude Code Sub-Agents
Build reusable agents with focused expertise, scoped tool access, and project or user scope.
Steps
- Define agent purpose, trigger conditions, and required tools (single responsibility)
- Create .md file in .claude/agents/ (project) or ~/.claude/agents/ (user)
- Write frontmatter: name, description, tools, model fields
- Write focused system prompt with specific instructions and constraints
- Test automatic and explicit invocation; commit project agents to version control
For detailed instructions, see instructions.md.