Claude Code subagents

Give a focused task to a specialized agent with its own instructions and tool configuration. A subagent is different from agent teams or an external service.

How a subagent is defined

A custom subagent is a Markdown file: YAML frontmatter sets its configuration, and the body supplies its instructions. Save a project definition in .claude/agents/, or use ~/.claude/agents/ across your projects.

name identifies the agent and description tells Claude when to delegate; both are required. tools is optional. Omit it to inherit the tools available to subagents, or list a smaller set, as this local example does.

.claude/agents/repo-guide.mdMinimal local example
---
name: repo-guide
description: Maps project files before implementation planning
tools: Read, Glob, Grep
---

Map the relevant files and explain how they connect.
Report paths and findings. Do not modify files.

The two documented entries below are components of Feature Dev. Installing that package supplies its agents; they are not two separate install packages.

File format and scopes ↗ · Official field reference ↗

How delegation works

Claude chooses automatic delegation using your task, the agent’s description and the conversation context. A matching description helps selection; creating a definition does not mean it runs on every request. Quick edits or work needing frequent back-and-forth can stay in the main conversation.

Ask directly: Use the repo-guide subagent to map the files involved in this change. Natural language still leaves the choice to Claude. For an explicit one-task invocation, type @ and select the agent from the picker. Enabled plugin agents appear under their scoped names.

If an agent is unavailable, check its definition and install scope and whether it is disabled. Delegation does not bypass tool or permission restrictions. When the same name is defined in multiple places, the documented scope precedence is session, project, user, then plugin. A subagent uses its own context and returns a summary to the caller; its model requests count toward the same account usage limits.

Automatic delegation ↗ · Explicit invocation ↗

Subagent vs agent teams vs an external service

Choose by how work is coordinated and where the capability runs. A subagent’s saved definition or optional persistent memory does not make it a continuously running service.

Three mechanisms with different jobs.
MechanismHow it worksUseful when
SubagentHandles a delegated task in its own context within the calling session and returns results.You need focused exploration or review without filling the main conversation with all the intermediate output.
Agent teamA lead coordinates separate Claude Code sessions whose teammates can message each other. Agent teams are experimental and disabled by default.Independent investigations or work areas benefit from coordination between teammates.
External service / MCP serverMCP exposes tools and data from a local process or a remote server. It is not, by itself, a team of Claude sessions.You need a capability or data source such as a repository API or documentation lookup, with its own connection and access requirements.

Agent teams are not permanently running workers. The documented team is scoped to a session, and resuming does not restore in-process teammates. A local MCP process or hosted service has a lifecycle determined by its implementation and hosting.

Official team comparison ↗ · Team lifecycle limits ↗ · MCP connections ↗ · Browse documented MCP integrations

Browse subagents

2 documented entries

Code Explorer and Code Architect belong to Feature Dev. Install that package once to get both components.

Read the source. Check the requirements. Compare what fits.

Plan a feature implementation that follows the existing codebase’s structure.

View guideSource
AnthropicOfficial component

Each listing records its own source-review date. Listings are documentation reviews, not runtime tests or security audits. Our editorial method

Ready to try an extension?

Choose an install scope and check the prerequisites first.

Read the installation guide