Subagents
agents
Section titled “agents”-
Type: object
-
Default: unspecified
-
Description: Custom agent definitions mapping agent names to their configuration. Each key is the agent name (kebab-case); each value is an agent config object. The config uses the same field names as AGENT.md frontmatter, plus a
promptfield for the system instructions (equivalent to the frontmatter file body). Settings-defined agents are available alongside.claude/agents/directory agents. -
Agent config fields: (equivalent to subagent frontmatter — see agents/overview for the canonical table)
Field Type Description promptstring System instructions for the agent (equivalent to the markdown body of an .mdagent file)descriptionstring Short description shown in /agentsUI; used by Claude’s automatic-delegation logictoolsstring (comma-sep) or list Allowlist of tools. Omit to inherit all tools. Supports Agent(agent_type)syntax for subagent restrictiondisallowedToolsstring (comma-sep) or list Tools to deny. Applied first, then toolsresolves against what’s leftmodelstring sonnet,opus,haiku, a full model ID, orinherit. Defaults toinheritpermissionModestring default,acceptEdits,auto,dontAsk,bypassPermissions, orplanmaxTurnsinteger Max agentic turns before the subagent stops skillslist Skills loaded into the subagent’s context at startup mcpServerslist MCP servers available to this subagent (name references or inline definitions) hooksobject Lifecycle hooks scoped to this subagent memorystring Persistent memory scope: user,project, orlocal. Omit for no persistent memorybackgroundboolean If true, always run as a background taskeffortstring Effort level: low,medium,high,xhigh,max(available values depend on the model)isolationstring Set to worktreeto run in a temporary git worktreecolorstring Display color: red,blue,green,yellow,purple,orange,pink, orcyaninitialPromptstring Auto-submitted as the first user turn when this agent runs as the main session agent (via --agentor theagentsetting) -
Example:
{"agents": {"code-reviewer": {"description": "Reviews code for quality and security","prompt": "You are a code reviewer. Analyze changes for logic errors, security vulnerabilities, and style consistency.","tools": "Read,Glob,Grep","permissionMode": "default","maxTurns": 10}}}
- Type: string
- Default: unspecified
- Description: Run the main thread as a named subagent. Applies that subagent’s system prompt, tool restrictions, and model. The named agent must be defined in the
agentsconfiguration. - Example:
{"agent": "code-reviewer"}