Skip to main content
Skip to content

Using subagents in your IDE

Delegate a self-contained subtask to a separate agent that works in its own context and reports back to your main chat session.

Introduction

subagents を使用すると、チャット セッション内で独自のコンテキスト ウィンドウを使用して、分離されたエージェントにタスクを委任できます。 subagent は、ユーザーのフィードバックを待たずに独立して動作し、最終的な結果をメイン チャット セッションに提示します。

Subagents は、次の状況に最適です。

  • メイン セッションを中断することなく、研究や分析などの複雑な複数ステップのタスクを委任する必要があります。
  • プライマリ コンテキスト ウィンドウを乱雑にする大量の情報または複数のドキュメントを処理する必要があります。
  • コンテキストを混在させることなく、さまざまなアプローチやパースペクティブを個別に調べる必要があります。

Subagents はメインセッションと同じツールおよびAIモデルを使用しますが、他のsubagentsを作成することはできません。

Subagents are available in Visual Studio Code, JetBrains IDEs, Xcode, and Eclipse. They are not currently available in Visual Studio. The steps to enable and invoke them differ by editor, so click the tabs above for instructions for your IDE.

For the agent session that subagents are delegated from, see Using agent mode in your IDE.

Enabling subagents

  1. In the Copilot Chat window, click the tools icon.
  2. Enable the runSubagent tool.

If you use custom prompt files or custom agents, ensure you specify the runSubagent tool in the tools frontmatter property. See Copilot cloud agent用のカスタム エージェントの作成, and Use prompt files in VS Code in the Visual Studio Code documentation.

Invoking subagents

Subagents は、さまざまな方法で呼び出すことができます。

  • 自動委任。 Copilot は、要求の説明、構成済みの custom agents の説明フィールド、および subagent を自動的に選択するための現在のコンテキストと使用可能なツールを分析します。 たとえば、このプロンプトは、タスクを リファクタリング スペシャリスト custom agent に自動的に委任します。

    Suggest ways to refactor this legacy code.
    
  • 直接呼び出し。 プロンプトで subagent を直接呼び出すことができます。

    Use the testing subagent to write unit tests for the authentication module.
    
  • Calling the #runSubagent tool.

    Evaluate the #file:databaseSchema using #runSubagent and generate an optimized data-migration plan.
    

When the subagent completes its task, its results appear back in the main chat session, ready for follow-up questions or next steps.

Further reading

To use subagents, you must have custom agents configured in your environment. See Using custom agents in your IDE.

Enabling subagents

  1. Click Tools in the menu bar, then click GitHub Copilot, then Edit Settings.
  2. In the popup menu, click Chat, then click the Enable Subagent checkbox.

Invoking subagents

Subagents は、さまざまな方法で呼び出すことができます。

  • 自動委任。 Copilot は、要求の説明、構成済みの custom agents の説明フィールド、および subagent を自動的に選択するための現在のコンテキストと使用可能なツールを分析します。 たとえば、このプロンプトは、タスクを リファクタリング スペシャリスト custom agent に自動的に委任します。

    Suggest ways to refactor this legacy code.
    
  • 直接呼び出し。 プロンプトで subagent を直接呼び出すことができます。

    Use the testing subagent to write unit tests for the authentication module.
    

When the subagent completes its task, its results appear back in the main chat session, ready for follow-up questions or next steps.

Further reading

To use subagents, you must have custom agents configured in your environment. See Using custom agents in your IDE.

Enabling subagents

  1. Click Editor in the menu bar, then click GitHub Copilot then Open GitHub Copilot for Xcode Settings.
  2. Click Advanced in the chat panel, then under Chat Settings click the Enable Subagents toggle.

Invoking subagents

Subagents は、さまざまな方法で呼び出すことができます。

  • 自動委任。 Copilot は、要求の説明、構成済みの custom agents の説明フィールド、および subagent を自動的に選択するための現在のコンテキストと使用可能なツールを分析します。 たとえば、このプロンプトは、タスクを リファクタリング スペシャリスト custom agent に自動的に委任します。

    Suggest ways to refactor this legacy code.
    
  • 直接呼び出し。 プロンプトで subagent を直接呼び出すことができます。

    Use the testing subagent to write unit tests for the authentication module.
    

When the subagent completes its task, its results appear back in the main chat session, ready for follow-up questions or next steps.

Further reading

To use subagents, you must have custom agents configured in your environment. See Using custom agents in your IDE.

Enabling subagents

  1. Click the icon in the status bar.
  2. In the popup menu, click Edit Preferences.
  3. Under Chat, click the Enable sub-agent check box.

Invoking subagents

Subagents は、さまざまな方法で呼び出すことができます。

  • 自動委任。 Copilot は、要求の説明、構成済みの custom agents の説明フィールド、および subagent を自動的に選択するための現在のコンテキストと使用可能なツールを分析します。 たとえば、このプロンプトは、タスクを リファクタリング スペシャリスト custom agent に自動的に委任します。

    Suggest ways to refactor this legacy code.
    
  • 直接呼び出し。 プロンプトで subagent を直接呼び出すことができます。

    Use the testing subagent to write unit tests for the authentication module.
    

When the subagent completes its task, its results appear back in the main chat session, ready for follow-up questions or next steps.

Further reading