From meta-skills
Use this skill when creating custom Claude Code subagents, designing agent configurations, deciding between agent scopes (user vs project), configuring tool restrictions, or setting up lifecycle hooks. Helps design focused agents with appropriate capabilities.
How this skill is triggered — by the user, by Claude, or both
Slash command
/meta-skills:creating-agentsThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
This skill guides you through designing and creating custom subagent configurations for Claude Code CLI.
This skill guides you through designing and creating custom subagent configurations for Claude Code CLI.
For the most current information, reference:
Use Built-in Agents When:
Create Custom Agents When:
Ask the user to clarify:
| Location | Path | Scope | Use Case |
|---|---|---|---|
| Project | .claude/agents/ | Current project | Team-shared, version-controlled |
| User | ~/.claude/agents/ | All your projects | Personal preferences |
| Session | --agents CLI flag | Current session only | Temporary experimentation |
The description determines when Claude delegates to your agent. Write it like you're telling Claude: "Use this agent when..."
Good descriptions:
Bad descriptions:
Three approaches:
tools field entirelytools to specify only permitted toolsdisallowedTools to remove specific toolsCommon tool sets:
Read, Grep, Glob, BashRead, Edit, Write, Bash, Grep, GlobRead, Grep, Glob (no Bash)| Mode | Behavior |
|---|---|
default | Standard permission prompts |
acceptEdits | Auto-accept file edits |
dontAsk | Auto-deny permission prompts |
bypassPermissions | Skip all checks (use cautiously) |
plan | Read-only exploration mode |
Hooks enable validation or lifecycle events. See ./references/hooks-and-validation-patterns.md for examples.
---
name: my-agent # Required: lowercase, hyphens only
description: When to use this # Required: determines delegation
model: sonnet # Optional: sonnet|opus|haiku|inherit
tools: Read, Grep, Glob # Optional: allowlist (inherits all if omitted)
disallowedTools: Write, Edit # Optional: denylist
permissionMode: default # Optional: permission handling
skills: my-skill, other-skill # Optional: preload skill context
hooks: # Optional: lifecycle hooks
PreToolUse: [...]
PostToolUse: [...]
---
Your system prompt goes here. This is the context and instructions
the agent receives when invoked.
For detailed field documentation, see ./references/agent-configuration-options.md.
---
name: code-reviewer
description: Expert code review specialist for quality, security, and maintainability
tools: Read, Grep, Glob, Bash
model: inherit
---
You are a senior code reviewer. Analyze code and provide specific, actionable feedback.
---
name: db-reader
description: Execute read-only database queries with SQL validation
tools: Bash
hooks:
PreToolUse:
- matcher: "Bash"
hooks:
- type: command
command: "./scripts/validate-readonly-query.sh"
---
You execute SQL queries. Only SELECT statements are permitted.
---
name: security-auditor
description: Security specialist for vulnerability assessment and secure coding review
tools: Read, Grep, Glob, Bash
disallowedTools: Edit, Write
---
You are a security expert. Focus on OWASP Top 10, authentication, authorization,
input validation, and secure data handling.
For more examples, see ./references/agent-examples.md.
Before finalizing your agent:
Create the file at the appropriate location:
# Project-level (version-controlled)
mkdir -p .claude/agents
# User-level (personal)
mkdir -p ~/.claude/agents
Write the agent file with .md extension:
# Example: .claude/agents/code-reviewer.md
Test by asking Claude to use the agent or let it auto-delegate based on description
Once created, agents are available automatically:
/agents command in Claude Code./references/agent-configuration-options.md — All frontmatter fields explained./references/hooks-and-validation-patterns.md — Hook examples and validation scripts./references/agent-examples.md — Curated agent configurations for common use casesnpx claudepluginhub adbutterfield/coding-agent-plugins --plugin meta-skillsCreate custom agents for Claude Code including YAML frontmatter, system prompts, tool restrictions, and discovery optimization. Use when creating, building, or designing agents, or when asked about agent creation, subagent configuration, Task tool delegation, or agent best practices.
Creates Claude Code agents from scratch or by adapting templates. Guides requirements gathering, template selection, and file generation following Anthropic best practices (v2.1.63+).
Creates custom Claude Code subagents with YAML frontmatter, tool restrictions, model selection, permission modes, and persistent memory. Used for generating specialized, delegatable agents.