Type object
File match **/.claude/agents/*.md .claude/agents/*.md
Schema URL https://catalog.lintel.tools/schemas/claude-code/agent/latest.json

Validate with Lintel

npx @lintel/lintel check
Type: object

Frontmatter schema for Claude Code subagent definitions (.claude/agents/*.md). Subagents are specialized AI assistants that run in their own context window with a custom system prompt, specific tool access, and independent permissions. The markdown body after the --- frontmatter becomes the subagent's system prompt (not the full Claude Code system prompt — only the body plus basic environment details). Subagents are stored at ~/.claude/agents/ (personal), .claude/agents/ (project), <plugin>/agents/ (plugin), or passed via --agents CLI flag (session-only). When multiple subagents share the same name, higher-priority locations win: CLI > project > personal > plugin. Subagents cannot spawn other subagents.

Properties

name string required

Unique identifier for the subagent using lowercase letters, numbers, and hyphens. Used to reference the subagent in Task(agent-name) tool restrictions, permission deny rules, hook matchers, and the /agents interface. Plugin subagents appear namespaced as plugin-name:agent-name.

Examples: "code-reviewer", "debugger", "data-scientist"
pattern=^[a-z][a-z0-9-]*$
description string required

Describes when and how Claude should delegate to this subagent. Claude uses this to decide automatic delegation — write it as a triggering guide with concrete task patterns. Include phrases like "use proactively" to encourage automatic delegation. This is the single most important field for subagent behavior — a vague description means Claude won't know when to delegate. See automatic delegation.

Examples: "Expert code reviewer. Proactively reviews code for quality, security, and maintainability. Use immediately after writing or modifying code.", "Debugging specialist for errors, test failures, and unexpected behavior. Use proactively when encountering any issues.", "Data analysis expert for SQL queries, BigQuery operations, and data insights."
tools string | Permission[]

Tools the subagent can use. If omitted, inherits all tools from the main conversation (including MCP tools). Specify a subset to restrict access. Built-in tools: Read, Write, Edit, Bash, Glob, Grep, WebFetch, WebSearch, Task, Skill, NotebookEdit. Supports patterns: Bash(git *) allows only git subcommands, Skill(commit) allows invoking a specific skill, Task(worker, researcher) restricts spawnable subagent types (only meaningful for agents run as main thread via claude --agent). MCP tools follow the pattern mcp__<server>__<tool>.

disallowedTools string | Permission[]

Tools to explicitly deny, removed from the inherited or specified tool list. Use when you want to grant most tools but block a few specific ones (e.g. block Write and Edit for a read-only agent). Supports the same tool name formats as tools.

model string

Which Claude model the subagent uses. Set to inherit (default) to use the same model as the main conversation. Use haiku for fast, low-latency tasks (search, exploration). Use sonnet for balanced capability. Use opus for the most capable reasoning.

Default: "inherit"
Values: "opus" "sonnet" "haiku" "inherit"
Examples: "sonnet", "inherit"
permissionMode string

Controls how the subagent handles permission prompts. Subagents inherit the permission context from the main conversation but can override the mode. If the parent uses bypassPermissions, it takes precedence and cannot be overridden. Background subagents auto-deny unpermitted actions rather than prompting.

  • default: Standard permission prompts
  • acceptEdits: Auto-accept file edits (Write, Edit)
  • dontAsk: Auto-deny permission prompts (explicitly allowed tools still work)
  • bypassPermissions: Skip all permission checks (use with caution)
  • plan: Read-only exploration, requires approval before implementation
Values: "default" "acceptEdits" "dontAsk" "bypassPermissions" "plan"
Examples: "default", "plan"
maxTurns integer

Maximum number of agentic turns (API round-trips) before the subagent automatically stops and returns results. Each tool use counts as one turn. Use to prevent runaway subagents or control cost.

Examples: 10, 25, 50
min=1
skills string | string[]

Skills to preload into the subagent's context at startup. The full content of each skill is injected (not just made available for invocation). Subagents do not inherit skills from the parent conversation — you must list them explicitly. This is the inverse of running a skill in a subagent (context: fork).

Examples: ["api-conventions","error-handling-patterns"], "code-review-checklist"
mcpServers Record<string, string | Mcp Server Config>

MCP servers available to this subagent. Each key is a server name — the value is either an empty object {} to reference an already-configured server by name, or an inline definition with a full MCP server config. MCP tools are not available in background subagents.

Examples: {"github":"github","slack":"slack"}, {"custom-db":{"command":"python","args":["/path/to/mcp-server.py"],"env":{"DB_URL":"postgresql://localhost:5432"}}}
hooks Hooks

Lifecycle hooks scoped to this subagent. Hooks defined here only fire while this subagent is active and are cleaned up when it finishes. Stop hooks in frontmatter are automatically converted to SubagentStop events at runtime. See hooks in skills and agents.

memory string

Enable persistent memory that survives across conversations. The subagent gets a dedicated memory directory to build knowledge over time (codebase patterns, debugging insights, architectural decisions). When enabled, the first 200 lines of MEMORY.md are included in the system prompt, and Read/Write/Edit tools are automatically enabled.

  • user: ~/.claude/agent-memory/<name>/ — learnings across all projects
  • project: .claude/agent-memory/<name>/ — project-specific, shareable via VCS
  • local: .claude/agent-memory-local/<name>/ — project-specific, gitignored
Values: "user" "project" "local"
Examples: "user"
background boolean

When true, always run this subagent as a background task. Background subagents run concurrently while the main conversation continues. Before launching, Claude prompts for needed tool permissions upfront. Background subagents auto-deny unpermitted actions and cannot use MCP tools or ask clarifying questions via AskUserQuestion. Set CLAUDE_CODE_DISABLE_BACKGROUND_TASKS=1 to disable all background tasks. Users can also press Ctrl+B to background a running foreground subagent.

Default: false
Examples: true
isolation string

Set to worktree to run the subagent in a temporary git worktree, giving it an isolated copy of the repository. The subagent can make changes without affecting the main working tree. The worktree is automatically cleaned up if the subagent makes no changes. Useful for parallel exploration or risky operations that should be isolated.

Values: "worktree"
Examples: "worktree"