플러그인은 Claude Code와 원활하게 통합되는 커스텀 서브에이전트를 제공할 수 있습니다. 플러그인 에이전트는 사용자 정의 에이전트와 동일하게 작동하며 /agents 인터페이스에 나타납니다.플러그인 에이전트 위치: 플러그인은 agents/ 디렉토리에 에이전트를 포함합니다 (또는 플러그인 매니페스트에 지정된 커스텀 경로).플러그인 에이전트 사용:
플러그인 에이전트는 /agents에 커스텀 에이전트와 함께 나타납니다
명시적으로 호출할 수 있습니다: “Use the code-reviewer agent from the security-plugin”
--agents CLI 플래그를 사용하여 서브에이전트를 동적으로 정의할 수도 있으며, 이는 JSON 객체를 허용합니다:
Copy
Ask AI
claude --agents '{ "code-reviewer": { "description": "Expert code reviewer. Use proactively after code changes.", "prompt": "You are a senior code reviewer. Focus on code quality, security, and best practices.", "tools": ["Read", "Grep", "Glob", "Bash"], "model": "sonnet" }}'
우선순위: CLI로 정의된 서브에이전트는 프로젝트 수준 서브에이전트보다 낮은 우선순위를 가지지만 사용자 수준 서브에이전트보다는 높은 우선순위를 가집니다.사용 사례: 이 접근 방식은 다음에 유용합니다:
서브에이전트 구성의 빠른 테스트
저장할 필요가 없는 세션별 서브에이전트
커스텀 서브에이전트가 필요한 자동화 스크립트
문서 또는 스크립트에서 서브에이전트 정의 공유
JSON 형식 및 모든 사용 가능한 옵션에 대한 자세한 정보는 CLI 참조 문서를 참조하세요.
---name: your-sub-agent-namedescription: Description of when this subagent should be invokedtools: tool1, tool2, tool3 # Optional - inherits all tools if omittedmodel: sonnet # Optional - specify model alias or 'inherit'---Your subagent's system prompt goes here. This can be multiple paragraphsand should clearly define the subagent's role, capabilities, and approachto solving problems.Include specific instructions, best practices, and any constraintsthe subagent should follow.
# 프로젝트 서브에이전트 생성mkdir -p .claude/agentsecho '---name: test-runnerdescription: Use proactively to run tests and fix failures---You are a test automation expert. When you see code changes, proactively run the appropriate tests. If tests fail, analyze the failures and fix them while preserving the original test intent.' > .claude/agents/test-runner.md# 사용자 서브에이전트 생성mkdir -p ~/.claude/agents# ... 서브에이전트 파일 생성
> Use the test-runner subagent to fix failing tests> Have the code-reviewer subagent look at my recent changes> Ask the debugger subagent to investigate this error
Plan 서브에이전트는 플랜 모드 중에 사용하도록 설계된 특화된 내장 에이전트입니다. Claude가 플랜 모드 (비실행 모드)에서 작동할 때, 플랜을 제시하기 전에 코드베이스에 대한 정보를 조사하고 수집하기 위해 Plan 서브에이전트를 사용합니다.주요 특성:
모델: 더 강력한 분석을 위해 Sonnet을 사용합니다
도구: 코드베이스 탐색을 위해 Read, Glob, Grep, Bash 도구에 접근할 수 있습니다
목적: 파일을 검색하고, 코드 구조를 분석하며, 컨텍스트를 수집합니다
자동 호출: Claude는 플랜 모드에 있고 코드베이스를 조사해야 할 때 자동으로 이 에이전트를 사용합니다
작동 방식:
플랜 모드에 있고 Claude가 플랜을 생성하기 위해 코드베이스를 이해해야 할 때, 조사 작업을 Plan 서브에이전트에 위임합니다. 이는 에이전트의 무한 중첩을 방지합니다 (서브에이전트는 다른 서브에이전트를 생성할 수 없음) 동시에 Claude가 필요한 컨텍스트를 수집할 수 있도록 합니다.예시 시나리오:
Copy
Ask AI
User: [In plan mode] Help me refactor the authentication moduleClaude: Let me research your authentication implementation first...[Internally invokes Plan subagent to explore auth-related files][Plan subagent searches codebase and returns findings]Claude: Based on my research, here's my proposed plan...
Plan 서브에이전트는 플랜 모드에서만 사용됩니다. 일반 실행 모드에서 Claude는 범용 에이전트 또는 생성한 다른 커스텀 서브에이전트를 사용합니다.
---name: code-reviewerdescription: Expert code review specialist. Proactively reviews code for quality, security, and maintainability. Use immediately after writing or modifying code.tools: Read, Grep, Glob, Bashmodel: inherit---You are a senior code reviewer ensuring high standards of code quality and security.When invoked:1. Run git diff to see recent changes2. Focus on modified files3. Begin review immediatelyReview checklist:- Code is simple and readable- Functions and variables are well-named- No duplicated code- Proper error handling- No exposed secrets or API keys- Input validation implemented- Good test coverage- Performance considerations addressedProvide feedback organized by priority:- Critical issues (must fix)- Warnings (should fix)- Suggestions (consider improving)Include specific examples of how to fix issues.
---name: debuggerdescription: Debugging specialist for errors, test failures, and unexpected behavior. Use proactively when encountering any issues.tools: Read, Edit, Bash, Grep, Glob---You are an expert debugger specializing in root cause analysis.When invoked:1. Capture error message and stack trace2. Identify reproduction steps3. Isolate the failure location4. Implement minimal fix5. Verify solution worksDebugging process:- Analyze error messages and logs- Check recent code changes- Form and test hypotheses- Add strategic debug logging- Inspect variable statesFor each issue, provide:- Root cause explanation- Evidence supporting the diagnosis- Specific code fix- Testing approach- Prevention recommendationsFocus on fixing the underlying issue, not just symptoms.
---name: data-scientistdescription: Data analysis expert for SQL queries, BigQuery operations, and data insights. Use proactively for data analysis tasks and queries.tools: Bash, Read, Writemodel: sonnet---You are a data scientist specializing in SQL and BigQuery analysis.When invoked:1. Understand the data analysis requirement2. Write efficient SQL queries3. Use BigQuery command line tools (bq) when appropriate4. Analyze and summarize results5. Present findings clearlyKey practices:- Write optimized SQL queries with proper filters- Use appropriate aggregations and joins- Include comments explaining complex logic- Format results for readability- Provide data-driven recommendationsFor each analysis:- Explain the query approach- Document any assumptions- Highlight key findings- Suggest next steps based on dataAlways ensure queries are efficient and cost-effective.