Skip to content
Agentmart
Submit a tool

What is Subagent?

A subagent is a specialized AI assistant that Claude Code delegates a task to; it works in a separate context window with its own instructions and tool limits, and hands back only a summary.

Also written: sub-agent, custom subagent, delegated agent

Explained

In Claude Code, a subagent handles one kind of task separately from the main conversation. It has its own context window, system prompt, tool access and permissions. Because only a summary comes back, verbose material such as search results, logs and file contents stays out of the main conversation. Restricting tools and routing simple work to a cheaper model are other stated reasons to use one.

A subagent is defined as a markdown file with YAML frontmatter. The body becomes its system prompt, and only name and description are required. Other fields can limit tools, set a model, attach skills or MCP servers, or add hooks. The file's location sets its scope: managed settings, a command-line flag, the project's .claude/agents folder, the user's folder, or a plugin, with higher-priority locations winning on name clashes.

Claude can delegate automatically by matching a task to a subagent's description, or the user can ask for one by name, mention it, or start a whole session as that subagent. Claude Code ships built-in ones such as Explore, a read-only search agent, and Plan. As of the fetch (2026-10-26), subagents can by default spawn further subagents to a limited depth, which is configurable.

Primary source

Create custom subagents (code.claude.com), read Oct 26, 2026

This entry paraphrases the page above. Sources change; check it for the current wording.

Listings that use this

The 5 top-ranked listings tagged for Subagent. Rank weighs adoption, freshness, documentation and publisher identity; how we rank and grade. Money never changes the order.

Cite this page

What is Subagent?. Agent Mart. https://agentmart.dev/glossary/subagent (last updated 2026-10-26)

Written Oct 26, 2026, updated Oct 26, 2026. All glossary terms