Subagents are specialized AI assistants defined as Markdown files with YAML frontmatter. Each subagent runs in its own context window with a custom system prompt, specific tool access, and independent permissions. When a task matches a subagent's description, the parent conversation delegates to it automatically, preserving main context while enforcing constraints.
When to use: Isolating high-volume operations (tests, logs), enforcing read-only access for reviewers, routing simple tasks to cheaper models, running parallel research, creating reusable team workflows.
When NOT to use: Tasks requiring frequent back-and-forth, quick targeted changes, workflows needing nested delegation (subagents cannot spawn subagents), latency-sensitive operations where fresh context gathering is costly.
Markdown 파일의 YAML 머리말 구성을 사용하여 Claude Code용 사용자 정의 하위 에이전트를 생성합니다. 에이전트 범위 지정(프로젝트, 사용자, CLI, 플러그인), 도구 액세스 제어, 모델 선택, 권한 모드, 기술 사전 로드 및 수명 주기 후크를 다룹니다. 특수 하위 에이전트 구축, 도구 액세스 구성, 모델 선택, 권한 모드 설정 또는 위임 패턴 설계 시 사용합니다. 에이전트 생성, 하위 에이전트 구성, 사용자 정의 에이전트 설정에 사용합니다. 출처: oakoss/agent-skills.