팟캐스트로 돌아가기Claude
Claude Code subagents
서브에이전트 만들기
In the previous video, we covered what sub aents are and how they work.
이전 영상에서는 서브 에이전트가 무엇이고 어떻게 작동하는지 살펴봤습니다.
Cloud code includes built-in sub aents, but you can also create your own sub aents that specialize in certain tasks.
Claude Code에는 기본 제공 서브 에이전트가 있지만, 특정 작업에 특화된 서브 에이전트를 직접 만들 수도 있습니다.
Custom sub aents are markdown files with YAML front matter.
커스텀 서브 에이전트는 YAML front matter가 포함된 Markdown 파일입니다.
These markdown files contain configuration that helps claude understand when to use the sub aent and provides directions to the sub aent itself.
이 Markdown 파일에는 Claude가 서브 에이전트를 언제 사용할지 이해하도록 돕는 구성과 서브 에이전트 자체에 대한 지침이 담겨 있습니다.
Now, the easiest way to create a sub agent is with the / agents command.
서브 에이전트를 만드는 가장 쉬운 방법은 /agents 명령입니다.
This panel is the main interface for managing your sub aents.
이 패널은 서브 에이전트를 관리하는 기본 인터페이스입니다.
Once here, select create new agent.
여기서 'Create New Agent'를 선택하세요.
You'll then be asked if you want to create a sub aent for the current project or a sub aent that will be shared between all the projects on your machine.
현재 프로젝트용 서브 에이전트를 만들지, 또는 머신의 모든 프로젝트에서 공유할 서브 에이전트를 만들지 선택하라는 메시지가 표시됩니다.
Next, you can create a sub aent manually, but we recommend using claw code to automatically generate it for you.
서브 에이전트를 수동으로 만들 수도 있지만, Claude Code를 사용해 자동으로 생성하는 것을 권장합니다.
Our first sub aent will be a code reviewer.
첫 번째 서브 에이전트는 코드 리뷰어가 됩니다.
I'll ask Claude to make a sub agent that reviews code quality and security issues.
코드 품질과 보안 이슈를 검토하는 서브 에이전트를 만들도록 Claude에게 요청하겠습니다.
Claude will use your input to generate a name, description, and system prompt for the sub agent.
Claude는 입력 내용을 바탕으로 서브 에이전트의 이름, 설명, 시스템 프롬프트를 생성합니다.
We'll see those in a moment, but before we do, we get the opportunity to customize the tools that this sub agent has access to.
잠시 후 확인할 수 있지만, 그 전에 이 서브 에이전트가 접근할 수 있는 도구를 커스터마이즈할 기회가 있습니다.
Now, given that our sub agent is only responsible for reviewing code, you might decide to disallow tools for editing, but I'll leave an execution to allow the sub agent to more easily identify pending changes.
서브 에이전트가 코드 검토만 담당하므로 편집 도구를 비활성화할 수 있지만, 저는 서브 에이전트가 대기 중인 변경 사항을 쉽게 확인할 수 있도록 실행 권한은 남겨두겠습니다.
Next, you'll be prompted to select the model that powers this sub agent.
다음으로, 이 서브 에이전트를 구동할 모델을 선택하라는 메시지가 표시됩니다.
And finally, a color.
마지막으로 색상을 선택합니다.
This color is used in the UI to help you better identify the sub agent.
이 색상은 UI에서 서브 에이전트를 쉽게 식별하는 데 사용됩니다.
And it also just adds a little bit of personal flare.
개인적인 개성도 더해줍니다.
Now at the summary window, we see that the sub aent config file will be saved into my current project at this path.
요약 창에서, 서브 에이전트 구성 파일이 이 경로의 현재 프로젝트에 저장될 것을 확인할 수 있습니다.
Now let's open up that file to get a better idea of what's going on.
이제 그 파일을 열어서 내용을 자세히 살펴보겠습니다.
The name field is a unique identifier.
name 필드는 고유 식별자입니다.
This is how you reference the sub agent either by asking claw directly or using at agent code quality reviewer in your message.
Claude에게 직접 물어보거나 메시지에 @agent code quality reviewer를 사용해서 서브 에이전트를 참조하는 방법입니다.
The description controls when cla decides to use the sub aent.
description은 Claude가 서브 에이전트를 언제 사용할지 결정합니다.
The description must be on a single line.
description은 한 줄에 작성해야 합니다.
Notice that there are escaped new line characters in there.
이스케이프된 줄바꿈 문자가 있는 것을 확인하세요.
If you want Claude to use the sub agent automatically more often, add in the word proactively to the description.
Claude가 서브 에이전트를 더 자주 자동으로 사용하게 하려면 description에 'proactively'라는 단어를 추가하세요.
You can also add example conversations to help Claude understand when it should be using the sub agent.
예시 대화를 추가해서 Claude가 서브 에이전트를 언제 사용해야 하는지 이해하도록 도울 수도 있습니다.
The tools field lists which tools the sub agent can access.
tools 필드에는 서브 에이전트가 접근할 수 있는 도구가 나열됩니다.
The list of tools will match the tools we granted access to during the agent generation, but you can further edit the list of tools in this file if you want.
도구 목록은 에이전트 생성 시 접근 권한을 부여한 도구와 일치하지만, 원하면 이 파일에서 목록을 추가로 편집할 수 있습니다.
The model field specifies which claw model to use.
model 필드는 사용할 Claude 모델을 지정합니다.
Sonnet, opus, haiku or inherit.
Sonnet, Opus, Haiku 또는 inherit를 선택할 수 있습니다.
Use haiku for fast tasks.
빠른 작업에는 Haiku를 사용하세요.
Opus for complex analysis and sonnet if you need something between the two.
복잡한 분석에는 Opus, 그 중간이 필요하면 Sonnet을 사용하세요.
Inherit will use the same model as your main conversation.
inherit는 메인 대화와 동일한 모델을 사용합니다.
The body of the file contains the system prompt that is given to the sub aent.
파일 본문에는 서브 에이전트에게 제공되는 시스템 프롬프트가 담겨 있습니다.
The system prompt will provide guidance to the sub agent, helping it understand how to complete its task and how it should return information back to the main agent.
시스템 프롬프트는 서브 에이전트에게 지침을 제공하여 작업 완료 방법과 메인 에이전트에 정보를 반환하는 방법을 이해하도록 돕습니다.
Now for the fun part.
이제 재미있는 부분입니다.
After creating your sub agent, test it by making some code changes and asking claw to review them.
서브 에이전트를 만든 후, 코드를 변경하고 Claude에게 검토를 요청해 테스트해 보세요.
If the sub agent isn't being used when you expect, check your description.
예상한 상황에서 서브 에이전트가 사용되지 않는다면 description을 확인하세요.
Adding more specific examples helps Claude understand when to delegate.
더 구체적인 예시를 추가하면 Claude가 언제 위임해야 하는지 이해하는 데 도움이 됩니다.