Use the Chat view
The Chat view runs agents beside your code in the main Visual Studio Code window. Use it when you want to collaborate over code in the current workspace while keeping the editor, debugger, tests, terminals, extensions, and notebooks available alongside the conversation.
Start with a question about your project, ask for a change when you're ready, and inspect the result alongside your code. This article shows how to open the Chat view, start a session, customize the layout around your editor, and isolate parallel tasks in worktrees. To compare this approach with coordinating tasks in the Agents window, see Choose how you work.
Prerequisites
- Visual Studio Code installed. Download VS Code.
- Access to an AI model through a supported setup:
- For models provided by GitHub Copilot, set up GitHub Copilot in VS Code.
- To use Anthropic Claude, OpenAI Codex, or your own model credentials for supported workflows, review the agent harness authentication options and language model setup.
Claude and Codex harnesses are disabled when Copilot enterprise-managed settings apply, unless your administrator explicitly permits them. Contact the IT team that deployed the settings to discuss access.
Open the Chat view
The Chat view opens in the Secondary Side Bar, next to your editor. To open the Chat view, use one of the following methods:
-
Select the Toggle Chat icon in the VS Code title bar, or open its dropdown menu and select Open Chat.
-
Use the keyboard shortcut ⌃⌘I (Windows, Linux Ctrl+Alt+I).
-
Run
code chatfrom the command line to start chat from outside VS Code. Learn more about starting chat from the command line.
Interface overview
The Chat view keeps the agent beside your code so you can prompt, inspect diffs, and edit in the same window. Each session is a saved conversation for a task in the current workspace, so you can leave and return later. Sessions from other workspaces aren't listed here. Use the Agents window to work across projects.
The Chat view has three main areas:
-
Sessions list: at the top or side of the view, where you find, switch between, and manage sessions for the current workspace. Learn more about finding and resuming sessions.
-
Chat conversation: in the center, where you read responses, inspect tool activity, and open changed files.
-
Chat input: at the bottom, where you enter prompts, attach context, and configure how the session runs.
At narrower widths, the sessions list appears when no conversation is open and switches to the conversation once you select or start a chat. Widen the view to show both side by side.

To inspect a chat response with a keyboard or screen reader, run Open Accessible View (⌥F2 (Windows Alt+F2, Linux Shift+Alt+F2)). Learn more about the Accessible View.
Start a session
-
Open the project you want to work on and select New Chat (
+) or press ⌘N (Windows, Linux Ctrl+N). -
Keep the default input settings to start right away, or adjust the controls at the bottom of the chat input before sending your first prompt. Available choices depend on your account, installed providers, and organization policies.
Control Example value What it chooses Session Target Copilot The agent harness (the runtime, tools, and workflow around the model). Agent Agent The built-in or custom agent role that determines how requests are handled. Language model Auto or Copilot Fusion The AI model used for responses. Auto picks a model for you. Permissions Manual permissions Whether tool actions and terminal commands ask for your approval before running. For a first coding task, follow the agents quickstart with Copilot, Agent, Auto, and Manual permissions.
-
Enter a question or describe the task, and press Enter. For example, start with a read-only question about your workspace:
Explain how authentication works in this project and list the key files.
Once a session is running, use chat interaction controls to attach context, steer or stop requests, and navigate responses, and see Review and revert agent changes to inspect diffs or keep and undo edits. In a remote workspace, the session uses that project's remote files and tools automatically.
Customize the Chat view layout
You can open chats in several places within the main VS Code window:
-
Side bar (default): select New Chat (
+) > New Chat, or run the Chat: New Chat command. Best for keeping chat visible alongside your code. -
Editor tab: select New Chat (
+) > New Chat Editor, or run the Chat: New Chat Editor command. Best for giving chat more space or comparing sessions side by side. -
Separate window: select New Chat (
+) > New Chat Window, or run the Chat: New Chat Window command. Best for multi-monitor setups.
You can also adjust the Chat view within the workbench:
- Maximize or restore: select Maximize Secondary Side Bar in the Chat view title bar to expand chat across the window, or select it again to restore the previous size.
- Hide while work runs: press ⌥⌘B (Windows, Linux Ctrl+Alt+B) to hide or show the Secondary Side Bar without interrupting an active session.
- Move the view: drag the Chat view tab to the Primary Side Bar or Panel to dock it where you prefer.
Sessions list layout
Use the orientation toggle in the top-right corner of the Sessions header or chat.viewSessions.orientation to switch how the sessions list appears:
- Stacked (
stacked): The sessions list displays above the chat input when no conversation is open. Select a session to open it, then use the back button to return to the list. - Side by Side (
sideBySide, default): The sessions list stays visible next to the conversation when the view is wide enough, falling back to stacked when narrow.
To hide or show the list, right-click in an empty chat and toggle Show Sessions, or configure chat.viewSessions.enabled . For filters, session actions, and switching between nested chats within a multi-chat session, see Manage agent sessions.
Open session chats in another area (Experimental)
By default, selecting a session opens its conversation inside the Chat view. To open conversations in another area of a local editor window instead, select More Actions (...) > Show Chat In in the Chat view title bar, or configure
chat.viewSessions.openChatIn
:
- Chat Panel (
chatPanel, default): Open the conversation in the Chat view. - Chat Area (
chatArea): Open the conversation in a dedicated chat area beside the Chat view, which then shows only the sessions list. Requires chat.viewSessions.orientation set tosideBySide. - Editor Area (
editorArea): Open the conversation as an editor tab, revealing an already-open tab when selected again. In VS Code Insiders, new chats also open as editors and the Chat view shows only the sessions list.
Switch back to chatPanel to return to the default layout or work with legacy Local harness sessions.
Session status indicator (Experimental)
Use chat.agentsControl.enabled to control how the agent status indicator appears in the title-bar command center so you can check sessions without switching views:
compact(default): Replaces the command center search box with a compact agent status indicator and unified chat control.badge: Shows the agent status as a badge next to the command center.hidden: Hides the agent status indicator from the title bar.
Any value other than hidden automatically enables
window.commandCenter
. Showing unread and in-progress session counts also requires
chat.viewSessions.enabled
.

When sessions have unread replies or running agents, status badges appear inside the indicator:
- Select the unread sessions badge to filter the sessions list to conversations with new messages.
- Select the in-progress sessions badge to filter to sessions with running agents.
- Select the Toggle Chat dropdown icon for chat and session management options.
Continue in another interface
When you want to coordinate work across projects, move from the editor window to the Agents window without restarting supported tasks:
- Hand off the active session: For a supported Copilot session, select More Actions (
...) > Open in Agents Window in the Chat view title bar. - Open the workspace in the Agents window: Select Open in Agents in the application title bar, then select an existing supported session from the sessions list.
Review the supported session types and continuation steps first: legacy Local harness sessions and sessions from the OpenAI Codex extension remain editor-only.
To work from a terminal instead, start a Copilot CLI session or continue a CLI session in VS Code.
You can also keep using inline suggestions as you type, or use inline chat for a focused edit. These approaches complement the conversation rather than replace it.
Work in separate worktrees
Keep changes from parallel agent tasks separate without opening another editor window. Each chat can work in its own Git worktree, and the editor's folder location follows the chat you open. For isolation choices, starting code, and dependency setup, see Work with agents in worktrees.
This workflow requires VS Code Insiders, a single local Git folder with at least one commit, and a harness that supports worktree isolation, such as Copilot.
- Enable chat.editorWindow.enableWorktree , which is off by default.
- Start a new chat and choose your harness.
- Select New Worktree before sending the first prompt. If the chat input shows a folder picker, open it to select New Worktree.
- Describe the task and send your prompt. The chat works in a new worktree on its own branch, separate from your original folder.
If the Work in Parallel callout appears, choose Use New Worktree to separate the task's changes, or Continue in Folder to share the folder. Later new chats use your answer as their default.
Switch between your folder and worktrees
With editor worktree support enabled, a single editor window switches between your original project folder and any session worktree. Explorer and Source Control always show the files, changes, and Git branch for the active folder or worktree.
You can switch in two ways:
- Switch from a chat: Open a chat from the sessions list to switch the editor to that chat's folder or worktree.
- Switch from the Status Bar: Select Folder Location in the Status Bar and choose your original folder or an entry under Worktrees. The Chat view reopens the last unarchived chat used there.
Check the active folder or worktree in the Status Bar before editing files or committing changes.

Switching between your folder and a worktree only changes what the editor shows. It doesn't merge changes. When a task is ready, review and integrate the worktree changes, and clean up inactive worktrees when you no longer need them.
Switching the editor to another folder or worktree doesn't move running terminals, tasks, or debug sessions:
- Terminals: Existing terminals keep their previous working directory. Check a terminal's directory before running commands, or open a new terminal after switching.
- Debug sessions and tasks: When you switch manually by opening a chat or selecting Folder Location, VS Code prompts you to stop affected debug sessions and tasks with Stop and Switch. When the editor switches automatically (for example, right after a new chat creates its worktree), existing debug sessions and tasks can remain running in the previous folder.
Next steps
- Work with chat messages and responses: send and steer requests, add context, and navigate a conversation.
- Manage agent sessions: organize, archive, fork, and continue sessions across interfaces.
- Use the Agents window: work with agents across multiple projects.