Agent Frontmatter
Agent files are flat .md files (e.g., .claude/agents/code-reviewer.md). The YAML frontmatter configures the agent; the file body is the system prompt.
Fields
| Field | Type | Required | Description |
|---|---|---|---|
name | string | yes | Lowercase with hyphens, max 64 chars |
description | string | yes | Min 10 chars, third-person voice |
model | string | no | sonnet, opus, haiku, or inherit (valid values) |
tools | string[] | no | Tool names to allow |
disallowedTools | string[] | no | Tool names to disallow |
permissionMode | string | no | default, acceptEdits, dontAsk, bypassPermissions, plan, or delegate |
skills | string[] | no | Skills this agent can use |
hooks | object | no | Hooks configuration |
memory | string | no | user, project, or local |
maxTurns | number | no | Maximum agent turns (positive integer) |
mcpServers | string[] | no | MCP servers available to the agent |
color | string | no | blue, cyan, green, yellow, magenta, red, or pink |
Cross-field validations:
toolsanddisallowedToolsare mutually exclusive
Example
yaml
---
name: code-reviewer
description: Reviews code changes for quality, security, and best practices.
model: sonnet
tools:
- Read
- Glob
- Grep
color: blue
---