AnyLearn
All lessons
Programmingintermediate

GitHub Copilot: Niche Power Features You Probably Aren't Using

You already let Copilot autocomplete your code. This lesson dives into the underused power features: chat participants, slash commands, Copilot Edits, agent mode, custom instructions, prompt files, the model picker, MCP servers, and Copilot Spaces.

Not signed in — your progress and quiz score won't be saved.
Lesson progress1 / 12

Past the autocomplete plateau

Most Copilot users plateau at "grey ghost text + occasional chat question." That's about 20% of the surface area. The 80% you're missing lives behind chat participants (@workspace, @terminal, @vscode, @github), slash commands (/fix, /tests, /explain, /doc), the multi-file Copilot Edits mode, agent mode with tool calling, repository-level custom instructions, reusable prompt files, the model picker, MCP servers, and Copilot Spaces on github.com.

The through-line is context. Plain autocomplete sees the current file. Everything else in this lesson is a different way to feed Copilot a bigger, better, more specific context: your whole workspace, your terminal history, your team conventions, a third-party database via MCP, a curated knowledge base on github.com. Same underlying model, dramatically different answers.

By the end you should be able to point at three features you'll wire into your daily loop tomorrow.

Full lesson text

All 12 steps on one page — for reading, reference, and search.

Show

1. Past the autocomplete plateau

Most Copilot users plateau at "grey ghost text + occasional chat question." That's about 20% of the surface area. The 80% you're missing lives behind chat participants (@workspace, @terminal, @vscode, @github), slash commands (/fix, /tests, /explain, /doc), the multi-file Copilot Edits mode, agent mode with tool calling, repository-level custom instructions, reusable prompt files, the model picker, MCP servers, and Copilot Spaces on github.com.

The through-line is context. Plain autocomplete sees the current file. Everything else in this lesson is a different way to feed Copilot a bigger, better, more specific context: your whole workspace, your terminal history, your team conventions, a third-party database via MCP, a curated knowledge base on github.com. Same underlying model, dramatically different answers.

By the end you should be able to point at three features you'll wire into your daily loop tomorrow.

2. Chat participants are domain experts

Typing @ in the chat input pops a list of participants — each is a specialized agent with its own context and tools. The built-ins ship with VS Code:

  • @workspace — indexes your entire open workspace. Use for "where is the auth middleware?" or "how is User constructed across files?"
  • @vscode — knows VS Code commands and settings. "How do I disable minimap?" gets you the right command palette entry.
  • @terminal — sees your integrated terminal buffer. "Why did that last command fail?" reads the actual stderr.
  • @github — talks to github.com: issues, PRs, code search across public repos.

Third-party extensions register their own. After installing the MongoDB or Stripe extension, @mongodb and @stripe appear in the same picker and can answer using their own docs and APIs.

The trap: without a participant, generic chat only sees the currently open file. @workspace where do we validate JWTs? is a different question than where do we validate JWTs? with no prefix — the second one is just guessing.

3. Slash commands: shortcut prompts you should memorize

Slash commands are pre-baked prompts that scope chat to a specific job. Type / in the chat box for the live list. The high-value ones:

  • /explain — explain the selected code or terminal output
  • /fix — propose a fix for a diagnostic, error, or selected block
  • /tests — generate unit tests for the selection (uses your project's test framework if it can detect it)
  • /doc — write a doc comment for the function or class under the cursor
  • /new — scaffold a new project or file from a description (/new Express API with Postgres and Zod)
  • /clear — wipe the chat history when context starts to drift

They compose with participants: @workspace /tests for the function I just added in auth.ts is two filters in one prompt. The exact list depends on your IDE — VS Code, Visual Studio, and JetBrains overlap heavily but not perfectly. When in doubt, just type / and look.

4. Copilot Edits: multi-file refactors with a working set

Inline chat (Ctrl+I / Cmd+I) edits one file. Copilot Edits edits many. Open it from the Chat menu → "Open Copilot Edits." The key concept is the Working Set: an explicit list of files Copilot is allowed to touch. Drag tabs in, or #filename in the prompt to add them. Anything not in the set is off-limits.

A typical flow:

  1. Add userService.ts, userController.ts, userRepo.ts to the working set.
  2. Prompt: "Rename email to emailAddress everywhere, including the Zod schema."
  3. Copilot proposes a diff per file. You hit the per-file Accept or Discard buttons.
  4. Follow up: "Also update the DB migration." It iterates inside the same set.

This is the right tool for cross-cutting changes that would otherwise need a regex search-and-replace plus manual cleanup: renames, extracting an interface, swapping a logger, migrating from axios to fetch. Inline chat can't see across files; agent mode is overkill for a known scope.

5. Agent mode: Copilot drives the IDE

Agent mode (GA in VS Code 1.99 in 2025) is a step beyond Edits: Copilot picks files, runs commands, reads test output, and iterates until the task is done. You stay in the loop by approving each terminal command and reviewing each diff.

It's the right tool when you don't know which files need to change. Example prompt:

Add a /health endpoint that returns DB status. Wire it into the Express app, write a Vitest spec, and run the tests.

Under the hood the agent: searches the workspace, opens likely files, proposes edits, runs npm test, reads failures, fixes them. It can call MCP tools (next steps) and any third-party tools your org allows.

Guardrails: terminal commands prompt you by default; you can set an allow-list (git status, npm test) so safe commands run unattended. Stop the agent any time with the Stop button — there's no "are you sure" — partial diffs stay in the editor for you to keep or discard.

6. Custom instructions: teach Copilot your conventions

Custom instructions are the single biggest free quality win, and almost nobody sets them up. Drop a Markdown file at the repo root and Copilot Chat, Edits, agent mode, and PR code review all read it on every request.

<!-- .github/copilot-instructions.md -->
# Project conventions

- TypeScript strict, no `any`. Prefer `unknown` + narrowing.
- Validate all external input with Zod. Schemas live in `lib/schemas/`.
- Errors: throw typed `AppError` (see `lib/errors.ts`). Never `throw new Error("...")`.
- Tests: Vitest. Co-locate as `*.test.ts`. Use `describe`/`it`, never `test()`.
- DB: Drizzle ORM. No raw SQL except in migrations.
- Style: 2-space indent, single quotes, no semicolons. Prettier handles it.

Path-scoped rules go in .github/instructions/*.instructions.md with applyTo: frontmatter so React-only rules don't pollute the Python service. User-level instructions live in your VS Code settings and apply across every repo — perfect for "write commit messages in imperative mood" — without polluting team configs.

7. Prompt files: reusable, parameterized chat macros

Prompt files are the cousin of custom instructions: instead of always-on rules, they're named, invocable templates. Store them as .github/prompts/<name>.prompt.md. Invoke from chat with /.

---
mode: agent
description: Add an Express endpoint with Zod validation and a Vitest spec
---

Add a new endpoint `${input:method:GET} ${input:path}` to `src/routes/`.

Requirements:
- Validate the request body with a Zod schema in `lib/schemas/`.
- Use the typed `AppError` from `lib/errors.ts` for failures.
- Co-locate a Vitest spec with at least one happy path and one 400 case.
- Wire the route into `src/app.ts`.

Typing /new-endpoint in chat now triggers that whole workflow with input prompts for method and path. Use this for any task you do more than twice — a bug-report triage prompt, a "convert this fixture to a factory" prompt, a release-notes prompt. They turn tribal workflows into something a new hire can run on day one.

8. Where each surface lives

Different modes have different scopes. Pick the one that matches your task.

flowchart LR
  A["You"] --> B["Inline Chat (Ctrl+I)"]
  A --> C["Chat (sidebar)"]
  A --> D["Copilot Edits"]
  A --> E["Agent Mode"]
  B --> F["Current file"]
  C --> G["Participants + slash commands"]
  D --> H["Working Set (multi-file)"]
  E --> I["Workspace + tools + terminal"]
  G --> J["@workspace /tests"]
  H --> K["Per-file accept or discard"]
  I --> L["MCP servers"]
  I --> M["Run tests + read output"]

9. The model picker — and why it matters

The model dropdown in Copilot Chat / Edits / agent mode is not cosmetic. Different models behave very differently for code tasks. As of 2026 the picker for Pro and Pro+ subscribers includes (lineup shifts every few months):

  • Auto — Copilot routes for you. Sensible default for casual chat.
  • GPT-5 / GPT-5 mini / GPT-4.1 — OpenAI family. GPT-5.1-Codex-Max is the heavyweight for agent runs.
  • Claude Sonnet 4.5 / Claude Opus 4.5 / Claude Haiku 4.5 — Anthropic. Strong on long refactors, careful diffs, instruction-following.
  • Gemini 2.5 Pro — Google. Massive context window.
  • Grok Code Fast 1 — xAI. Speed-tuned.

A rough heuristic: use a fast model (Haiku, GPT-5 mini, Grok Code Fast) for inline chat and autocomplete, and a deep model (Opus, GPT-5.1-Codex-Max, Sonnet) for agent mode where a single bad decision costs ten tool calls. Premium request budgets apply — agent runs on Opus burn quota fast.

10. MCP servers: plug external tools into Copilot

Model Context Protocol (GA in VS Code 1.102, July 2025) is an open standard for letting an AI call external tools. In Copilot's agent mode, MCP servers expose functions like "query Postgres," "open a Sentry issue," "fetch a Figma frame," or "run a Playwright test." The agent decides when to call them.

Configure in .vscode/mcp.json:

{
  "servers": {
    "github": {
      "type": "http",
      "url": "https://api.githubcopilot.com/mcp/"
    },
    "postgres": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-postgres", "${env:DATABASE_URL}"]
    }
  }
}

Gotchas: MCP tools only run in agent mode, not in regular chat. Enterprise admins gate access via the "MCP servers in Copilot" policy, which is off by default. Start with the official github MCP server — it lets the agent open issues and PRs from chat, which combined with custom instructions gives you a credible junior teammate.

11. Copilot Spaces and the rest of the iceberg

Copilot Spaces (github.com/copilot/spaces) replaced the older "knowledge bases" in late 2025. A Space is a curated bundle of repos, docs, files, and custom instructions that you can ask questions of from the github.com chat. Spin one up for your design system, your runbooks, or onboarding docs — share it with the team, and every member gets the same grounded answers. GitHub-sourced content stays in sync automatically.

A quick tour of features still worth knowing:

  • Next Edit Suggestions (NES) — after you make an edit, Copilot predicts the next edit and shows a gutter arrow. Press Tab to walk through. Great for renames and stylistic propagation.
  • Copilot CLI (gh copilot suggest, gh copilot explain) — terminal-level help; the older gh-copilot extension is deprecated in favor of the new standalone Copilot CLI agent.
  • PR code review — request @copilot as a reviewer on a PR; with agentic preview features it can apply its own fixes as a stacked PR.
  • Content exclusions — repo and org admins can block paths (e.g. secrets/**) from any Copilot processing.
  • Commit message and PR description generation — the sparkle icons in the Source Control and PR panels.

12. Putting it together: one realistic loop

A 30-minute task that uses six of these features:

  1. Custom instructions in .github/copilot-instructions.md define your stack, error type, and test framework — already loaded, no thought required.
  2. You hit Ctrl+Shift+I, open chat, switch the model picker to Claude Sonnet 4.5, and choose Agent mode.
  3. Prompt: "Add a /users/:id/avatar endpoint that uploads to S3. Use the schemas in lib/schemas/."
  4. The agent calls your MCP S3 server to check bucket policy, edits routes/users.ts and lib/s3.ts, then runs npm test and reads the failure.
  5. It patches the test, reruns, green.
  6. You hit the commit message sparkle. Copilot drafts feat(users): add avatar upload via S3. You tweak, commit, push.
  7. On the PR you request @copilot as a reviewer; Copilot code review flags a missing rate-limit check, you apply its suggested fix, merge.

None of this is magic, but none of it is plain autocomplete either. The compounding win is that each feature handles a different slice of context — and your job shifts from typing code to curating that context.

Check your understanding

The lesson ends with a 5-question quiz. Take it in the player above to see your score.

  1. You ask Copilot Chat "where do we validate JWTs?" in a 200-file repo and get a generic answer. Which prefix would most likely fix it?
    • @vscode
    • @workspace
    • @terminal
    • /explain
  2. What is the Working Set in Copilot Edits?
    • The list of files Copilot is allowed to modify in this edit session
    • The folder Copilot uses to cache embeddings of your repo
    • A subset of the chat history that is replayed on every prompt
    • The list of MCP servers currently enabled for the agent
  3. You want every chat request in a repo to know that errors must be thrown as a typed `AppError`. Where does this rule belong?
    • A .prompt.md file under .github/prompts/
    • A pinned message at the top of every chat session
    • .github/copilot-instructions.md at the repository root
    • A custom MCP server that intercepts each request
  4. MCP tools (e.g. a Postgres MCP server) are available in which Copilot surface?
    • Inline ghost-text autocomplete
    • Regular Copilot Chat (no agent)
    • Copilot Edits with a Working Set
    • Agent mode
  5. You repeat the same multi-step task — scaffold an endpoint with a Zod schema and a Vitest spec — three times a week. What's the right Copilot feature to encode it?
    • A prompt file in .github/prompts/ invoked with a slash command
    • A longer custom-instructions.md file
    • A Copilot Space on github.com
    • A new chat participant via the extensions API

Related lessons

AI
advanced

Loop engineering: verification, orchestration, and anti-patterns

Make loops trustworthy. Adversarial verification panels, sub-agent orchestration, loop-until-dry for unbounded discovery, loop-until-budget for paid depth, multi-modal sweeps with diverse prompts, eval-driven cap selection, and the five anti-patterns — silent caps, infinite plans, drift, premature termination, thrashing — that ship to prod more than they should.

9 steps·~14 min
AI
intermediate

Loop engineering in production: state, errors, and budgets

Once an agent loop runs past a few iterations the failure surface shifts: state bloats, tool calls fail in three distinct ways, retries multiply if you stack them wrong, and unbounded budgets rack up four-figure bills overnight. The state, errors, and budgets you need to make the loop survive contact with reality.

8 steps·~12 min
AI
beginner

Loop engineering basics: the agent control loop

How LLM agents actually run: the iterative prompt-action-observation loop, the ReAct shape, the smallest tool-calling loop in twelve lines, why you always stack three termination layers, what the model sees on iteration N, and when a single prompt is the better answer.

8 steps·~12 min
AI
intermediate

LLM Observability with OpenTelemetry: GenAI Semantic Conventions

Master the OTel GenAI semantic conventions — gen_ai.* attributes, span structure for prompts/completions/tools, sampling strategies, and cost attribution — and understand why standardizing across LangSmith, Phoenix, Datadog, and Grafana matters for production AI systems.

13 steps·~20 min·audio