The VS Code Agents window gives coding agents a dedicated place to handle multi-step tasks across projects. Agents can read files, edit code, run approved tools or commands, and iterate on results, while you remain responsible for permissions, review, and validation.
Agents are available in the code-first Chat view and the agent-first Agents window. The Agents window is currently a Preview feature built into VS Code Insiders, not the Stable release, and its interface and supported agents can change.
Before starting, install VS Code Insiders, set up Copilot, and verify that the chat.agent.enabled setting is on. An organization administrator can disable agents. Follow the /vscode/how-to-set-up-github-copilot-free-in-vs-code guide if needed.
Open the Agents window
The Preview Agents window is a separate VS Code Insiders window dedicated to agent tasks. Your main editor window stays open alongside it.
Choose one of these methods:
- Select Open in Agents in the VS Code title bar.
- Open the Command Palette (Ctrl+Shift+P / Cmd+Shift+P) and run Chat: Open Agents Window.
- From a terminal, run code --agents.
- Open the Agents window in a browser at insiders.vscode.dev/agents (requires a dev tunnel).
The Agents window opens with your existing sessions visible in the sidebar. If you were already signed into GitHub in the main VS Code window, you are signed in automatically here too.
Interface overview
The Agents window has four main areas:
| Area | Purpose |
|---|---|
| Sessions list (left sidebar) | All your sessions across workspaces, grouped by project. Start, switch, rename, pin, or archive sessions. |
| Chat area (center) | The conversation with the agent. Open multiple chats as tabs. Each chat is an independent conversation. |
| Changes panel (right) | Review files changed by the agent. See diffs, leave feedback, and commit or discard changes. |
| Customizations panel (left sidebar, bottom) | Manage agent customizations: custom agents, skills, instructions, hooks, MCP servers, and plugins. |
Start an agent session
Create a new session
Select New at the top of the sessions sidebar, or press Cmd+N (macOS) / Ctrl+N (Windows/Linux).
Choose a workspace
Use the workspace dropdown to select a local folder or a GitHub repository. For local folders, the agent type defaults to Copilot CLI. For GitHub repositories, it defaults to Copilot Cloud agent.
Configure the session
Choose how the agent runs:
- Agent type: a local folder currently supports Copilot CLI or Claude agent, while a GitHub repository uses Copilot Cloud. The available list depends on the workspace and account.
- Isolation: enable New Worktree to keep Copilot session changes separate, or disable it to work in the selected folder.
- Agent and model: choose an available custom agent and language model when the session supports them.
- Permission level: keep Default Approvals unless you understand the risks of Bypass Approvals or Autopilot.
Send a prompt
Type what you want the agent to do and press Enter. Be specific.
A good prompt describes the goal, mentions relevant files, and states any constraints.
Example: "Add a dark mode toggle to the header component in src/components/Header.tsx. Use CSS variables defined in src/styles/theme.css. Make sure the preference is saved to localStorage and the toggle works on mobile."
The agent starts working in the selected folder, repository, or worktree. Tool calls and approvals appear in chat, and changed files appear in the Changes panel.
You can send another message while a request runs and choose whether to queue it, steer the current request, or stop and send the new message.
Review agent changes
After the agent finishes a task, review its changes before accepting them.
File diffs
Open any changed file to see an inline diff. Each edit has Keep and Undo controls. Use the editor overlay arrows to navigate between edits. Review every change, not just the first one.
Changes panel
The Changes tab in the right panel lists files changed by the agent's file-edit tools. Select a file to open its diff view. Tool-edited files outside your workspace folders appear in a separate Other Files section, but changes made only through terminal commands might not appear there.
Leave feedback
Select a range of code in a changed file and choose Add Feedback. Write a comment describing what you want changed, then select Submit Feedback. The agent reads your comments and makes the requested adjustments. Use this to refine output without starting a new session.
Commit, merge, or discard
After review:
- Commit: commit changes from a folder-isolated session in its workspace.
- Merge: merge changes from a worktree-isolated session. You can optionally sync upstream or create a pull request.
- Checkout: for a Copilot Cloud session, check out the pull request branch locally for further review.
- Discard: remove unwanted edits from individual files or all changes.
Discard permanently removes the selected uncommitted edits. Commit, stash, or copy anything you might need before using it.
Run multiple chats in one session
A single agent session can have multiple independent chats. Each chat has its own conversation, status, and model selection, but all chats share the same workspace.
Press Cmd+T (macOS) or Ctrl+T (Windows/Linux) to create a new chat tab. Type a prompt and the new chat starts from scratch with no memory of the other chats.
This is useful when you want to work on two independent tasks in the same project without losing context from either conversation. The session header shows a combined Changes pill that aggregates edits from all chats.
Plan before coding
Type /plan in a Copilot CLI or Claude agent session when you want the agent to plan before implementation. The Agents window currently does not show a separate plan agent in its agent dropdown.
Copilot CLI can also invoke planning when your prompt explicitly asks for a plan. Review the plan and clarify risky or unclear steps before allowing implementation.
Use side chats
Type /btw followed by your question in the chat input to open a side chat. A side chat asks the agent a question about the current conversation without adding the question or response to the main chat history.
Side chats are useful for checking your understanding mid-task. For example, typing "/btw why did you choose a Map over an object here?" asks the agent to explain a decision without steering the main task.
Side chats are available for Copilot CLI and Claude sessions in the Agents window.
Validate agent changes locally
Before committing agent changes, run your project's tests and build to verify nothing broke.
Select the Tasks dropdown in the Agents window title bar, then Add Task. Enter a name (like "Run tests") and the command (such as npm test or pytest). You can set the task to run automatically when the session worktree is created.
If your project serves a web app, select a localhost link in chat to open it in the integrated browser. The browser tab is scoped to the session and persists across session switches.
To run terminal commands yourself in the session context, select the Open Terminal icon in the title bar. The terminal opens with its working directory set to the session folder or worktree.
Customize agent behavior
The Customizations panel (bottom of the left sidebar) lets you tailor how agents work:
- Agents: define custom agent personas with specific tools and instructions.
- Skills: add portable instruction folders that agents load when relevant.
- Instructions: set coding standards and conventions.
- Hooks: run shell commands at lifecycle points during sessions.
- MCP Servers: connect agents to external tools, databases, and APIs.
- Plugins: install prepackaged bundles of customizations from the Marketplace.
Use the dropdown at the top left of the Customizations panel to choose which agent the customization applies to. MCP servers, hooks, skills, and plugins can execute tools or commands, so verify their source and configuration before enabling them.
Agent types compared
| Agent type | Runs on | Best for |
|---|---|---|
| Copilot CLI | Your machine, often in a worktree | Local agent-host tasks |
| Copilot Cloud | GitHub infrastructure | Background tasks, no local resources needed |
| Claude agent | Your machine | Anthropic agent-host sessions |
Copilot CLI and Claude sessions support multiple chats and side chats. Copilot Cloud sessions require a GitHub-backed repository. A Copilot CLI folder session can use Continue In to hand work to a Copilot Cloud agent when the account and repository support it.
Limitations
The Agents window is in preview and has some current limitations:
- Multi-root workspace sessions are not yet supported. You can still ask the agent to work across projects in a single session.
- The agents dropdown does not include the Plan persona. Use
/planor mention planning in your prompt instead. - The agent cannot directly open the integrated browser. Open it from the Command Palette or by selecting a
localhostlink. - Local and third-party CLI agents are managed from the main VS Code window, not the Agents window.
The Agents window and its documented behavior are still changing during Preview. Verify the current official Agents window documentation before publishing screenshots or relying on a specific control location. For creating your own specialized agent personas, see /vscode/how-to-create-custom-agents-in-vs-code-with-agent-md-files.
Rune AI
Key Insights
- The Agents window is currently Preview and built into VS Code Insiders.
- Open it with Open in Agents, Chat: Open Agents Window, or
code --agents. - Choose a workspace, supported agent type, isolation mode, permission level, and model before sending a task.
- Worktree isolation keeps Copilot CLI changes separate until you merge or create a pull request.
- Review the Changes panel and run project checks before committing or merging.
- Multiple chats and side chats currently depend on the selected agent-host session type.
Frequently Asked Questions
What is the difference between the Agents window and the Chat view?
Do coding agents work on Copilot Free?
Can agents run commands or edit files without prompting me?
Conclusion
The Preview Agents window in VS Code Insiders provides one place to run supported agents across projects, isolate work, review diffs, and validate results. Start with Default Approvals and worktree isolation, inspect every change, and merge only after the project's own checks pass.
More in this topic
How to Use VS Code with WSL 2 on Windows
Run VS Code connected to Windows Subsystem for Linux so you can develop in a full Linux environment with native tools, terminals, and debugging, all from Windows.
20 Best VS Code Extensions for Web Developers in 2026
Twenty carefully chosen VS Code extensions every web developer should know. Covers formatting, linting, frameworks, debugging, Git, and developer experience.
How to Install, Disable, Update, and Uninstall VS Code Extensions
Learn how to install, disable, update, and uninstall VS Code extensions from the Marketplace and the command line. Step-by-step instructions for every action.