Skip to main content
Mythos

Claude Code subagents are delegated workers inside one 📝Claude Code session that run a side task in their own context window, with their own prompt, tools, and permissions, and return only a summary.

Claude Code ships built-in subagents, including Explore for read-only codebase search, Plan for research during plan mode, and general-purpose for multi-step work. Custom subagents are Markdown files with YAML frontmatter stored in .claude/agents/ for one project or ~/.claude/agents/ for every project; only name and description are required, and optional fields set tools, model, permissionMode, persistent memory, and isolation: worktree. Claude delegates automatically when a task matches a subagent's description, or on request by name or @-mention, and claude --agent <name> runs a whole session as that subagent.

A fresh subagent loads its own system prompt, the delegation message, CLAUDE.md files, and any preloaded skills, but not the parent's conversation history. The fork subagent type is the exception: it inherits the full conversation and prompt cache, and /subtask starts one by hand; see 📝Claude Code Forked Sub-Agents — Quick Reference. Since v2.1.232 fork mode is on by default in interactive sessions, and subagents run in the background so the main conversation stays responsive. Subagents can nest up to three layers by default, and up to 20 run at once.

Subagents fit side tasks whose output would flood the main conversation, such as test logs or broad searches. They report back only to the session that spawned them; work that needs whole parallel sessions or workers that talk to each other belongs to agent teams (see 📝Claude Code Swarm Mode), 📝Claude Code Projects, or 📝Claude Code Cross-Session Messaging. The general pattern is described in 📝Subagents, and 📝Claude Code Multi-Agent Orchestration compares every option.

Contexts

Created with 💜 by One Inc | Copyright 2026