Workspace and Multi-File Tasks
Copilot Workspace and Multi-File Tasks
For tasks that go beyond a single function or file — adding a new feature, refactoring a module, scaffolding a new service — Copilot offers workspace-level capabilities. These turn natural language descriptions into coordinated changes across many files.
Inline Chat across files (VS Code multi-edit)
In newer versions of VS Code, Copilot Chat can propose edits across multiple files in a single session. You attach several files with #file:, describe the task, and Copilot proposes changes to all of them. You review each file's diff and accept or reject.
Example prompt with multiple files attached:
code#file:routes/users.ts #file:services/userService.ts #file:types/user.ts Add a PATCH /users/:id endpoint that allows updating the user's displayName and avatarUrl fields. Follow the same patterns as the existing PUT endpoint. Validate that displayName is between 2 and 50 characters if provided. Add the updateUser method to userService if it does not exist. Update the User type if needed.
Copilot reads all three files and proposes changes to each one. You review a diff per file.
Copilot Workspace (GitHub.com)
Copilot Workspace is available on GitHub.com and works at the repository level. The workflow:
Starting from an issue:
- Open a GitHub issue. It might say: "Add rate limiting to the API endpoints. Limit to 100 requests per minute per IP. Return 429 when exceeded."
- Click "Open in Copilot Workspace" (the button appears on issues when you have a Copilot subscription).
- Copilot reads the issue and explores the repository. It produces a plan: a list of files to change and what to change in each.
- You review the plan. Edit it if needed — add files it missed, clarify a step, remove something it got wrong.
- Click "Implement." Copilot writes the code changes.
- Review the diff. Refine with follow-up messages if needed.
- Click "Create PR." A pull request is opened with the changes.
Starting from a file: You can also open any file on GitHub.com and ask Copilot to suggest improvements, refactors, or additions. The context is the whole repository, not just the file.
Evaluating Workspace output: the review process
Workspace changes require thorough review. Unlike a single function suggestion you can read in 10 seconds, a multi-file change can touch dozens of places. Build these habits:
Read the plan before implementation. If the plan is wrong, the code will be wrong. Does it identify all the files that need to change? Does it understand what the change entails? Correct the plan before clicking "Implement."
Review every file in the diff. Not just the ones that look interesting. The AI sometimes makes unnecessary changes to files you did not ask it to touch.
Run all the tests. Workspace changes are more likely to introduce subtle breakage than single-function suggestions. Your test suite is not optional here.
Check for new dependencies. The AI sometimes introduces an import from a library you have not installed, or uses a newer API than your installed version supports.
When Workspace works well
- Adding a new endpoint with a clear pattern to follow
- Renaming a type or interface and updating all usages
- Adding the same logging or instrumentation to a set of similar functions
- Scaffolding a new module (model + repository + service + route + tests) following an established pattern
When Workspace struggles
- Tasks requiring understanding of complex state management or data flows
- Cross-cutting changes that depend on runtime behavior rather than code structure
- Anything where the correct implementation requires domain knowledge the AI does not have
- Very large repositories where the AI cannot fit the relevant context in its window
For struggling cases: break the task into smaller pieces. Do them one at a time with Chat, verifying each step.