---
title: "VB-04: Subagents 기초부터 Deep Dive까지 – 제가 완전히 잘못 알고 있었어요!"
url: "https://zuey.me/articles/vb-04-subagents-tu-basic-den-deep-dive-toi-da-hieu-sai?lang=ko"
locale: ko
access: members
full_text: false
published_at: "2025-07-30T14:55:50.000Z"
tags: ["Claude Code", "Vibe Coding", "AI", "SaaS", "Startup"]
translations:
  en: "https://zuey.me/articles/vb-04-subagents-tu-basic-den-deep-dive-toi-da-hieu-sai.md?lang=en"
  vi: "https://zuey.me/articles/vb-04-subagents-tu-basic-den-deep-dive-toi-da-hieu-sai.md?lang=vi"
  zh: "https://zuey.me/articles/vb-04-subagents-tu-basic-den-deep-dive-toi-da-hieu-sai.md?lang=zh"
  ja: "https://zuey.me/articles/vb-04-subagents-tu-basic-den-deep-dive-toi-da-hieu-sai.md?lang=ja"
---
# VB-04: Subagents 기초부터 Deep Dive까지 – 제가 완전히 잘못 알고 있었어요!

> Claude Code의 Subagents를 이해했다고 생각했는데, 완전히 잘못 알고 있었어요 😅 Context Management, Context Rot을 파고들고, subagent 팀을 “Context Collector Army”로 재편해 3일 가까이 막혀 있던 테스트 스위트를 통과시킨 이야기입니다.

> **INFO:** **“Claude Code와 함께하는 Vibe-coding”**(VB) 시리즈 04편입니다.

원래 이번 4편에서는 Claude Code의 “Commands”를 다룰 예정이었는데, Subagents를 쓰면서 제가 저지른 실수가 꽤 많다는 걸 발견해서 Commands 편은 05편으로 미루기로 했어요 😅

**이번 글에서 다루는 내용**

- Claude Code Subagents 개요
- subagents가 가져다주는 이점
- 꽤 유용한 repo 몇 개
- Time to Deep-Dive!
- 제가 읽은 연구와 적용한 방법
- 새 subagent 팀 재구성과 그 결과
- 늘 그렇듯: 글 곳곳에 숨어 있는 “야매 꿀팁” 몇 개 😂

> **INFO:** **잠깐 속마음 한마디:** Claude Code와 Sub-agents 개념은 나온 지 겨우 1~2개월밖에 안 돼서 누구에게나 아직 너무 새로워요. 저도 다른 많은 분들처럼 이것저것 해 보면서 흥미로운 발견을 기록하는 중일 뿐이고, 제가 공유하는 모든 게 완전히 맞다고 단언한 적은 한 번도 없어요. (며칠 뒤에 이 Subagents 녀석들을 더 최적화할 다른 방법을 또 찾을지도 모르고요! 🫣)

![Claude Code Subagents: 기초부터 Deep Dive까지](https://media.zuey.me/blog/2025/132e5fbf-claude-subagents-deep-dive.png)

---

### Claude Code Subagents 개요

#### Subagent 만드는 법

CC의 `/agents` 명령어로 가장 빠르게 생성한 다음, MD 파일을 열어 원하는 대로 customize하면 돼요.

```text
# sub agents 인터페이스 열기
/agents

# "Create New Agent" 선택
# project-level 또는 user-level 선택
```

#### “위임”(delegation) 제대로 이해하기

기본적으로 Claude Code 자체가 Main Agent이고, 모든 걸 직접 실행해요. subagents를 만들고 나면 CC가 필요할 때 관련 agent를 “똑똑하게” 자동으로 불러서 작업을 delegate한다고 Claude 문서에 나와 있죠 (얼마나 똑똑한지 subagent를 부르는 걸 거의 못 봐요. main agent가 죄다 혼자 처리해요, 이런 느낌: *“에이 이 정도는 쉽지, 내가 할게!”* 😂)

그래서 subagents를 더 효과적으로 소환하려면 2가지 방법이 있어요:

**1/ 자동 (기본 “똑똑함”보다 한 단계 위):**

`CLAUDE.md`에 다음 instructions를 추가해서 CC에게 너 밑에 부대가 있다는 걸 상기시켜 주세요:

```text
...
During the implementation process, you will delegate tasks to the following subagents based on their expertise and capabilities

- Use `planner-researcher` agent to plan for the implementation plan.
- Use `database-admin` agent to run tests and analyze the summary report.
- Use `tester` agent to run tests and analyze the summary report.
- Use `debugger` agent to collect logs in server or github actions to analyze the summary report.
- Use `code-reviewer` agent to review code.
- Use `docs-manager` agent to update docs in `./docs` directory if any.
...
```

**2/ 수동으로 직접 부르기 (Manual):** prompt에 바로 넣거나 Command(user prompt)를 사용해요.

다음으로, subagents를 소환하는 방식에는 2가지가 있다는 걸 알아야 해요: **“순차”(Chaining)** 와 **“병렬”(Parallel)**.

**Chaining Sub-Agents**

```text
# 복잡한 워크플로 예시
> 먼저 code-analyzer subagent로 성능 문제를 찾고,
> 그다음 optimizer subagent로 수정해 줘
```

**Parallel Execution**

```text
# 경쟁하는 접근법
> subagent 2개를 병렬로 배치해 줘:
> Subagent 1 - Incremental Modernizer: 점진적 마이그레이션 전략 설계
> Subagent 2 - Complete Rewrite Advocate: 풀스택 현대화 제안
```

> **WARN:** 여러 subagents를 한꺼번에 spawn해서 병렬로 일하게 하면 충돌이 나기 쉬워요. 그래서 워크플로와 각 agent의 성격에 따라 필요할 때만 쓰는 게 좋아요. 가장 좋은 건 command에 설정해 두고 필요할 때 해당 유형의 워크플로를 trigger하는 거예요.

참고로, 각 sub-agent는 다음을 가지고 있어요:

#### 독립된 Context window

메인 대화의 영향을 받지 않아요

#### 맞춤 System prompt

특정 역할에 맞게 “트레이닝”돼요

#### 개별 Tool 권한

필요한 도구만 사용할 수 있어요

#### 깊은 전문성

domain expertise에 100% 집중해요

#### subagents가 가져다주는 이점

| 이점 | 의미 |
| --- | --- |
| **Context Preservation** (맥락 보존) | 작업을 바꿀 때마다 처음부터 다시 설명할 필요 없이, 각 sub-agent가 자기 context를 유지해요. 메인 대화는 항상 깔끔하고 집중된 상태로 남아요. |
| **Specialized Expertise** (전문화) | 보안용으로 fine-tune된 sub-agent는 보안 관점의 코드 리뷰에서 범용 AI보다 항상 나아요. success rate도 눈에 띄게 높아요. |
| **Reusability & Team Sharing** (재사용) | 한 번 만들면 계속 쓸 수 있어요. 팀과 공유하면 일관된 워크플로를 가질 수 있어요. |
| **Parallel Processing** (병렬 처리) | analyze → code → test → review 순서로 하나씩 하는 대신, 여러 sub-agents를 동시에 병렬로 돌릴 수 있어요. |

> **TIP:** **Pro tip:** “r/ClaudeAI”와 “r/ClaudeCode” 서브레딧에 들어가서 커뮤니티와 sub-agents를 공유하고 배워 보세요. 고수들이 실험하면서 흥미로운 접근법을 공유하는 곳이에요.

---

### 꽤 유용한 repo 몇 개

**참고용 subagents 목록** (description과 workflow를 참고해서 내 agents를 customize하는 용도로만 쓰고, 그대로 복붙하지는 마세요):

[wshobson/agents](https://github.com/wshobson/agents)

> github.com

**Claude Sub-Agent Spec Workflow System:** 여기에도 괜찮은 워크플로가 많아서, 저도 제 subagents를 만들 때 참고했어요.

[zhsama/claude-sub-agent](https://github.com/zhsama/claude-sub-agent/blob/main/README.md)

> github.com

---

### Time to Deep-Dive!

혹시 저처럼 이런 상황 겪어 본 분 있나요? 뭐든 할 수 있는 “신급” AI agents 팀이 있는데, 막상 써 보면... 될 때도 있고 안 될 때도 있는 거요.

어떨 땐 엄청나게 잘 돌아가서 token을 시속 수백만 km로 태우는데, 어떨 땐 기대와 다른 결과가 나오거나, 고쳐도 고쳐도 끝나지 않는 버그 윤회에 빠지기도 하죠?

제가 최근 며칠 동안 딱 그런 상황이었어요. Subagents를 써도 별로 효과적이라는 느낌이 없고, token이랑 시간만 잡아먹고... 그런데도 Test Suite 해결에 3일 가까이 갇혀 있었죠.

---

*Phần còn lại dành cho thành viên có quyền đọc toàn bài (Knowledges, Kết hợp, Cộng đồng) — see plans at https://zuey.me/pricing*
