---
type: "GlossaryTerm"
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"
language: "en"
tags: ["agentic"]
generated:
  by: "process:contextstudios-md/1"
  at: "2026-11-24T01:41:37.123Z"
status: "stable"
---

# 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.
