Skip to content

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

FieldTypeRequiredDescription
namestringyesLowercase with hyphens, max 64 chars
descriptionstringyesMin 10 chars, third-person voice
modelstringnoAlias (sonnet, opus, haiku, inherit) or full model ID (e.g. claude-opus-4-6)
toolsstring[]noTool names to allow
disallowedToolsstring[]noTool names to disallow
permissionModestringnoPermission mode: default, acceptEdits, auto, dontAsk, bypassPermissions, or plan
skillsstring[]noSkills this agent can use
hooksobjectnoHooks configuration
memorystringnouser, project, or local
effortstringnoEffort level: low, medium, high, xhigh, or max
maxTurnsnumbernoMaximum agent turns (positive integer)
mcpServers(string|object)[]noMCP server references or inline definitions
colorstringnoDisplay color: red, blue, green, yellow, purple, orange, pink, or cyan
backgroundbooleannoRun as background task (default: false)
isolationstringnoworktree — run in a temporary git worktree
initialPromptstringnoAuto-submitted as the first user turn when this agent runs as the main session agent (via --agent or the agent setting). Prepended to any user-provided prompt

Cross-field validations:

  • tools and disallowedTools are 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
---