How to use agent mode for multi-step tasks on GitHub Copilot

intermediate 8 min read Updated 2026-03-18
Quick Answer

Agent mode in GitHub Copilot allows you to break down complex tasks into multiple steps with autonomous execution. Access it through the Chat panel using @workspace or specific agent commands to handle multi-file operations, refactoring, and project-wide changes.

Prerequisites

  • GitHub Copilot subscription
  • Visual Studio Code or supported IDE
  • Basic understanding of coding workflows
  • GitHub Copilot extension installed

Step-by-Step Instructions

1

Open GitHub Copilot Chat Panel

Launch Visual Studio Code and open your project. Press Ctrl+Shift+I (Windows/Linux) or Cmd+Shift+I (Mac) to open the GitHub Copilot Chat panel. Alternatively, click the Chat icon in the Activity Bar or use View > Open View > GitHub Copilot Chat.
Pin the Chat panel to your sidebar for easy access during development sessions.
2

Activate Agent Mode with Workspace Context

In the chat input field, type @workspace followed by your multi-step task description. For example: @workspace refactor this authentication system to use JWT tokens, update all related files, and add proper error handling. The @workspace agent has access to your entire project structure.
Be specific about the scope and expected outcomes to get better multi-step execution.
3

Review the Proposed Plan

GitHub Copilot will analyze your request and present a multi-step execution plan. Review the proposed steps carefully, which might include:
  • File modifications and creations
  • Code refactoring sequences
  • Testing recommendations
  • Documentation updates
Click Approve to proceed or Modify to adjust the plan.
4

Monitor Step-by-Step Execution

Watch as Copilot executes each step automatically. The agent will show progress indicators and completion status for each phase. You'll see real-time updates like:
Step 1/5: Creating authentication middleware...
Step 2/5: Updating user model...
Each completed step will show a green checkmark with a summary of changes made.
You can pause execution at any time by clicking the Stop button if you need to review intermediate results.
5

Review and Approve Individual Changes

For each step, Copilot will present the proposed changes in a diff view. Click Accept to apply changes, Reject to skip, or Edit to modify before applying. Use the Accept All button for trusted operations or review each change individually for critical modifications.
Use Ctrl+Z to quickly undo any changes you're not satisfied with.
6

Handle Inter-step Dependencies

Agent mode automatically manages dependencies between steps. If a step fails, Copilot will either:
  • Suggest alternative approaches
  • Skip dependent steps and continue with independent ones
  • Pause execution for your input
Use the Retry button for failed steps or Skip and Continue to proceed.
Check the Problems panel for any syntax errors or conflicts that might affect subsequent steps.
7

Verify Final Results and Test

Once all steps complete, review the Summary panel showing all changes made. Run your application to test the multi-step changes. Use @workspace /tests to generate appropriate tests for the modifications. Check the Source Control panel to review all file changes before committing.
Create a backup branch before running complex multi-step operations for easy rollback if needed.

Common Issues & Troubleshooting

Agent mode is not available or @workspace command not recognized

Ensure you have the latest GitHub Copilot extension version and an active subscription. Update VS Code and restart the application. Check that GitHub Copilot Chat is enabled in settings.

Multi-step execution stops or fails midway

Check the Output panel for error details. Ensure all files are saved and not locked by other processes. Try breaking down the task into smaller, more specific requests using @workspace.

Agent makes unwanted changes to unrelated files

Use more specific file or folder targeting in your request like @workspace /src/auth only modify authentication related files. Review the proposed plan carefully before approving execution.

Steps complete but code has syntax errors or conflicts

Use Ctrl+Shift+P and run Developer: Reload Window to refresh IntelliSense. Check the Problems panel and use @workspace fix syntax errors to resolve issues automatically.

Prices mentioned in this guide are pulled from current plan data and may change. Always verify on the official GitHub Copilot website before purchasing.