---
published: true
id: subagent
title: Subagent
description: Knowledge captured in João Lopes' learning graph.
tags:
- ai-engineering
- claude-code
- agent-design
- subagent
locale: en
resource: https://joaolopes.dev.br/knowledge/concepts/en/subagent/
created: '2026-03-19'
---

# Subagent
A fresh agent instance dispatched by a parent agent to execute an isolated task with clean context.

## Definition
A subagent is an AI agent instance spawned by a parent agent to execute a specific task in isolation. Subagents have clean context (no session history), run concurrently, and their failures do not corrupt the parent's context. The parent dispatches them with a focused prompt and synthesizes their outputs. This is how skills achieve parallelism — multiple subagents can run simultaneously (lint, tests, code review) while the parent continues working.

## Source
- [Create custom subagents - Claude Code Docs](https://docs.anthropic.com/en/docs/claude-code/sub-agents)
- [Subagents in the SDK - Claude API Docs](https://platform.claude.com/docs/en/agent-sdk/subagents)

## Related
- [Skills](/concepts/en/skills.md)
- [Session](/concepts/en/session.md)
- [Turn](/concepts/en/turn.md)
