skip to content

Copilot

GitHub's assistant in the IDE, on github.com and in the terminal: completions, chat and agent mode, instruction files, the cloud agent and code review. Asked because it is the most deployed tool.

part ofAI coding toolsread it →
on this pageshow

explore

questions

28

In VS Code with GitHub Copilot, when do you use editor inline chat instead of the Chat view, and what is each one scoped to?

level: juniorimportance: must knowfreq 22%

answer

  1. where the prompt lands
  2. active editor versus a whole session
  3. an inline diff to Keep or Undo
  4. multi-file work belongs elsewhere
  5. inlineChat.askInChat reroutes the shortcut

basics

~20 s

Use editor inline chat for a quick, targeted edit in the open file: its prompt is scoped to the active editor or selection and comes back as an inline diff. Use the Chat view for multi-step, multi-file work and codebase questions.

solid answer

~50 s

Editor inline chat (`Cmd+I` on macOS, `Ctrl+I` on Windows and Linux) opens inside the editor, scopes the prompt to the code in the active editor (or to a selection, if you make one) and shows the change as an inline diff that you **Keep** or **Undo**. It may still read other workspace files, but it is built for focused edits. The Chat view, in the Secondary Side Bar by default, holds a whole session with its own Session Target, Agent, model and Permissions controls. Multi-step tasks, multi-file changes and codebase exploration belong there. Two lighter surfaces complete the set: terminal inline chat suggests a shell command that you **Run** or **Insert**, and Quick Chat answers a short question and can hand it to the Chat view. One surprise: if the file already belongs to an active chat editing session, the inline chat shortcut opens **Ask in Chat** in the Chat view instead, unless `inlineChat.askInChat` is `false`.

go deeper

for a junior

Recall the split: inline chat for a focused edit in the active editor, reviewed as an inline diff with Keep or Undo; the Chat view for conversations and multi-file work.

for a middle

Explain the scoping: the active editor or selection for inline chat, a whole session with Session Target, Agent, model and Permissions in the Chat view, and where terminal inline chat and Quick Chat fit.

for a senior

Show that you know the edge cases: inlineChat.askInChat sending the shortcut into an active editing session, inlineChat.defaultModel resetting on reload, and when to move an inline request to the Chat view.

for a principal

Frame the surface choice as a cost decision: a scoped diff is cheap to review, while a session that reaches across files needs the review discipline your team applies to bigger changes.

## Four chat surfaces in one editor GitHub Copilot's chat in VS Code runs in several places that look alike but scope a prompt differently. Once you know which surface you are in, you know what the model is looking at and what it can change. | Surface | How you open it | What the prompt is scoped to | What comes back | |---|---|---|---| | **Chat view** | **Chat** menu > **Open Chat** | A whole session: the conversation so far, the implicit context and anything the agent gathers | Answers, multi-file edits, tool runs | | **Editor inline chat** | `Cmd+I` (macOS) / `Ctrl+I` (Windows, Linux) in an editor | The code in the active editor, or the selected block | An inline diff with **Keep** and **Undo** | | **Terminal inline chat** | The same shortcut in the integrated terminal, or the **Terminal Inline Chat** command | A shell question | A command you **Run** or **Insert** | | **Quick Chat** | **Quick Chat** in the **Chat** menu | A short, throwaway question | An answer you can move with **Open in Chat view** | ## Editor inline chat: the active editor is the scope Editor inline chat is for a quick, targeted change to code you can see. A typical use: 1. Open the file, and select the block you care about if the request concerns only part of it. 2. Press `Cmd+I` / `Ctrl+I`, or choose **Open Inline Chat** from the **Chat** menu. 3. Type the request, such as "make this iterative", and press Enter. 4. Read the inline diff and choose **Keep** or **Undo**. A few details matter: - **Scope.** VS Code's documentation says the prompt is scoped to the code in the active editor, and a selection narrows it to that code. It also says inline chat *might* use content from other workspace files as context. So "it cannot see anything else" is wrong, but inline chat is not the place to plan a change across several files. - **Built-in command.** `/doc` generates documentation comments and is listed as a command for editor inline chat. - **Model.** `inlineChat.defaultModel` sets the model. If you switch models during a session, the switch lasts for that session and reverts to the setting after VS Code reloads. - **Limits.** Find, which searches a conversation, is not available in inline chat or Quick Chat. ## The Chat view: a session with controls The Chat view opens in the Secondary Side Bar by default. You can also open it as an editor tab (**New Chat Editor**) or in a separate window (**New Chat Window**). Its main features: - **Session controls.** Before the first prompt you choose a **Session Target**, an **Agent**, a **Language model** and **Permissions**. Together they decide what the session can do. What the agent then does on its own is covered by the material on Copilot's agent. - **History.** The conversation carries forward, so a follow-up builds on earlier turns instead of starting from scratch. - **Reach.** VS Code's own guidance sends multi-step tasks, multi-file changes and broader codebase exploration to the Chat view rather than to inline chat. ## When the shortcut opens the Chat view There is one case where the inline chat shortcut does something else. If the file you are in belongs to an **active chat editing session**, pressing the shortcut opens **Ask in Chat** in the Chat view. Your prompt then goes into the existing session and can use its full conversation context, and the editor's context menu shows **Ask in Chat** in place of **Open Inline Chat**. The setting is `inlineChat.askInChat`, which defaults to `true`. Set it to `false` to always get regular inline chat. Files that belong to no chat session always open regular inline chat, whatever the setting says. ## Terminal inline chat and Quick Chat - **Terminal inline chat** runs in the integrated terminal and helps with shell commands, for example "list the top 5 largest files in the src dir". It proposes a command. **Run** executes it, and **Insert** places it at the prompt so you can edit it before running it. - **Quick Chat** is a light panel at the top of the editor window for a short question. It supports the same `#` and `@` mentions as the Chat view, and **Open in Chat view** carries the conversation into a full session. ## Choosing in practice 1. The change concerns one block or file in front of you, and you want to review it as a diff: use **editor inline chat**. 2. You need a shell command: use **terminal inline chat**. 3. You have a one-off question and do not want to leave what you are doing: use **Quick Chat**. 4. The work spans files, needs the codebase explored, or takes several steps: use the **Chat view**. When an inline edit turns out to need more than one file, it is usually better to move to the Chat view than to keep re-prompting inline chat.

  • What changes when you select a block of code before opening editor inline chat?
    The selection narrows the prompt to that block instead of the whole active editor, so "make this iterative" applies to the selected function. The result still arrives as an inline diff with Keep and Undo, and inline chat may still read other workspace files for context.
  • Which model does editor inline chat use, and how do you change it for good?
    It uses the model named in `inlineChat.defaultModel`. Picking a different model during an inline chat session lasts for the rest of that session, but after VS Code reloads it reverts to the setting. So a lasting change goes in `inlineChat.defaultModel`, not the picker.
  • What does terminal inline chat give you that the Chat view does not?
    It answers a shell question right in the integrated terminal with a command, and offers **Run** to execute it or **Insert** to put it at the prompt for editing first. You get the command without leaving the terminal or opening a session.

  • Inline chat sees only the selected lines and can never read another file.
  • Editor inline chat is the right place for a change spanning several files.
  • Inline chat writes its change straight to the file with no Keep or Undo step.
  • The inline chat shortcut always opens inline chat, whatever session the file belongs to.
  • Quick Chat cannot use # or @ mentions the way the Chat view can.
open as a page

Where does GitHub Copilot's repository-wide instructions file live, and how do you confirm Copilot actually used it?

level: juniorimportance: must knowfreq 22%

basics

~20 s

Copilot reads repository-wide instructions from .github/copilot-instructions.md at the repository root and adds them to every request made in that repository. In VS Code or GitHub.com chat, the file appears in the response's References list when it was sent.

open as a page

How do you accept, partially accept, cycle or dismiss GitHub Copilot ghost text in VS Code?

level: juniorimportance: must knowfreq 22%

basics

~20 s

Tab accepts the whole ghost-text suggestion and Esc dismisses it; Accept Next Word (Command+Right on macOS, Control+Right on Windows and Linux) takes one word, and Alt+] or Alt+[ (Option on macOS) cycles through alternative suggestions.

open as a page

What happens when you assign a GitHub issue to Copilot, and how do you change the task once Copilot cloud agent has started?

level: juniorimportance: must knowfreq 20%

basics

~20 s

Copilot cloud agent works in an ephemeral GitHub Actions-powered environment on a new copilot/ branch, opens a pull request and requests your review. It reads the issue only at assignment; send later changes as an @copilot comment on its pull request.

open as a page

In VS Code, what do Copilot's agent permission levels — Manual permissions, Assisted permissions and Allow all — each change, and which is the default?

level: middleimportance: must knowfreq 18%

basics

~20 s

Manual permissions, the default, runs only what your tool, URL and terminal approval settings already allow and asks about the rest; Assisted permissions lets an LLM judge approve calls; Allow all runs every tool call without asking.

open as a page

Your team wants one shared code-review persona in Copilot's VS Code agent picker — where does its custom agent file live, and what goes in it?

level: juniorimportance: should knowfreq 10%

basics

~10 s

A shared custom agent is a .agent.md file committed to the repository's .github/agents folder: YAML frontmatter sets its name, description, tools and optional model, and the Markdown body holds the reviewer's instructions.

open as a page

In VS Code's Copilot Chat, how do a / command like /explain, an @ participant like @terminal and a # mention like #codebase differ?

level: juniorimportance: should knowfreq 14%

basics

~20 s

A / command runs a task such as /explain or /tests, or a saved prompt. An @ participant hands the question to a domain specialist such as @vscode or @terminal. A # mention adds context or a tool, such as #codebase.

open as a page

In VS Code, how do you configure chat.tools.terminal.autoApprove so Copilot's agent runs your test command unprompted while git push still asks?

level: middleimportance: should knowfreq 8%

basics

~20 s

Add rules to chat.tools.terminal.autoApprove: a command or /regex/ set to true runs without a prompt, one set to false always asks. Rules match each subcommand, a false match wins, and a false rule asks rather than blocks.

open as a page

Why might Copilot Chat in VS Code answer a whole-repository question about only the open file, and what do #codebase and attached files change?

level: middleimportance: should knowfreq 12%

basics

~20 s

Chat sends the active file and selection implicitly, and inline chat is scoped to the active editor, so a broad question can collapse onto one file. #codebase forces a workspace semantic search; #-mentioned files guarantee specific files are read.

open as a page

How do you write a VS Code Copilot prompt file that runs as /write-tests, and what do its agent and tools fields do?

level: middleimportance: should knowfreq 7%

basics

~10 s

Save .github/prompts/write-tests.prompt.md with optional YAML frontmatter and a Markdown body, then type /write-tests in chat. agent picks ask, agent, plan or a custom agent; tools limits which tools the prompt may use.

open as a page

Which AGENTS.md does GitHub Copilot use in a monorepo with one per service folder, and do all Copilot surfaces read them?

level: middleimportance: should knowfreq 10%

basics

~20 s

GitHub's docs say the nearest AGENTS.md in the directory tree takes precedence while Copilot works. Support varies: the cloud agent and Copilot CLI read agent files, VS Code reads subfolder files only with chat.useNestedAgentsMdFiles, and Copilot Chat on GitHub.com reads none.

open as a page

How do you write a GitHub Copilot path-specific .instructions.md file with applyTo, and when does Copilot include it?

level: middleimportance: should knowfreq 12%

basics

~10 s

Create .github/instructions/NAME.instructions.md with YAML frontmatter whose applyTo holds one or more comma-separated globs. Copilot adds it, alongside the repository-wide file, when the file it is working on matches.

open as a page

How do GitHub Copilot's next edit suggestions in VS Code carry a rename's follow-on edits, and which settings control them?

level: middleimportance: should knowfreq 12%

basics

~20 s

Next edit suggestions (NES) predict both where your next edit goes and what it is, from the edits you just made. A gutter arrow marks it, Tab jumps there and Tab again accepts; github.copilot.nextEditSuggestions.enabled is the switch.

open as a page

GitHub Copilot ghost text in VS Code keeps proposing a library your project does not use — which documented levers steer it back?

level: middleimportance: should knowfreq 9%

basics

~20 s

Copilot builds ghost text from the current file and open tabs, so fix the editor: add the real import, open files using the right library, close unrelated ones, add a top comment or sample. Instruction files do not reach it.

open as a page

How do you get Copilot code review on every pull request in a repository, and does its review count toward required approvals?

level: middleimportance: should knowfreq 14%

basics

~20 s

Add a branch ruleset with Automatically request Copilot code review, optionally with Review new pushes. Copilot then leaves a Comment review, which does not count toward required approvals unless Copilot approvals (public preview, off by default) are enabled.

open as a page

Copilot cloud agent pushed commits to its pull request, but none of the repository's GitHub Actions workflows ran. Why, and what changes that?

level: middleimportance: should knowfreq 9%

basics

~20 s

By default, workflows do not run on Copilot cloud agent's pushes until a user with write access reviews the changes and clicks Approve and run workflows. An administrator can turn off Require approval for workflow runs, letting unreviewed code run.

open as a page

A Copilot agent session in VS Code set to Allow all ran a cleanup script that deleted files in your home directory — which VS Code control would have contained it?

level: seniorimportance: should knowfreq 7%

basics

~20 s

VS Code's agent sandboxing for terminal commands. It is off by default and independent of the permission level, so once enabled it still confines commands under Allow all, limiting writes to the working directory and blocking sensitive home-directory paths.

open as a page

When personal, repository and organization GitHub Copilot instructions conflict, which takes precedence, and why can the losing rule still show up?

level: seniorimportance: should knowfreq 5%

basics

~10 s

GitHub ranks personal instructions highest, then repository (path-specific, repository-wide, agent), then organization. All relevant sets are still sent to Copilot, so a lower-ranked rule can still influence the answer.

open as a page

Copilot code review keeps applying your frontend style guide to Go files — which Copilot instruction files explain it, and how do you scope the guide?

level: seniorimportance: should knowfreq 8%

basics

~10 s

On GitHub.com, Copilot code review sends the repository-wide file and any agent files (AGENTS.md, CLAUDE.md, GEMINI.md, REVIEW.md) with every review. Move the guide into a path-specific .instructions.md whose applyTo matches only frontend files.

open as a page

A VS Code user gets GitHub Copilot ghost text in TypeScript but none in Markdown or in some repository files — which settings and policies explain it?

level: seniorimportance: should knowfreq 7%

basics

~20 s

Check the switches in order: github.copilot.enable turns ghost text off for markdown, plaintext and scminput by default; a content exclusion blanks specific files and strikes through the status-bar icon; Snooze or a metered connection pauses automatic suggestions.

open as a page

In GitHub Copilot CLI, how do `--available-tools` and `--allow-tool` differ, and how would a `copilot -p` run commit but never push?

level: seniorimportance: should knowfreq 6%

basics

~10 s

--available-tools limits which tools the model can use at all; --allow-tool lets named tools run without prompting. For commit-but-never-push, pass --allow-tool='shell(git:*)' with --deny-tool='shell(git push)'; deny rules always win.

open as a page

A lead wants Copilot cloud agent to take backlog issues in a repository whose main branch requires one approval. What keeps its work from merging unreviewed?

level: seniorimportance: should knowfreq 8%

basics

~20 s

Copilot cloud agent cannot mark its pull request ready, approve or merge it, and the person who asked cannot approve it, so another reviewer must. It obeys branch protections, and unattributed pull requests need one extra approval.

open as a page

In VS Code, after you approve a plan from Copilot's Plan agent, which actions will the agent still stop to ask you about while implementing it?

level: middleimportance: nice to knowfreq 5%

basics

~20 s

Approving a plan only starts implementation; it approves no tool calls. File edits, terminal commands and external tool calls still follow the session's permission level and approval settings, unless you start with an Autopilot option.

open as a page

In VS Code, how does Copilot build the semantic index behind #codebase, and what keeps a file out of that index?

level: middleimportance: nice to knowfreq 4%

basics

~10 s

Copilot maintains the index automatically: GitHub indexes GitHub-hosted repositories, Azure DevOps repositories are indexed too, and other workspaces are indexed by Copilot. Files matched by .gitignore or files.exclude, and binaries, stay out.

open as a page

What does GitHub Copilot's Change Completions Model command in VS Code change, and what does it leave untouched?

level: middleimportance: nice to knowfreq 4%

basics

~20 s

Change Completions Model swaps the model behind Copilot's ghost text only; next edit suggestions and Copilot Chat keep their own models, and data policy and the public-code-matching setting are unchanged. Business and Enterprise seats need the Editor preview features policy.

open as a page

In VS Code, a team's .vscode/mcp.json holds a remote MCP server needing sign-in and a local one using an ${input:...} key; why are both missing from Copilot-harness agent sessions?

level: seniorimportance: nice to knowfreq 3%

basics

~10 s

Copilot-harness sessions run on the Agent Host, which currently reaches only local MCP servers that need no authentication, and VS Code does not forward .vscode/mcp.json servers that need interactive input such as ${input:...} variables.

open as a page

In VS Code, a team's /write-tests prompt file works in Local agent sessions but is missing from Copilot sessions — why, and how do you migrate it?

level: seniorimportance: nice to knowfreq 4%

basics

~20 s

Copilot sessions run in VS Code's Agent Host, which does not load prompt files; only the Local agent still does, and it will be removed. Convert the file to an agent skill with Migrate Prompt Files in the Agent Customizations editor.

open as a page

Copilot cloud agent keeps failing to install packages from your internal registry; how do copilot-setup-steps.yml and the agent firewall fix its environment?

level: seniorimportance: nice to knowfreq 5%

basics

~10 s

A .github/workflows/copilot-setup-steps.yml with one copilot-setup-steps job installs dependencies before Copilot cloud agent starts, using an Agents secret for the token. Add the registry to the firewall's custom allowlist for installs the agent runs itself.

open as a page