Inline Suggestions, Chat, Edit and Agent Mode
30-second answer
You trigger GitHub Copilot in four main ways. Inline suggestions appear as grey ghost text while you type (Tab accepts, Esc dismisses, Alt+] shows the next one). Inline chat (Ctrl+I) changes the code in front of you. The Chat view (Ctrl+Alt+I) has three modes: Ask answers without editing, Edit changes the files you pick for you to Keep or Undo, and Agent plans, edits, runs commands after your approval and iterates until the task is done. In the terminal, Copilot CLI does the same agent work.
Simulate it » No Azure account neededExam objective: 2.1.2 Trigger Copilot through inline suggestions, chat, CLI, and agent mode. (Skills measured as of August 7, 2026)
Simulations
Feel it before you read it. No account needed, nothing leaves this page.
Start typing and pause: Copilot shows a <strong>ghost text</strong> suggestion. <strong>Tab</strong> accepts it all, <strong>Ctrl+→</strong> accepts one word, <strong>Alt+]</strong> shows the next alternative, <strong>Esc</strong> dismisses.
👆 Click the glowing item on screen to continue
Read the steps as text
- Start typing and pause: Copilot shows a ghost text suggestion. Tab accepts it all, Ctrl+→ accepts one word, Alt+] shows the next alternative, Esc dismisses.
- Press Ctrl+I for inline chat right in the editor. Describe the change for the selected code.
- Copilot shows the change in place. Accept keeps it, Discard throws it away.
- Open the Chat view (Ctrl+Alt+I) for longer conversations. The mode picker switches between Ask (answers), Edit (changes files you choose) and Agent (does the whole task).
- In Agent mode the same request makes Copilot find the files, edit them, run the tests and report back. Next edit suggestions (NES) also predict your next edit as you work.
🧪 Simulation for learning. Screens are simplified versions of Visual Studio Code and github.com with GitHub Copilot; names, files and suggestions are examples. Not affiliated with GitHub or Microsoft, and nothing here touches your real account.
🖱️ Drag to rotate · scroll or pinch to zoom
Ask mode
Ask answers questions about code and concepts and can suggest code blocks. It doesn’t change your files by itself.
🤔 What happens if…
Read this tour as text
- Ask mode. Ask answers questions about code and concepts and can suggest code blocks. It doesn’t change your files by itself.
- Edit mode (Copilot Edits). Edit applies changes to the files you choose, across several files at once. You see each diff and Keep or Undo it.
- Agent mode. Agent works out which files to touch, edits them, runs commands and tests, reads errors and keeps going until the task is done. It asks before running terminal commands unless you’ve approved them.
- MCP servers add tools. The Model Context Protocol (MCP) lets Copilot use external tools: the GitHub MCP server, a browser, a docs search or your own API. Configure servers in
.vscode/mcp.json(VS Code) or with/mcp(CLI). Organizations can restrict which servers are allowed. - Sessions and sub-agents. Long tasks fill the context window. Agent sessions keep work separate, and a sub-agent can do a side task in its own context and hand back only a summary.
- Copilot coding agent. Assign an issue to Copilot on github.com (or
/delegatefrom the CLI). The coding agent works in a GitHub Actions environment on its own branch and opens a draft pull request with its changes. - Review stays human. You review the agent’s PR like any other. Copilot code review can comment and suggest changes, but its review doesn’t count as an approval. A person merges.
- Copilot CLI. The same agent in the terminal:
copilotfor a session with slash commands,copilot -p "…"for one prompt, and--allow-tool/--deny-toolto control what it may run.
Give Copilot more reach. Look at the built-in GitHub MCP server, add a docs server, let Copilot call a tool to read your issues, then hand a bigger task to Copilot coding agent so it opens a pull request.
🎓 Education-only simulation. Your lab is saved in this browser, so you can leave and continue later.
😟 THE PROBLEM
You only ever use ghost text and wonder why Copilot can’t do more.
😊 THE SOLUTION
Use the right surface: inline, inline chat, or the Chat view in Ask, Edit or Agent mode.
- Typing boilerplate✓ Inline suggestions
- A change across files✓ Edit mode
- A whole task with tests✓ Agent mode
Start with a question
If a helper sits next to you while you cook, do you want them to hand you the salt, answer a question, or cook the whole dish?
It depends on the moment. Sometimes you only want the salt passed before you reach for it. Sometimes you want to ask “is this oil hot enough?”. And some evenings you’d happily say “make dinner, and tell me before you turn the oven on”.
GitHub Copilot works the same way. Inline suggestions pass you the next line before you ask. Ask mode answers your question. Edit mode changes the files you point at. Agent mode takes the whole task and asks before it runs anything in your terminal.
Explain it like I’m 10
The technical explanation
Inline suggestions (ghost text)
When you pause while typing, the Copilot extension sends the code around your cursor as context and shows the reply as grey ghost text. Nothing goes into your file until you accept it.
| Action | Windows / Linux | macOS |
|---|---|---|
| Accept the whole suggestion | Tab | Tab |
| Dismiss it | Esc | Esc |
| Next / previous alternative | Alt+] / Alt+[ | Option+] / Option+[ |
| Accept the next word only | Ctrl+Right Arrow | Cmd+Right Arrow |
| Open the completions panel (several options) | Ctrl+Enter | Ctrl+Enter |
Say you type the start of a function in src/discount.js:
export function applyDiscount(total, code) {
// ghost text appears here:
const pct = CODES[code] ?? 0;
return Math.max(0, total - (total * pct) / 100);
}
Writing a clear function name and a short comment first gives Copilot much better context than an empty file.
Next edit suggestions (NES) go a step further. Rename a parameter on line 3, and Copilot predicts the matching edit on line 9 and offers it. You jump to it and press Tab.
To turn completions off for one language, set github.copilot.enable in your settings, for example { "*": true, "markdown": false }. The Copilot icon in the status bar also lets you snooze suggestions.
Inline chat (Ctrl+I)
Select some code, press Ctrl+I and type what you want: “make unknown codes return the total unchanged”. Copilot shows the change as a diff in place. Accept keeps it, Discard throws it away. Use it for small, local changes where opening a full chat would be overkill.
The Chat view and its three modes
Open the Chat view with Ctrl+Alt+I. A picker at the bottom switches the mode.
Ask
Answers
- Explains code and concepts
- Suggests code blocks you can insert
- Doesn't edit files on its own
Edit
Copilot Edits
- Changes the files you add to the working set
- Several files in one go
- You Keep or Undo each diff
Agent
Does the task
- Finds the files itself
- Runs terminal commands after you approve
- Reads errors and test output, then iterates
- Can call MCP tools
Here’s the same request in each mode: “Add a FREE code that gives 100% off, with tests.”
- Ask explains how you’d do it and shows code. You copy what you want.
- Edit changes
src/discount.jsandtests/discount.test.jsif you added them, and waits for Keep or Undo. - Agent searches the codebase, edits both files, asks to run
npm test, reads the result and fixes a failure before reporting back.
-
1 Plan
Reads the request and searches the codebase for the right files.
-
2 Edit
Changes the files and shows each diff.
-
3 Run
Asks before running npm test or any other terminal command.
-
4 Iterate
Reads the output, fixes failures and runs again.
-
5 Report
Summarises what changed. You Keep or Undo.
Agent mode is covered properly, with MCP tools and sub-agents, in its own lesson.
Outside VS Code
Visual Studio, JetBrains IDEs, Xcode, Eclipse and Vim/Neovim all have Copilot extensions with inline suggestions, and most have chat. Feature names and shortcuts differ a little, so check the docs for your editor. In the terminal, Copilot CLI (the copilot command) gives you an agent that reads your repo, edits files and runs commands with your permission. On github.com you can assign an issue to the Copilot coding agent, which opens a draft pull request.
Architect level Why suggestions change when you open other tabs
Inline suggestions don’t only look at the current file. The extension also pulls snippets from other open tabs and neighbouring files to build the prompt, then trims it to fit the model’s context window. That’s why a test file open next to your code gives better suggestions, and why ten unrelated tabs can make them worse. Chat works differently: it uses the active file, your selection and whatever you add with #file, #codebase or a participant such as @workspace. Agent mode searches the workspace on its own. If a file is covered by a content exclusion, Copilot won’t use it as context or suggest inside it in supported IDEs.
Real-world business scenario
Contoso (fictional)
- The problem
- Contoso's shop team turned on Copilot and everyone used Agent mode for everything. Simple questions about the cart code produced surprise edits, and reviewers were tired of undoing changes nobody had asked for.
- What they used
- A short team guide: inline suggestions and Ctrl+I for small changes, Ask mode to understand code, Edit mode for planned multi-file changes, and Agent mode for whole tasks with tests, with commands approved once rather than for the session.
- Why that choice
- Each surface matches how much control the developer wants to hand over, so changes only happen when someone meant them to.
- The result
- Unwanted edits in pull requests dropped, and new joiners used Ask mode to learn the codebase without touching it.
When to use it and when not to
✓ Use it when…
- Inline suggestions for boilerplate, repetitive code and the next line you were about to type.
- Ask mode to understand unfamiliar code or compare approaches before changing anything.
- Edit mode when you know exactly which files should change.
- Agent mode for a whole task that needs searching, edits, commands and a few rounds of fixing.
✕ Think twice when…
- Accepting long suggestions without reading them. They can be wrong, outdated or insecure.
- Agent mode for a quick question. It may start changing files.
- Approving every command for the session on a repository you don't know well.
↔ Alternatives to consider
- Copilot CLI when you live in the terminal or want to script a prompt.
- Copilot coding agent on github.com to hand off an issue and get a draft pull request back.
Test yourself with exercises
5 original practice questions in the GH-300 style. Pick your answers, then check them. You will see why each option is right or wrong. Score 75% or more and this topic is marked complete.
Interview preparation
Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.
Beginner How do you accept only part of an inline suggestion?
Model answer
I press Ctrl plus Right Arrow to take the next word, and keep pressing it until I have what I want. Tab takes the whole thing. If none of the options fit, Alt plus right bracket cycles to the next suggestion, or I open the completions panel with Ctrl plus Enter.
Interviewer follows up
And if you don't want suggestions at all in Markdown files?
You
I set github.copilot.enable to false for markdown in my settings. Completions stay on for every other language.
Intermediate When would you pick Edit mode over Agent mode?
Model answer
When I already know which files need to change and want tight control. Edit only touches the files I add and shows me each diff. Agent decides which files to open, runs commands and loops, which is great for a whole task but more than I need for a rename across three files.
Experienced developer A teammate says agent mode ran a command they didn't expect. How do you explain what happened?
Model answer
Agent mode asks before it runs a terminal command, but you can approve a command for the session, and after that it won't ask again for that command in that session. I'd check what they approved, remind them that Allow once is the safer default, and review the chat log, which lists every tool call and command it ran.
Scenario A developer wants to understand a legacy file without risking any change to it. Which Copilot surface do you recommend?
Model answer
Ask mode in the Chat view, with the file added as context. Ask explains and suggests code blocks but never edits files on its own, so there's nothing to undo.
Quick revision
Key points
- Inline suggestions: Tab accept, Esc dismiss, Alt+] / Alt+[ next and previous (Option on macOS), Ctrl+Right Arrow next word, Ctrl+Enter completions panel.
- Next edit suggestions (NES) predict your next edit, not only the next characters.
- Inline chat is Ctrl+I and changes code in place; the Chat view is Ctrl+Alt+I.
- Ask answers, Edit changes the files you choose, Agent does the whole task and runs commands after approval.
- github.copilot.enable turns completions on or off per language.
- Copilot CLI brings agent-style work to the terminal with the copilot command.
Important terminology
- Inline suggestion
- Grey ghost text Copilot shows at the cursor as you type. Tab accepts it, Esc dismisses it.
- Next edit suggestions (NES)
- Copilot predicts where your next edit will be and what it should be, based on the change you just made.
- Inline chat
- A small chat box opened with Ctrl+I inside the editor that changes the selected code in place.
- Ask mode
- Chat mode that answers questions and suggests code blocks but doesn't edit your files.
- Edit mode
- Chat mode (Copilot Edits) that applies changes across the files you choose and lets you Keep or Undo each diff.
- Agent mode
- Chat mode where Copilot picks the files, edits them, runs terminal commands after approval, reads the results and iterates.
Common mistakes
- Using Agent mode just to ask a question, when Ask would answer without touching files.
- Pressing Tab on a long suggestion without reading it.
- Thinking Edit mode can run tests. Running commands is Agent mode.
Exam tips
- "Answer only, no file changes" = Ask mode.
- "Change these three files and let me review each diff" = Edit mode.
- "Implement the feature, run the tests and fix failures" = Agent mode.
Five quick revision questions
-
1.Which key accepts a whole inline suggestion?Show
Tab
-
2.Which shortcut opens inline chat in VS Code?Show
Ctrl+I
-
3.Which chat mode can run terminal commands?Show
Agent mode
-
4.Which setting turns completions off for one language?Show
github.copilot.enable
-
5.What does Ctrl+Right Arrow do with a suggestion?Show
Accepts the next word only.
Official references
Finished this lesson? Tick it off. Your progress is saved in this browser.
Next up: Copilot Chat: Slash Commands, Participants and Limits
Lesson done? Make it stick with a quick gameSort It, Match the Pairs, Lightning Round and Who Am I? Earn XP and badges.