Use GitHub Copilot agent mode for multi-file changes by planning uncertain work in VS Code, submitting a scoped task, supervising commands, and reviewing every resulting edit.
What GitHub Copilot agent mode does
GitHub describes agent mode as an editor workflow in which Copilot receives a high-level task, chooses files, proposes code changes and terminal commands, and iterates when issues arise. It is available in Visual Studio Code, Visual Studio, JetBrains IDEs, Xcode, and Eclipse, although GitHub says the steps differ by editor.
For a multi-file change, I suggest choosing a bounded outcome that can be checked with specific tests or other observable criteria. This is an editorial recommendation, not a guarantee that agent mode will complete the task correctly. GitHub’s documentation still places review with the user and says commands require approval by default unless editor settings or administrator policy allow automatic execution.

Create a plan in VS Code when the approach is uncertain
VS Code documents a dedicated planning workflow for uncertain work or changes spanning several project areas. Start a project session, choose Copilot as the session target, and enter /plan, followed by the intended outcome, constraints, and success checks. The Plan agent researches the project, can ask clarifying questions, and produces a plan containing implementation steps, relevant files, and verification steps.
Review the plan’s scope, affected code, assumptions, unresolved decisions, and proposed checks before implementation. You can provide comments and request revisions without approving implementation. I suggest explicitly excluding unrelated work and asking the plan to reuse existing project patterns; these are practical editorial suggestions consistent with the documented review criteria, not established outcomes.

Submit the multi-file task in agent mode
In VS Code, open Chat, select Agent from the agents dropdown, and submit a prompt. Copilot can stream edits, update its working set, and run terminal commands when needed. You may also send a follow-up prompt while it works to redirect the task.
Visual Studio has its own documented sequence: open Copilot Chat, expand the Ask mode dropdown, select Agent, enter the prompt, and send it. Microsoft says the prompt may state a high-level requirement without naming every file. I suggest including the desired behavior, important constraints, and verification expectations so the task has clear boundaries.
Supervise commands and redirect the work
Agent mode is interactive rather than hands-off. GitHub says you can confirm or reject proposed terminal commands, inspect edits as they stream, undo unwanted changes, and redirect the agent with another prompt. By default, commands require approval, but configuration or administrator policy can permit some commands to run automatically.
Microsoft likewise states that Visual Studio requests confirmation before a terminal command or a non-built-in tool runs. Its approval controls can remember permission for a tool at different scopes. I suggest reading each proposed command for its target, side effects, and relevance before approval. That recommendation is a safety practice; the cited documentation does not establish that approval alone makes a command safe.
Review edits and verify the result
In Visual Studio, Copilot streams suggested edits into the editor. You can keep or discard the overall set, open individual file diffs, and apply changes selectively. Microsoft also documents per-file and per-chunk review controls, plus a checkpoint-based Restore action; it notes that the Visual Studio Copilot agent does not currently support stepwise undo or redo.
For verification, I suggest comparing every changed file with the approved scope, then running the project’s relevant build, lint, and test checks. Agent mode can react to build results, test failures, and tool output, but those capabilities do not establish correctness. Treat successful commands as evidence to review alongside the diff, not as a guarantee that the implementation matches your intent.
Conclusion
For multi-file changes, my practical recommendation is to use a four-part workflow: plan uncertain work, submit a bounded implementation request, supervise tool activity, and review the complete diff. In VS Code, use the documented /plan workflow when you want a dedicated plan before implementation. In Visual Studio, use its documented Agent selection and edit-review controls rather than assuming the VS Code interface is identical.
Prefer a task with explicit constraints and verification criteria, reject commands that do not fit its scope, and request revisions when edits diverge from the intended result. Agent mode can locate relevant context, modify multiple files, run commands, and iterate on detected problems, while the documented workflow leaves acceptance of the resulting changes to you.
Sources
- Use Agent Mode – Visual Studio (Windows) | Microsoft Learn
- Using agent mode in your IDE – GitHub Docs
- Plan work with agents in VS Code
- Quickstart for using GitHub Copilot on GitHub.com – GitHub Docs
Disclosure
This article was prepared with AI assistance.
Improve this guide
Report a problem or suggest the next question
Submissions enter a private editorial queue. They are reviewed and deduplicated before any public update or new page is created.
