NEW: Claude Code Security — research preview

Chat

Chat surfaces, context, session configuration, and reviewing AI changes

Read time: 6 min

title: "Chat" description: "Chat surfaces, context, session configuration, and reviewing AI changes" section: "Copilot" readTime: "6 min"

Copilot Chat

Chat enables natural language AI assistance for coding tasks. Four surfaces are available, each optimized for different workflows.

Chat Surfaces

SurfaceShortcutBest for
Chat viewCtrl+Alt+IMulti-turn conversations, agents, multi-file edits
Inline chatCtrl+IIn-place edits in editor or terminal
Quick ChatCtrl+Shift+Alt+LQuick questions without leaving current view
Command linecode chatStarting chat from outside VS Code

Configure Your Session

When starting a chat session, four settings shape behavior:

  1. Session type — where the agent runs (local, background, cloud)
  2. Agent — role/persona (Agent, Plan, Ask, or custom)
  3. Permission level — how much autonomy (Default Approvals / Bypass / Autopilot)
  4. Language model — which AI model powers the conversation

Adding Context

MethodWhat it provides
ImplicitActive file, current selection, file name (automatic)
#file / #folder / #symbolExplicit file/folder/symbol reference
#codebaseSemantic search across entire workspace
#fetchContent from a web URL
@vscode / @terminal / @githubDomain-specific participants
VisionAttach images (screenshots, UI mockups)
Drag & dropDrop files from Explorer or editor tabs onto Chat

Semantic Search (All Workspaces)

Semantic indexing now works in every workspace — not just large or pre-configured ones. Agents find relevant code by meaning, even when you don't know the exact file name.

Agents can also run grep-style searches across GitHub repos and organizations using the built-in githubTextSearch tool — pull context from any repo you have access to, not just what's on disk.

Submit Your First Prompt

  1. Open Chat view (Ctrl+Alt+I)
  2. Select Local from the agent target dropdown
  3. Select Agent from the agent picker
  4. Type a prompt and press Enter:
Create a basic calculator app with HTML, CSS, and JavaScript
  1. Review suggested changes and Keep or Discard

Review and Manage Changes

After the AI edits files:

  • Inline diffs in chat — code changes now appear as diffs directly in the chat thread; review without opening a file
  • Checkpoints — VS Code auto-snapshots files; roll back to a previous state anytime
  • Stage to accept — staging changes in Source Control automatically accepts pending AI edits

Query Chat History with /chronicle

/chronicle (Experimental) stores your chat interactions in a local database so you can search past sessions.

/chronicle what files did I change last Tuesday?
/chronicle find the session where I fixed the auth bug
/chronicle recent work on the payments module

Enable it in Settings: github.copilot.chat.localIndex.enabled

Chronicle also surfaces personalised workflow tips based on your history — files you touch most, PRs you reference, patterns that repeat.

Agents and the Browser

Give agents visibility into your live browser by sharing tabs on demand. Useful for UI work — the agent sees what the page actually renders, not just source code:

  1. Open your app in the integrated browser
  2. Share the tab with the agent
  3. The agent reads content, interacts with elements, and validates changes in real time

Agents and Open Terminals

Agents can read from and write to any open foreground terminal, including running REPLs, dev servers, and interactive scripts. You no longer need to stop a process before asking Copilot to act on its output.

Getting Better Responses

  • Be specific: reference files, symbols, use / commands
  • Add custom instructions for project-wide coding standards
  • Use /compact when the conversation grows too long
  • Start new sessions for unrelated tasks (context pollution degrades quality)
  • Use the model picker (Ctrl+Alt+.) to switch to a model better suited for the task

Troubleshooting Responses

Use Agent Logs (... menu → Show Agent Debug Logs) to inspect tool call sequences, LLM requests, token usage, and prompt file discovery. Logs now persist locally across sessions — retrace what happened in earlier runs without keeping VS Code open. Use the Chat Debug view for raw system prompt and tool payloads.

Long-running background terminal commands surface as system notifications in chat so you always know when something finishes.