VS Code AI Agents (2026): Chat View, Agents Window, Harnesses and Cloud Sessions
Inline suggestions, the Chat view, the Agents window, the Copilot, Claude and Codex harnesses, cloud sessions and automations in Visual Studio Code, explained from Microsoft's documentation
By TheBestSuperintelligence Editorial TeamUpdated
How do AI agents work in VS Code, and which agent harness should I pick?
VS Code offers three ways to work with AI: inline suggestions as you type, an agent in the Chat view beside your code, and the Agents window for delegating tasks across projects. Start with the Copilot harness; switch to Claude or Codex only for their specific workflows.
◈Key Takeaways (4)
- •Use inline suggestions for typing, the Chat view for work in one workspace, and the Agents window for tasks across projects.
- •Start with the Copilot harness. Changing the model does not change the harness.
- •The Local harness is deprecated and will be removed by February 2027.
- •Cloud sessions are experimental; GitHub environments and cloud automations are in preview.
☰On this page (9 sections)
- 01.Inline suggestions, Chat view or Agents window: which fits your task?
- 02.Copilot vs Claude vs Codex: which agent harness should you choose?
- 03.Which models can you use, and can you bring your own API key?
- 04.How do cloud sessions and GitHub environments let you continue agent work?
- 05.How do automations work in VS Code?
- 06.How to keep VS Code AI agents safe in a real project
- 07.VS Code or Cursor for agent-based coding?
- 08.Limits of this guide
- 09.Sources & Further Reading
Inline suggestions, Chat view or Agents window: which fits your task?
VS Code AI agents come in three working styles, and you can switch between them as a task changes. Microsoft's documentation frames the choice as "as much or as little AI as your task needs".
| Way of working | Where it runs | Use it when |
|---|---|---|
| Inline suggestions | In the editor as you type | You know what to write and want speed |
| Agent in the Chat view | Beside your editor, terminal, tests and debugger | The task lives in one workspace |
| Agents window | A separate window for sessions across projects | You delegate several tasks and review results |
An agent, in Microsoft's definition, uses a model and tools to find relevant code, make changes and run checks. Both the Chat view and the Agents window run agents. You set the goal and review the result. For a small edit without leaving the file, inline chat is the lighter option.
Our take: start in the Chat view. It keeps the agent next to your tests and debugger, so you see failures as they happen. Move to the Agents window once you run more than one task at a time.
Copilot vs Claude vs Codex: which agent harness should you choose?
An agent harness is the layer that coordinates the model, the context and the tools an agent uses. It is a different choice from the model. Microsoft's harness guide, read on 2026-11-17, describes these options:
| Harness | What runs | Choose it when |
|---|---|---|
| Copilot | Copilot SDK, in the Agent Host | Default for day-to-day coding |
| Claude | Anthropic's Claude Agent SDK | Your project already uses Claude configuration |
| Codex | OpenAI Codex extension or Agent Host | Your team works in Codex |
| Cloud (target) | Copilot harness on managed compute | Work must continue with your machine off |
Copilot sessions run independently of the editor window and can keep working in the background after you close it, as long as the Agent Host keeps running. Microsoft recommends starting with the Copilot harness and choosing another only when you need different tools, customizations or workflows.
Does choosing a Claude model change the agent harness?
No. Selecting a Claude model inside a Copilot session still uses the Copilot harness. Opening the same session in another interface also keeps its harness. Pick the harness before your first prompt, from the Session Target control in the Chat view or the Agents window. The control lists only the targets whose requirements are met in the current window.
What happens to the Local harness in February 2027?
The Local harness, VS Code's built-in agent harness that runs in the extension host, is deprecated. Microsoft says it "will be removed by February 2027" and asks users to move workflows to the Copilot harness. One practical difference: a Local session stops when you close its editor window, while a Copilot session can continue in the background.
Which models can you use, and can you bring your own API key?
There are three routes to a model in VS Code, according to the overview page:
- Models from multiple providers through a GitHub Copilot plan.
- Your own API key (BYOK).
- A supported local model.
Which models appear depends on the harness and how you access models. Where tools run and where the model is hosted are separate: an agent can edit files on your machine while sending model requests to a hosted provider. That matters if your code must not leave your network. A local model keeps requests on your machine, while a hosted model does not.
Beyond the model, agents are tailored with plugins, project instructions and skills. External tools connect through Model Context Protocol (MCP) servers, the open standard for linking agents to outside services.
How do cloud sessions and GitHub environments let you continue agent work?
VS Code calls this continuity: picking up agent work on another interface or machine without starting over. Several of these features are not finished, so check each one's status first.
| Where you want to continue | Feature | Status on 2026-11-17 |
|---|---|---|
| Other Copilot apps and devices | GitHub environments | Preview |
| Managed cloud compute | Cloud sessions | Experimental |
| VS Code on another machine | SSH or dev tunnel | Available |
GitHub environments register your own development machine so you can continue its sessions from VS Code, the GitHub Copilot app, Copilot CLI, GitHub.com or GitHub Mobile. Available actions vary by client. The host machine must stay running and reachable. Cloud sessions run on managed compute instead, so your machine can be off. You reopen the same cloud session to continue, and it uses a separate workspace, not your local editor state.
How do automations work in VS Code?
An automation is a saved prompt that runs again. You can run it locally on a schedule. Cloud automations, in preview, handle scheduled or event-triggered repository work while your computer is off. Microsoft's advice is to review one manual run before you turn on recurring work. Use automations for repeatable chores, such as dependency checks or test triage, not for open-ended changes.
How to keep VS Code AI agents safe in a real project
Microsoft states plainly that AI can produce incorrect code or misunderstand intent, and that you remain responsible for what reaches your codebase. The controls it documents:
- Review the diff before you commit. Agents can save edits directly to the session folder or worktree.
- Set approvals. Decide which actions need your confirmation. You can steer or stop a running request, but stopping does not undo completed actions or changes made in external services.
- Do not treat a worktree as a sandbox. A Git worktree separates code changes but is not a security boundary. Use the platform sandboxing options to limit the files and network access that agent-run terminal commands can reach.
- Expect company controls. On a managed device, your organization can restrict agents, models and tools. The Claude and Codex harnesses are disabled when Copilot enterprise-managed settings apply.
Our take: before an agent touches an existing project, apply Microsoft's recommended security baseline, turn on approvals for terminal commands, and commit to a branch the agent cannot push to.
VS Code or Cursor for agent-based coding?
Both editors now separate a single-workspace agent from a window that manages many sessions. Our Cursor Agent guide covers Cursor's version. Our take: VS Code's distinctive feature is the harness choice. You can run Anthropic's or OpenAI's own agent stack inside one editor, which suits teams that already standardized on one of them. If you already pay for GitHub Copilot, VS Code adds no new subscription to start.
Limits of this guide
Several features covered here are preview or experimental and can change without notice. Model lists, prices and Copilot plan limits are not covered; they depend on your account and change often. We describe the Claude and Codex harnesses from Microsoft's pages, not from Anthropic's or OpenAI's documentation.
Sources & Further Reading
| Claim | Source | Date |
|---|---|---|
| Three working styles; Copilot, Claude and Codex harnesses; BYOK and local models | Microsoft: Build with AI in VS Code | Page updated 2026-11-11, read 2026-11-17 |
| Cloud sessions experimental; GitHub environments and cloud automations in preview | Microsoft: Build with AI in VS Code | Read 2026-11-17 |
| Worktree is not a security boundary; stopping does not undo actions | Microsoft: Build with AI in VS Code | Read 2026-11-17 |
| Harness comparison; Local harness removed by February 2027; model choice does not change harness | Microsoft: Choose an agent harness | Read 2026-11-17 |
| Claude and Codex disabled under Copilot enterprise-managed settings | Microsoft: Choose an agent harness | Read 2026-11-17 |
Frequently asked questions
How do AI agents work in VS Code?
VS Code offers three ways to work with AI: inline suggestions as you type, an agent in the Chat view beside your code, and the Agents window for delegating tasks across projects. Start with the Copilot harness; switch to Claude or Codex only for their specific workflows.
What is an agent harness in VS Code?
A harness is the layer that coordinates the model, context and tools an agent uses. VS Code offers Copilot, Claude and Codex harnesses, plus Cloud as an execution target. Selecting a Claude model inside a Copilot session still uses the Copilot harness, so the harness and the model are separate choices.
Can I use my own API key for AI in VS Code?
Yes. Microsoft's documentation lists three routes: models from multiple providers through a GitHub Copilot plan, your own API key (BYOK), or a supported local model. Which models appear depends on the harness you pick and on how you access models.
Why are the Claude and Codex harnesses missing in my VS Code?
On a managed device, they are disabled when Copilot enterprise-managed settings apply, including managed permission or sandbox settings. Ask the IT team that deployed those settings for access. The session target control also lists only harnesses whose requirements are met in the current window.
Is a Git worktree enough to keep a VS Code agent safe?
No. Microsoft states that a worktree keeps code changes separate but is not a security boundary. For limits on files and network access by agent-run terminal commands, use the platform sandboxing options, set approvals for risky actions, and review the diff before you commit.
How we sourced this. We read Microsoft's VS Code AI overview (updated 2026-11-11) and its agent harness guide on 2026-11-17. We did not test the features ourselves. Methodology