---
type: Glossary Term
title: Sub-agent
description: "An AI agent spawned by a main agent to perform a specific sub-task, such as diagnosing and fixing a runtime error. In Claude Code /loop workflows, the main loop"
resource: "https://www.contextstudios.ai/glossary/sub-agent"
category: agentic
language: en
timestamp: "2026-03-09T08:17:05.902Z"
---

# Sub-agent

An AI agent spawned by a main agent to perform a specific sub-task, such as diagnosing and fixing a runtime error. In Claude Code /loop workflows, the main loop detects an issue and spawns a sub-agent to resolve it autonomously.
