ポッドキャストに戻るClaude
Claude Code subagents
サブエージェントとは何か?
Sub-agents are specialized assistants that Claude can delegate tasks to.
サブエージェントは、Claude がタスクを委任できる専門アシスタントです。
Each sub-agent runs in its own conversation contacts window with a custom system prompt that you define.
各サブエージェントは独自のコンテキストウィンドウ内で動作し、あなたが定義したカスタムシステムプロンプトを使用します。
When finished, it returns a summary to the main thread while all the intermediate work stays isolated.
処理が完了すると、メインスレッドに要約を返しながら、中間作業はすべて隔離されたまま保持されます。
One of the main advantages of sub-agents is that they help manage context window usage.
サブエージェントの主なメリットのひとつは、コンテキストウィンドウの使用量を管理できることです。
When you chat with Claude Code, you're adding context to the main context window.
Claude Code でチャットするたびに、メインコンテキストウィンドウにコンテキストが蓄積されます。
Every tool call and its results get stored in this main context window.
ツール呼び出しとその結果はすべて、メインコンテキストウィンドウに保存されます。
And so, when Claude uses a sub-agent, a separate window starts.
Claude がサブエージェントを使用すると、独立したウィンドウが起動します。
The sub-agent receives two inputs, a custom system prompt from your configuration file, and a task description written by the parent or parent agent based on what you ask for.
サブエージェントは2つの入力を受け取ります。設定ファイルからのカスタムシステムプロンプトと、あなたのリクエストに基づいて親エージェントが作成したタスクの説明です。
The sub-agent then works autonomously.
サブエージェントはその後、自律的に動作します。
When it reads files, edits files, or uses tools, none of these will appear in the main conversation.
ファイルの読み取り、編集、ツールの使用など、これらの操作はメイン会話には表示されません。
Just a summary is returned back.
返されるのは要約だけです。
The entire sub-agent conversation then gets completely discarded.
サブエージェントの会話全体は、その後完全に破棄されます。
Consider a task like investigating how the payment system works in an unfamiliar code base.
例えば、見慣れないコードベースで決済システムの仕組みを調査するタスクを考えてみましょう。
Maybe you're trying to use Claude Code to figure out which service handles refunds.
Claude Code を使って、どのサービスが返金を処理しているかを調べようとしているとします。
Well, without a sub-agent, Claude might read 15 files, run several searches, and trace through multiple function calls.
サブエージェントなしでは、Claude は15個のファイルを読み、複数の検索を実行し、複数の関数呼び出しを追跡する必要があるかもしれません。
All of that context fills your context window, even if you only needed one single fact, which service handles refunds.
そのコンテキストがすべてウィンドウを埋めてしまいます。必要な情報はひとつだけ、どのサービスが返金を処理しているか、だとしても。
With a sub-agent, you get the answer without the journey.
サブエージェントを使えば、調査の過程を経ることなく、直接答えを得られます。
The sub-agent explores, discovers the answer, and returns a focused summary, keeping your main context clean.
サブエージェントが探索し、答えを見つけ、要点を絞った要約を返します。メインコンテキストはすっきり保たれます。
But, the main window loses visibility into how the sub-agent reaches its conclusions and what it discovered along the way.
ただし、メインウィンドウはサブエージェントがどのように結論に至ったか、途中で何を発見したかを把握できません。
Claude Code includes several built-in sub-agents that you can use immediately, like the general-purpose sub-agent, used for multi-step tasks that require both exploration and action.
Claude Code にはすぐに使える組み込みサブエージェントが複数含まれています。汎用サブエージェントはその一例で、探索と実行の両方を必要とする複数ステップのタスクに使用します。
The explore sub-agent, used for fast searching of code bases.
探索サブエージェントは、コードベースの高速検索に使用します。
The plan sub-agent, used during plan mode for research and analysis of your code base before presenting a plan.
プランサブエージェントは、プランモード中にコードベースのリサーチと分析を行い、計画を提示する前に使用します。
And you can also create your own sub-agents with custom system prompts and tool access.
カスタムシステムプロンプトとツールアクセスを設定した独自のサブエージェントを作成することもできます。
Sub-agents like Claude Code break work into focused pieces, keep your main context window clean, and bring back just what you need, whether you're using the built-in ones or creating your own.
Claude Code のサブエージェントは作業を集中したタスクに分割し、メインコンテキストウィンドウをクリーンに保ち、必要な情報だけを返します。組み込みサブエージェントを使う場合も、独自に作成する場合も同様です。
They're a practical way to get more out of longer Claude Code sessions.
長い Claude Code セッションをより効果的に活用するための実用的な方法です。