Skip to main content

Asking GitHub Copilot questions in your IDE

Use Copilot Chat in your editor to give you code suggestions, explain code, generate unit tests, and suggest code fixes.

Prerequisites

If you have access to GitHub Copilot via your organization, you won't be able to use GitHub Copilot Chat if your organization owner has disabled chat. See Managing policies and features for Copilot in your organization.

Submitting prompts

You can ask Copilot Chat to give you code suggestions, explain code, generate unit tests, and suggest code fixes.

  1. To open the Copilot Chat panel, click the Copilot icon () in the status bar at the bottom of Eclipse, then click Open Chat.

  2. Enter a prompt in the prompt box, then press Enter.

    For an introduction to the kinds of prompts you can use, see Getting started with prompts for Copilot Chat.

  3. Evaluate Copilot's response, and make a follow up request if needed.

Using keywords in your prompt

You can use special keywords to help Copilot understand your prompt. For examples, see Getting started with prompts for Copilot Chat.

Slash commands

Use slash commands to avoid writing complex prompts for common scenarios. To use a slash command, type / in the chat prompt box, followed by a command. For example, use /explain to ask Copilot to explain the code in the file currently displayed in the editor.

To see all available slash commands, type / in the chat prompt box.

AI models for Copilot Chat

You can change the large language model that Copilot uses to generate responses to chat prompts, including premium models with advanced capabilities. You may find that different models perform better, or provide more useful responses, depending on the type of questions you ask. For more information see Changing the AI model for Copilot Chat.

Copilot agent mode

Use agent mode when you have a specific task in mind and want to enable Copilot to autonomously edit your code. In agent mode, Copilot determines which files to make changes to, offers code changes and terminal commands to complete the task, and iterates to remediate issues until the original task is complete.

Agent mode is best suited to use cases where:

  • Your task is complex, and involves multiple steps, iterations, and error handling.
  • You want Copilot to determine the necessary steps to take to complete the task.
  • The task requires Copilot to integrate with external applications, such as an MCP server.

Using agent mode

  1. To open the Copilot Chat panel, click the Copilot icon () in the status bar at the bottom of Eclipse, then click Open Chat.
  2. At the bottom of the chat panel, select Agent from the mode dropdown.
  3. Submit a prompt. In response to your prompt, Copilot streams the edits in the editor, updates the working set, and if necessary, suggests terminal commands to run.
  4. Review the changes. If Copilot suggested terminal commands, confirm whether or not Copilot can run them. In response, Copilot iterates and performs additional actions to complete the task in your original prompt.

When you use Copilot agent mode, each prompt you enter counts as one premium request, multiplied by the model’s multiplier. For example, if you're using the included model—which has a multiplier of 0—your prompts won’t consume any premium requests. Copilot may take several follow-up actions to complete your task, but these follow-up actions do not count toward your premium request usage. Only the prompts you enter are billed—tool calls or background steps taken by the agent are not charged.

The total number of premium requests you use depends on how many prompts you enter and which model you select. See Requests in GitHub Copilot.

Further reading