Lock in $30 Savings on PRO—Offer Ends Soon! ⏳

Claude Codeにおけるサブエージェントのメリットと実践

Avatar for TAAT TAAT
December 20, 2025

Claude Codeにおけるサブエージェントのメリットと実践

Avatar for TAAT

TAAT

December 20, 2025
Tweet

More Decks by TAAT

Other Decks in Technology

Transcript

  1. サブエージェントと ? Claude Code サブエージェント 、 特定タスク専用 AIアシスタント で、より 効率的に問題解決とコンテキスト管理ができる

    • 特定 目的と専門分野を持つ • メインセッションと 独立したコンテキストウィンドウを使用する • 使用を許可された特定 ツールで設定できる • そ 動作を導くカスタムシステムプロンプトを含む Claude Code サブエージェント 専門分野に一致するタスクがあると、そ タスクを専門 サブエージェントに委任 し、サブエージェント 独立して作業して 結果を返す
  2. サブエージェントを使うメリット 各サブエージェント 独自 コンテキストで動作し、メイン 会話 汚染を防 ぎ、高レベル 目標に集中し続ける コンテキスト 保持

    サブエージェント 特定 ドメインに対する詳細な指示で微調整でき 、指定さ れたタスクでより高い成功率をもたらします。 専門的な専門知識
  3. ファイル形式 サブエージェント 定義ファイルに 、 名前や説明、使用できるツール、モデル フロントマター があり、システムプロンプトで役割や能力、制約などを記述する --- name: your-sub-agent-name

    description: このサブエージェントがいつ呼び出されるべきかの説明 tools: tool1, tool2, tool3 # オプション - 省略した場合はすべてのツールを継承 model: sonnet # オプション - モデルエイリアスまたは'inherit'を指定 --- サブエージェントのシステムプロンプトをここに記述します。これは複数の段落にすることができ、 サブエージェントの役割、能力、問題解決へのアプローチを明確に定義する必要があります。 サブエージェントが従うべき具体的な指示、ベストプラクティス、制約を含めてください。
  4. サブエージェント 自動委任、明示的な呼び出し > test-runnerサブエージェントを使用して失敗したテストを修正してください > code-reviewerサブエージェントに最近の変更を確認してもらってください > debuggerサブエージェントにこのエラーを調査してもらってください Claude Code

    いかに基づいて積極的にタスクを委任する • リクエスト内 タスク説明 • サブエージェント設定 descriptionフィールド ◦ 「積極的に使用」「必ず使用」と記載するとより確実かも • 現在 コンテキストと利用可能なツール サブエージェント名を明示的に指示することで呼ぶ出すこともできる
  5. サブエージェント活用例 : coding-guideline-reviewer --- name: coding-guideline-reviewer description: Use this agent

    when iOS development work has been completed and you need to verify that the implemented or modified code adheres to the CodingGuideline.md standards... tools: Glob, Grep, Read, WebFetch, TodoWrite, WebSearch, BashOutput, KillBash, ListMcpResourcesTool, ReadMcpResourceTool model: sonnet color: green --- You are an expert iOS code reviewer specializing in ensuring adherence to the ClusterONE iOS project's CodingGuideline.md standards. You are the final quality gate before code is considered complete... ## Core Review Areas **Architecture Compliance:** - Verify MVVM + Coordinator pattern implementation - Check proper Dependency Injection using ServiceLocator ... 実装完了時にコーディングガイドラインに違反していないかをレビュー して、必要 に応じて修正を依頼する
  6. サブエージェント活用例 : build-and-run-executor --- name: build-and-run-executor description: Use this agent

    when you need to build and run iOS projects, particularly after making code changes to ensure the application compiles and launches successfully... model: sonnet color: blue --- You are an iOS build and execution specialist responsible for building and running iOS projects using the `/build-and-run` command. Your primary role is to ensure code changes are properly compiled and the application launches successfully. You will: 1. Execute the `/build-and-run` command to build and run the iOS project 2. Monitor the build process for any compilation errors, warnings, or issues 3. Verify that the application launches successfully after the build completes 4. Report the complete results including build status, any errors or warnings encountered, and execution outcome 5. If build failures occur, analyze the error messages and provide clear explanations of what went wrong 6. If the build succeeds but runtime issues occur, document the runtime behavior and any crashes or unexpected behavior ... 実装が終わったら、 xcodebuildやxcrunなどを使って、 接続中 実機とシミュ レータを自動判別してビルド &実行を行う ビルド するが実行がスキップ されることが多かったが、サブ エージェントに分離したことで実 行精度が上がった!