본문 바로가기
C.W.K.
Stream
Lesson 07 of 13 · published

사용자 정의 하위 에이전트와 /agents

~18 min · subagents, agents, delegation, context-isolation

Level 0🌱 입문자
0 XP0/70 lessons0/11 achievements
0/120 XP to next level120 XP to go0% complete

큰 문맥은 별도 하위 에이전트에게 맡겨

하위 에이전트는 자기 문맥 창과 도구 목록, 시스템 지침을 가진 독립 작업자야. 주 에이전트가 범위를 정해 일을 넘기면 하위 에이전트가 필요한 파일을 읽고 결과만 돌려줘. 질문 하나에 파일 서른 개를 읽어야 하는 탐색처럼, 주 대화의 초점을 흐릴 일을 격리하는 데 유용해.

기본 Explore는 빠른 읽기 전용 탐색, Plan은 구현 전에 문맥을 모아 계획을 세우는 일, General-purpose는 실제 편집까지 필요한 일반 작업을 맡아. 직접 만든 에이전트는 .claude/agents/나 사용자 전역 폴더에 두고, 허용 도구와 금지 도구, 모델, 기억, worktree 격리를 머리말에서 정할 수 있어.

하위 에이전트가 공짜 문맥은 아니야. 분리한 만큼 비용도 늘고 중간 과정은 덜 보이니, 단순한 질문까지 무조건 넘기지 마. 독립적으로 읽을 양이 크거나 여러 갈래를 병렬로 처리할 때 값어치를 해.

직접 확인할 항목: --agents, /agents, model:, tool_denylist:, tools:, worktree: true, ~/.claude/agents/.

Code

읽기만 허용한 보안 에이전트·markdown
---
name: security-reviewer
description: >
  Security code review. Auto-delegated when reviewing auth,
  payments, or data-handling code. Reads only, never edits.
model: claude-opus-4-7
tools:
  - Read
  - Grep
  - Glob
  - Bash(grep *)
  - Bash(find *)
  - WebFetch(domain:owasp.org)
tool_denylist:
  - Edit
  - Write
  - Bash(git *)
memory: |
  Audit-only. Never modify files. Always cite the CWE class
  for each finding. OWASP Top 10 is the floor, not the ceiling.
worktree: false
---

You are a senior application security engineer. Produce:
1. Executive summary (1 paragraph)
2. Critical findings (CVSS ≥ 7.0)
3. Medium findings (CVSS 4.0–6.9)
4. Low / informational
5. Remediation priority matrix
여러 에이전트가 나눠 하는 리팩터링·bash
# In an interactive session
"Refactor the entire payment module:
 - Spawn the security-reviewer to audit the current code
 - Spawn db-migration-agent to update the Prisma schema
 - Spawn a general-purpose agent for the API layer
 Work in parallel, then consolidate."

# Each subagent runs with its own context window in its own worktree
# Parent Claude gets summaries back and orchestrates

External links

Exercise

되풀이하는 작업 하나를 맡길 사용자 정의 하위 에이전트를 만들어. 보안 검토, 성능 감사, 문서 작성, 리팩터링처럼 무엇이든 좋아. tools는 꼭 필요한 것만 허용하고 실제 memory: 블록도 작성해. 주 에이전트 세션에서 실행해 별도 문맥으로 작업하는지 확인해 봐.

Progress

Progress is local-only — sign in to sync across devices.
이 페이지에서 버그를 발견하셨거나 피드백이 있으세요?문제 신고

댓글 0

🔔 답글 알림 (로그인 필요)
로그인댓글을 남기려면 로그인해 주세요.

아직 댓글이 없어요. 첫 댓글을 남겨보세요.