Agents, Copilot Edits & multi-file changes
Agents plan, edit many files, run commands, read the results and iterate — in your editor, in the background, or in the cloud as Copilot coding agent. You stay in control with checkpoints, approvals and per-file review.
Built-in agents
Pick an agent from the dropdown in the chat input. Each has a different tool set and autonomy level.
Ask
Answers questions about code and concepts. Uses read-only tools to search the workspace. Nothing changes on disk.
Plan
Researches the task and drafts a step-by-step implementation plan you can edit, then hand off to Agent to build it.
Agent
Autonomous: finds files, edits across the codebase, runs terminal commands and tests, reads errors and iterates until done.
Edit
The Copilot Edits experience: you choose the working set of files, it proposes multi-file edits, you review and keep or undo. Agent mode superseded it as the default.
- 1
Plan
Use the Plan agent or /plan. Review the plan; answer its clarifying questions.
- 2
Implement
Hand off to Agent. It reads files, creates and edits code across the project.
- 3
Verify
It runs builds, linters and tests, reads failures and fixes them — an automated refactoring loop.
- 4
Review
Inspect the multi-file diff. Keep or undo per file, or restore a checkpoint.
Reviewing a multi-file agent session
Try it: switch files, then Keep or Undo each one — this is how VS Code lets you accept agent edits granularly.
Agent log
- Read src/api/routes.ts, src/lib/redis.ts
- Created src/middleware/rate-limit.ts
- Edited src/api/routes.ts
- Ran npm test -- api → 1 failed
- Fixed missing Retry-After header
- Ran npm test -- api → 43 passed
+import { RateLimiterRedis } from "rate-limiter-flexible";+import { redis } from "../lib/redis";++const limiter = new RateLimiterRedis({ storeClient: redis, points: 100, duration: 60 });++export async function rateLimit(req, res, next) {+const key = req.get("x-api-key") ?? req.ip;+try {+await limiter.consume(key);+next();+} catch (r) {+res.set("Retry-After", String(Math.ceil(r.msBeforeNext / 1000)));+res.status(429).json({ error: "rate_limited" });+}+}
Checkpoints
Each request creates a checkpoint of the files the agent changes. Restore one to roll back every edit made after it, then re-prompt. Combine with Git commits for durable history.
Permission levels
- Default approvals: Asks before running terminal commands, editing sensitive files or calling tools that aren't pre-approved.
- Bypass approvals: Auto-approves tool calls in the session; it may still ask clarifying questions.
- Autopilot (preview): Approves everything and keeps going until the task is complete. Use in sandboxes, worktrees or containers.
Steer, don't restart
/compact when a long session gets noisy.Where agents run
Same agent, three execution environments — pick based on how much you need to interact.
Local (VS Code)
Runs in your editor with your workspace, extensions and terminal. Interactive — you can steer mid-run.
Background / Copilot CLI
Runs on your machine in the background, optionally in an isolated Git worktree so it doesn't touch your working copy. Monitor from the Sessions view.
Cloud (Copilot coding agent)
Runs on GitHub Actions. Works from an issue or prompt, pushes to a copilot/* branch and opens a draft pull request for review.
Copilot coding agent (issue → pull request)
Assign an issue to Copilot and it works autonomously in an ephemeral GitHub Actions environment, then requests your review.
- Assign from GitHub.com, GitHub Mobile, VS Code, the Agents panel, Copilot CLI, or via the GitHub MCP server.
- It creates a copilot/* branch, commits as it goes and keeps a draft PR description updated with a checklist.
- Comment on the PR mentioning @copilot to request changes; it picks them up and pushes new commits.
- Pre-install dependencies with .github/workflows/copilot-setup-steps.yml so it can build and test fast.
- It follows your custom instructions, AGENTS.md, custom agents, skills and MCP configuration.
name: "Copilot Setup Steps"
on: workflow_dispatch
jobs:
copilot-setup-steps: # job name must be exactly this
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v4
with: { node-version: "22", cache: "npm" }
- run: npm ciCopilot code review
Request Copilot as a reviewer on a pull request (or review uncommitted changes in your IDE). It leaves comments with suggested fixes you can apply in one click.
Pair it with a human reviewer