GitHub Copilot Skills · Agents · Copilot App · Local Models · MCP · CLI
The complete reference for GitHub Copilot as of July 2026 — covering every customisation surface from copilot-instructions.md to Agent Skills, custom agents, sub-agents, the standalone GitHub Copilot app, local/BYOK models, MCP servers, hooks, and the full Copilot CLI. Built with the awesome-copilot community collection as reference.
GitHub Copilot app reached GA (June 17) — a standalone desktop control plane with Canvases, Agent Merge, and parallel worktree sessions. Copilot moved to usage-based AI Credits billing (June 1), replacing premium requests, and added a new Max plan. Local models & BYOK shipped for Copilot CLI, VS Code, and JetBrains (Ollama, LM Studio, vLLM, Azure OpenAI, Anthropic, OpenAI-compatible endpoints). Built-in sub-agents (explore, task, code-review) now show per-session credit usage, and Autopilot lets agents run further with less check-in. Model lineup refreshed: Claude Sonnet 5, Claude Opus 4.8, GPT-5.5 / GPT-5.3-Codex, Gemini 3.1 Pro — with Gemini 2.5 Pro and Gemini 3 Flash retiring July 31, 2026.
What is GitHub Copilot?
GitHub Copilot has evolved from an autocomplete tool into a fully agentic development environment. It now combines AI code completion, multi-turn chat, multi-file editing, autonomous coding agents, and deep integrations with your development tools — all powered by a choice of leading AI models.
Interfaces
Standalone desktop app (Win/macOS/Linux) — Canvases, parallel worktree sessions, Agent Merge, BYOM. See §5.
Primary IDE. Agent mode, MCP, skills, custom agents, hooks, Autopilot, Copilot Vision (GA), browser tools (GA).
Agent mode + MCP + local sandboxing (preview). Expanded BYOK with custom OpenAI-compatible endpoints.
Full agentic terminal experience. GA Feb 2026. Skills, agents, plugins, hooks, /delegate, BYOK & local models.
Assigns GitHub issues to Copilot. Creates draft PRs. Works in background asynchronously. Model picker (Claude/GPT).
Chat, PR review, live notifications for remote CLI sessions, start cloud agent from a PR's merge box.
Copilot on github.com — agents panel, PR review, model selection for Copilot/Claude/Codex cloud agents.
Plans & AI Credits
On June 1, 2026 GitHub retired premium-request quotas in favor of GitHub AI Credits — usage-based billing where every chat, agent, CLI, and code-review interaction is metered by input/output/cached tokens. 1 AI Credit = $0.01. Code completions and Next Edit Suggestions stay unlimited and credit-free on every paid plan.
| Plan | Price | Included AI Credits | Key Features |
|---|---|---|---|
| Free | $0 | Small monthly allowance | 2,000 completions/mo, limited chat/agent credits, auto model selection |
| Pro | $10/mo | 1,500 ($15) — 1,000 base + 500 flex | Unlimited completions, cloud agent, CLI, BYOK |
| Pro+ | $39/mo | 7,000 ($70) | Full model lineup incl. Opus/GPT-5.5, priority features |
| Max New | $100/mo | 20,000 ($200) | Built for sustained agent workloads; earliest access to new models |
| Business | $19/user/mo | 1,900/user (promo 3,000 thru Sep 1) | Org policies, IP indemnity, audit logs, pooled credit budgets |
| Enterprise | $39/user/mo | 3,900/user (promo 7,000 thru Sep 1) | Org instructions, fine-tuning, knowledge bases, SAML SSO |
Model Lineup
| Model | Provider | Notes |
|---|---|---|
| GPT-5 mini | Low cost | Included tier default for lightweight chat and completions |
| Claude Sonnet 5 New Jun 30 | Anthropic | 1M context. Promo pricing $2/$10 per 1M tok (in/out) through Aug 31, 2026. Community favorite for agent mode |
| Claude Opus 4.8 | Anthropic | Flagship reasoning + hardest debugging/architecture work; 1M context |
| Claude Sonnet 4.6 / Haiku 4.5 | Anthropic | Everyday balanced pick / fast low-cost tasks |
| GPT-5.5 | OpenAI | Flagship agentic-coding model, GA Apr 2026, replaced GPT-5.2 |
| GPT-5.3-Codex / GPT-5.4 | OpenAI | Code-specialized (400K ctx) and general-purpose reasoning options |
| Gemini 3.1 Pro | 1M context, strong value pick for very large multi-file context | |
| Gemini 3.5 Flash | Fast/cheap; replaces Gemini 3 Flash (retiring Jul 31, 2026) | |
| MAI-Code-1-Flash | Microsoft | Microsoft's in-house lightweight coding model, lowest cost tier |
| Auto | Smart | Copilot picks the best model for the task, cost, and availability |
Gemini 2.5 Pro and Gemini 3 Flash are removed from all Copilot surfaces on this date. Replacements: Gemini 3.1 Pro and Gemini 3.5 Flash. Enterprise admins must explicitly allow the replacements via model policies so they appear in Copilot Chat's model selector.
Each request's cost = tokens × the selected model's per-token rate (input, cached-input, output priced separately). Pricier flagship models burn credits faster than mini/flash tiers. Check live spend in VS Code's Copilot status dashboard — it now also breaks out sub-agent credit usage per delegated session. Additional credits beyond your plan allowance are billed at published per-token rates; admins can pool and cap spend per cost center.
Custom Instructions
Custom instructions let you provide Copilot with persistent context — coding standards, architecture patterns, tech stack, naming conventions — so you never have to repeat them in every chat prompt. Instructions are injected invisibly into each request.
copilot-instructions.md
The primary instruction file. Placed at .github/copilot-instructions.md. Applied to every Copilot request in the repository across VS Code, JetBrains, Copilot CLI, and the cloud agent.
# Project: E-Commerce Platform ## Stack - Backend: ASP.NET Core 8, C# 12, EF Core 8 - Frontend: React 18, TypeScript 5, Tailwind CSS 3 - Database: PostgreSQL 16, Redis 7 - Cloud: Azure (App Service, Blob Storage, Service Bus) ## Code Style - Use async/await throughout; never block threads - Prefer records over classes for DTOs - Use primary constructors (C# 12) for simple classes - All public APIs must have XML doc comments - No magic strings — use constants or enums ## Testing - Use xUnit for unit tests, Playwright for E2E - Test file mirrors source: `src/Foo.cs` → `tests/FooTests.cs` - Mock external dependencies; never hit real APIs in unit tests ## Git - Branch names: `feat/`, `fix/`, `chore/`, `docs/` - Commit format: Conventional Commits (feat: add X) - PRs require passing CI and one human approval
In VS Code, type /init in chat — Copilot analyzes your project and generates instructions. In the cloud agent, use the prompt: "Onboard this repository to Copilot by creating a .github/copilot-instructions.md file."
Path-Specific Instructions (.instructions.md)
Files named *.instructions.md in .github/instructions/ apply only when Copilot works on files matching the applyTo glob in the YAML frontmatter. Supported in VS Code, JetBrains, and the cloud agent.
--- applyTo: "src/ui/**/*.{tsx,jsx}" --- ## React Component Standards - Use functional components only; no class components - Props interface must be named `{ComponentName}Props` - Use `React.memo` for expensive pure components - Prefer `useCallback` for event handlers passed to children - All components must be exported as named exports - Use Tailwind utility classes; no inline styles
Path-specific instruction files support an excludeAgent frontmatter field alongside applyTo — lets you write a rule that applies everywhere except a named custom agent, so a QA-review agent, say, doesn't inherit implementation-style rules meant for the coding agent.
AGENTS.md — Open Standard
AGENTS.md is an open standard (Linux Foundation / Agentic AI Foundation) for guiding any AI coding agent — Copilot, Claude Code, Gemini CLI, etc. Copilot treats it as additional instructions alongside copilot-instructions.md.
| File | Scope | Agent support |
|---|---|---|
| AGENTS.md (root) | Primary — repo-wide | Copilot, Claude Code, Gemini CLI, any agent |
| AGENTS.md (subdirs) | Additional — folder-scoped | Same; treated as secondary instructions |
| CLAUDE.md | Repo root only | Claude Code, Copilot (reads it automatically) |
| GEMINI.md | Repo root only | Gemini CLI, Copilot |
| copilot-instructions.md | .github/ dir | Copilot only (all surfaces) |
| *.instructions.md | .github/instructions/ | Copilot (path-specific) |
# AGENTS.md — Guidance for AI Coding Agents ## Build & Test - Build: `dotnet build ./src` - Run tests: `dotnet test ./tests` - Lint: `dotnet format --verify-no-changes` - E2E: `npx playwright test` (requires running server on :5000) ## Important Rules - Never commit secrets or connection strings - Do not modify `*.lock` files manually - Run `dotnet format` before creating any PR - PRs must not decrease test coverage below 80% ## Architecture - Domain logic lives in `src/Domain/` - Never import Domain → Infrastructure (dependency rule) - Use the MediatR pattern for all commands/queries
Personal Instructions
Across all projects, create ~/.copilot/copilot-instructions.md for personal preferences (preferred language, verbosity, explanation style). Also set via COPILOT_CUSTOM_INSTRUCTIONS_DIRS env var to point to a folder of instruction files.
Organisation-Level Instructions
Copilot Enterprise supports instructions at the GitHub Organisation level — automatically applied to all repos in the org. Set by org owners; synced to VS Code via github.copilot.chat.organizationInstructions.enabled.
Prompt Files
Reusable prompts stored in .github/prompts/ as *.prompt.md — invoke them from chat with /prompt-name or attach them manually. Great for repetitive workflows like "explain this code" or "write tests".
--- mode: 'agent' description: 'Generate comprehensive xUnit tests for the selected code' --- Analyze the selected code and generate comprehensive xUnit tests: 1. Cover all public methods and their edge cases 2. Use `[Theory]` + `[InlineData]` for parameterized tests 3. Mock all external dependencies using Moq 4. Follow Arrange-Act-Assert pattern 5. Test file should be placed in `tests/` mirroring `src/` 6. Include at least one test for the unhappy path (exceptions) Reference our testing conventions from `.github/instructions/tests.instructions.md`.
Custom Chat Modes
Define a persona or specialized workflow mode in .github/chatmodes/*.chatmode.md. Users switch to it in the chat dropdown. A mode sets a system persona + tools available.
--- description: 'Senior DBA: database design, query optimization, index strategy' tools: - pgsql_connect - pgsql_query - github --- You are a Senior Database Administrator specializing in PostgreSQL 16. When reviewing queries: always check for missing indexes, N+1 problems, and missing pagination. Use EXPLAIN ANALYZE when you have database access. Prefer CTEs over subqueries for readability. Always consider connection pooling and transaction scope.
Agent Skills
Agent Skills (announced December 2025) are self-contained folders of instructions, scripts, and resources that Copilot loads when relevant to your task. Unlike custom instructions (which always apply), skills are loaded on-demand — keeping your context window efficient.
The Agent Skills spec is an open standard. Skills work across Copilot coding agent, Copilot CLI, and VS Code agent mode. If you already have skills in .claude/skills/ for Claude Code, Copilot picks them up automatically.
Use instructions for coding standards that apply to almost every task. Use skills for deep, specialized procedures (debugging CI failures, Terraform plan review) that Copilot should only load when needed.
Copilot matches your prompt to skills by reading each skill's name and description frontmatter. When triggered, it loads the full SKILL.md body. You can also invoke manually: /skill-name in chat.
Skill Directory Locations
| Location | Scope | Notes |
|---|---|---|
| .github/skills/<name>/ | Project (repo) | Checked into version control — shared with team |
| .claude/skills/<name>/ | Project | Claude Code compat — Copilot reads these too |
| .agents/skills/<name>/ | Project | Generic agents directory |
| ~/.copilot/skills/<name>/ | Personal | Shared across all projects on your machine |
| ~/.claude/skills/<name>/ | Personal | Claude compat — Copilot reads these too |
| ~/.agents/skills/<name>/ | Personal | Generic personal skills |
Creating a Skill
Make a folder under your chosen skills directory. Folder name becomes the skill identifier (use lowercase-with-hyphens).
Required fields: name and description. The description is what Copilot reads to decide if this skill is relevant.
Write detailed Markdown instructions. Reference other files in the skill directory using relative paths.
Scripts, templates, examples, checklists — anything Copilot should access as it follows the instructions.
.github/skills/github-actions-debugging/ ├── SKILL.md # Required — frontmatter + instructions ├── checklist.md # Referenced by SKILL.md └── examples/ ├── passing-run.log # Example for context └── failing-run.log # Example of common failure
--- name: github-actions-debugging description: | Guide for debugging failing GitHub Actions workflows. Use this when asked to debug failing GitHub Actions workflows, CI failures, or pipeline errors in pull requests. --- ## Debugging Failing GitHub Actions Workflows Use the GitHub MCP Server tools to investigate: 1. Use `list_workflow_runs` to find recent runs for the PR and their status 2. Use `get_workflow_run` to get details of the specific failing run 3. Use `list_workflow_run_logs` to retrieve the full job logs 4. Look for the first `Error:` or `FAILED` line — that's the root cause 5. Check `checklist.md` for common failure patterns ## Common Fixes - Missing secret → check repo Settings > Secrets - Cache invalidation → update cache key or clear manually - Outdated action version → pin to latest SHA - Flaky test → check test for async timing issues See `examples/` for reference logs.
SKILL.md Frontmatter Reference
| Field | Required | Description |
|---|---|---|
| name | Yes | Skill identifier (slug). Used for manual invocation /name |
| description | Yes | When Copilot should load this skill. Be specific — this is the trigger. |
| user-invocable | No | true (default) — appears in / menu. false — agent-only. |
| disable-model-invocation | No | true — prevents model from auto-loading; user must invoke manually. |
| tools | No | List of tool names this skill expects to use (hint to Copilot) |
| version | No | Semantic version string for tracking |
Copilot ranks skills for relevance largely on the description field. State WHAT the skill does, WHEN to use it, and the KEYWORDS a matching prompt would contain — in the fewest words possible. A bloated description doesn't just waste your own context budget; it crowds out visibility for every other skill Copilot has to rank against it.
Installing Community Skills
# Via GitHub CLI (gh v2.90.0+) gh skill install github/awesome-copilot <skill-name> # Via Copilot CLI copilot plugin install <plugin-name>@awesome-copilot # Register marketplace first (older Copilot CLI versions) copilot plugin marketplace add github/awesome-copilot copilot plugin install <plugin-name>@awesome-copilot # Or copy manually into your skills directory # cp -r path/to/skill ~/.copilot/skills/skill-name/
Popular Skills from awesome-copilot
| Skill | Purpose |
|---|---|
| github-actions-debugging | Debug failing CI pipelines using GitHub MCP tools |
| codebase-mapper | Map, document, and onboard into an existing codebase |
| lsp-setup | Install & configure LSP servers for code intelligence |
| git-workflow | Issues → branches → commits → PRs with correct conventions |
| copilot-instructions-generator | Generate copilot-instructions.md from codebase analysis |
| migration-blueprint | Create instructions for tech migrations / framework upgrades |
| agent-governance | Governance, safety, and trust controls for AI agents |
| educational-comments | Add educational comments explaining code to a file |
| azure-iac-export | Export Azure resources to Bicep/Terraform via Resource Graph |
| mcp-swift-server | Generate MCP server projects in Swift |
Skills can reference executable scripts. Copilot CLI has controls for auto-approve: allowlist specific scripts in your config. VS Code provides per-skill execution controls. Always review community skills before enabling script execution.
Custom Agents
Custom agents are specialized versions of Copilot for specific tasks. Each agent has its own persona, tools, MCP servers, and system instructions. Switch between agents in the chat interface or invoke via CLI.
Creating Custom Agents
--- name: accessibility-reviewer description: | Runtime accessibility specialist. Use for keyboard flows, focus management, dialog behavior, form errors, and evidence-backed WCAG 2.1 validation in the browser. tools: - playwright # browser automation for testing - github # create issues for violations mcp_servers: - playwright-mcp --- You are an expert accessibility engineer specializing in WCAG 2.1 AA. When reviewing code changes: 1. Use Playwright to navigate the page and test keyboard flows 2. Check: focus indicators visible, tab order logical, dialogs trap focus 3. Verify form errors are announced to screen readers (aria-live) 4. Validate color contrast meets 4.5:1 for normal text 5. Create GitHub issues for each WCAG violation found Report violations with: WCAG criterion, evidence (screenshot/code), fix.
--- name: dotnet-architect description: | Senior .NET architect for complex delivery: designs .NET 6+ systems, decides between parallel subagents and orchestrated team execution, documents lessons learned, and captures durable project memory. tools: - github - terminal - workspace --- You are a Senior .NET Architect with 15+ years experience. Specialise in: Clean Architecture, CQRS + MediatR, EF Core, Azure deployment, performance tuning, and distributed systems. When given a complex task: - Break into sub-tasks, identify which can run in parallel - Document architectural decisions with rationale - Capture lessons learned in `docs/adr/` as ADR files - Prefer boring technology over clever solutions
Custom Agent Frontmatter
| Field | Description |
|---|---|
| name | Agent identifier and display name |
| description | When to use this agent (shown in picker, used for routing) |
| tools | List of tools available to this agent (workspace, terminal, github, etc.) |
| mcp_servers | MCP servers this agent connects to |
| skills | Skills to always load for this agent |
| model | Preferred model for this agent (e.g., claude-sonnet-4) |
Copilot Cloud Agent (Coding Agent)
The cloud agent works asynchronously in the background — you assign a GitHub Issue to Copilot, and it researches, plans, writes code, pushes commits to a draft PR, and pings you for review. Available in GitHub.com, VS Code, CLI, and Mobile.
Go to any GitHub Issue → Assignees → select Copilot. Or use the Agents panel at github.com/copilot/agents.
Reads the issue, searches the codebase, builds an implementation plan. All steps are visible in the session log.
Copilot writes code, runs tests (if configured in AGENTS.md), and creates a draft PR. You're notified when ready.
Review the diff, leave PR comments for Copilot to address. Mark ready when satisfied — requires human approval before CI runs.
The cloud agent requires human approval before any CI/CD workflows run — a deliberate safety gate. It respects branch protections. PRs from the agent are labeled and identifiable. It only accesses the repository specified when the task starts (configurable with MCP).
Sub-Agents & Orchestration
Sub-agents are short-lived, narrowly-scoped agents that a parent session delegates work to — each running its own context window so the main conversation doesn't get cluttered with exploration noise or tool-call transcripts. Copilot CLI ships three built-in sub-agents out of the box:
| Built-in Sub-Agent | Purpose |
|---|---|
| explore | Fast, read-only codebase reconnaissance — answers questions without polluting the main session's context |
| task | Runs a bounded unit of work (tests, builds, scripted fixes) and iterates until it succeeds |
| code-review New | Independent second-pass review of a diff before it's presented — catches issues the implementing agent missed |
Since the June 2026 VS Code releases, sub-agent sessions show their own AI Credit usage in the status dashboard — so you can see exactly how much a delegated explore or task run cost, separate from the parent session. This matters because sub-agent calls add up fast in long, multi-delegation sessions.
If you've configured Copilot CLI to use a BYOK or local model provider (see §7 Local Models & BYOK), the built-in sub-agents automatically inherit that same provider — you don't configure them separately. Custom sub-agent definitions can also target additional working directories; the CLI correctly resolves relative links in custom agent instruction files even when a sub-agent operates outside the primary repo root.
Custom Orchestrator Pattern
--- name: pure-orchestrator description: | Pure orchestration agent. Decomposes requests, delegates ALL work to sub-agents, validates outcomes, and repeats until complete. --- You ONLY orchestrate. You NEVER write code yourself. For every request: 1. Analyze and decompose into discrete tasks 2. Identify which tasks can run in parallel 3. Delegate each to the appropriate specialist sub-agent: - `explore` → codebase reconnaissance, read-only questions - `code-review` → independent review pass before reporting done - `accessibility-reviewer` → a11y concerns - `dotnet-architect` → backend design - `test-agent` → test generation 4. Collect outputs and validate against acceptance criteria 5. If validation fails, delegate corrective tasks 6. Report summary when all tasks pass validation, including total credits consumed across parent + all sub-agent sessions
Copilot CLI can run Anthropic-style sub-agent definitions (as used by Claude Code) alongside its own. A known fix in the July 2026 CLI release resolved sub-agents breaking when additional working directories were configured — if you hit odd path errors with cross-repo sub-agents, update the CLI to the latest patch release.
GitHub Copilot App
The GitHub Copilot app is a standalone desktop client — separate from any IDE, separate from github.com — for macOS, Windows, and Linux. It expanded technical preview at Microsoft Build 2026 (June 2) and reached General Availability on June 17, 2026. Where VS Code excels at inline completion and quick edits, the Copilot app is a control plane for supervising multiple parallel agent sessions tied directly to your GitHub issues, PRs, branches, and repositories.
As agents do more per session, the work shifts from typing code to managing agent output — reading transcripts, hunting for the diff that matters, repeating yourself to course-correct. The Copilot app's "My Work" view and Canvases are GitHub's answer: a dedicated surface for directing several agents at once instead of babysitting one chat panel.
One dashboard of active agent sessions, issues, PRs, and background automations across every connected repo.
Every session runs in its own isolated git worktree — parallel agents never collide on the filesystem.
Voice conversations to direct agents hands-free; session state syncs to the cloud so you can pick up on another device.
Bring-your-own-model support and full MCP server integration, same config surface as VS Code and CLI.
Canvases
Canvases are bidirectional, structured work surfaces — dashboards, trackers, decision logs, document previews — that both the agent and you can read from and write to at the same time. The agent updates a canvas as it works; you edit, reorder, approve, or redirect work directly on the same surface, rather than typing a correction back into chat.
The session (chat) is where you instruct, discuss, and reason through ambiguity. The canvas is where that intent becomes visible, inspectable, steerable work — this split is the core of what GitHub calls "agent experience" (AX): design for people and agents to operate on together, not just people to read.
Scaffold a working canvas extension from a single prompt with the built-in /create-canvas skill — handles the boilerplate plumbing (state sync, layout, agent write access) that the community found itself rebuilding by hand for every custom canvas.
Agent Merge & Sandboxes
Agent Merge handles the PR-through-merge pipeline end to end: an agent's changes land in a worktree, run through cloud sandboxes for validation, open as a PR, and — once you approve — merge, without you manually shepherding each step. Choose the model behind each session, connect MCP servers, and package recurring work as reusable skills or scheduled automations, all from the app.
GitHub embedded the open-source Impeccable design-review tool (40K+ GitHub stars, by Paul Bakaus) as a native skill in the Copilot app for Pro and Enterprise users — 23 commands and 44 rules that catch poor contrast, misaligned elements, inconsistent spacing, and accessibility failures in AI-generated UI, then help fix them live rather than only reporting them.
Copilot SDK
The Copilot SDK reached General Availability alongside the app, in seven languages, letting teams embed the same agent runtime that powers the Copilot app — sessions, worktrees, canvases, MCP — into their own internal tools rather than only consuming it through GitHub's own surfaces.
| Capability | Notes |
|---|---|
| Session management | Start, monitor, and stop agent sessions programmatically |
| Worktree control | Provision isolated worktrees per session for parallel runs |
| Canvas API | Read/write structured canvas state from your own tooling |
| MCP passthrough | Attach the same MCP servers configured for VS Code / CLI |
| Model selection | Choose model per session, including BYOM providers |
Availability rolled out to existing Copilot Pro, Pro+, Business, and Enterprise subscribers first; Free-plan and brand-new subscriber access opened progressively afterward. If internal docs or dashboards still reference the earlier technical-preview waitlist, update them — the waitlist was retired once the app reached GA.
MCP — Model Context Protocol
The Model Context Protocol (MCP) is an open standard that lets Copilot connect to external tools, APIs, and data sources. In agent mode, Copilot uses MCP tools to complete agentic loops without switching context.
Search repos, issues, PRs, manage code, create branches — all from within Copilot.
Connect to PostgreSQL, MySQL, SQLite. Query schemas, explain plans, inspect data.
Browser automation for E2E testing, accessibility audits, and screenshot capture.
Inspect Azure resources, Resource Graph queries, IaC generation from existing infra.
Create/update tickets, transform requirements into epics and user stories.
Direct file system access, git operations beyond what the IDE provides.
GitHub MCP Server
The GitHub local MCP server is open source and natively supported in VS Code. It enables Copilot to interact with your GitHub repositories, issues, PRs, workflows, and more — directly from your conversation.
| Tool | What it does |
|---|---|
| search_repositories | Find repos by query across GitHub |
| get_file_contents | Read any file from any accessible repo |
| list_issues / create_issue | Browse and create GitHub Issues |
| list_pull_requests / create_pull_request | Manage PRs from within chat |
| list_workflow_runs / get_workflow_run | Inspect CI runs and logs |
| create_branch / push_files | Branch and push code changes |
| search_code | Search for code patterns across repos |
| copilot_spaces tools | Access Copilot Spaces context (GA Sep 2025) |
MCP Configuration
Configure MCP servers in mcp.json (workspace or user level). VS Code, JetBrains, Eclipse, and Xcode each have an MCP settings UI.
{
"servers": {
"github": {
"type": "http",
"url": "https://api.githubcopilot.com/mcp/" // OAuth — no token needed
},
"playwright": {
"type": "stdio",
"command": "npx",
"args": ["@playwright/mcp-server"]
},
"postgres": {
"type": "stdio",
"command": "npx",
"args": ["@modelcontextprotocol/server-postgres"],
"env": {
"POSTGRES_CONNECTION_STRING": "${env:DATABASE_URL}"
}
}
}
}
In VS Code and JetBrains, you can configure auto-approve at the server or tool level — reducing confirmation popups in long agent sessions. Set in: Settings → GitHub Copilot → Chat → MCP Server and Tool Auto-approve Configuration.
MCP servers are disabled by default for Copilot Business and Enterprise. An admin must enable the "MCP servers in Copilot" policy from the organisation policy settings before members can use them.
Local Models & BYOK
Copilot no longer requires GitHub-hosted model routing. Since April 7, 2026, Copilot CLI supports Bring Your Own Key (BYOK) and fully local models — connect Azure OpenAI, Anthropic, any OpenAI-compatible endpoint, or a model running entirely on your own machine via Ollama, LM Studio, vLLM, or Foundry Local. VS Code and JetBrains ship the same idea through a Language Models / BYOK settings surface.
Operate with zero outbound calls to GitHub — required for regulated, defense-adjacent, or data-residency-restricted environments.
Use models and providers you already pay for, or run free local inference, instead of drawing down AI Credits.
Swap in fine-tuned or open-weight coding models (Qwen3-Coder, DeepSeek-Coder, Devstral, Gemma) to compare against hosted defaults.
With a BYOK provider configured, Copilot CLI starts immediately on provider credentials alone — sign in to GitHub too for /delegate, code search, and the GitHub MCP server.
VS Code & JetBrains: BYOK / Model Providers
In VS Code: open the Copilot Chat model picker → gear icon → Manage Language Models. This surface now has a one-click Install Model Providers button that filters the Extensions view to provider-contributing extensions.
Install the official Ollama (or LM Studio / Azure / Anthropic) publisher extension from Marketplace rather than relying on any deprecated built-in shim, then point it at your endpoint (Ollama defaults to localhost:11434).
The unified model picker lets you adjust context window size and reasoning effort per model directly, without editing settings JSON by hand.
Your local or BYOK model now appears in the model picker alongside GitHub-hosted models — pick it per conversation like any other option.
GitHub Copilot for JetBrains expanded BYOK to support custom OpenAI-compatible endpoints with API keys — configure your own model server the same way you would in VS Code. JetBrains customizations also gained a Claude agent provider, enabling custom agents/skills/instructions to run against Anthropic models directly, plus a public-preview built-in debugger skill and local sandboxing.
Copilot CLI: Ollama, LM Studio & vLLM
Copilot CLI's BYOK path uses environment variables read at startup — no config file required. Models must support tool calling and streaming; GitHub recommends at least a 128K-token context window for usable agentic behavior.
# 1. Install Ollama and pull a coding-capable model ollama pull qwen3-coder:30b # 2. Point Copilot CLI at your local Ollama server export COPILOT_PROVIDER_BASE_URL=http://localhost:11434 export COPILOT_MODEL=qwen3-coder:30b # 3. Fully air-gapped: disable telemetry and any GitHub calls export COPILOT_OFFLINE=true # 4. Launch — no GitHub sign-in required in offline mode copilot
# In LM Studio: Developer tab → toggle server on → load a model export COPILOT_PROVIDER_BASE_URL=http://localhost:1234/v1 export COPILOT_MODEL=google/gemma-3-1b export COPILOT_OFFLINE=true copilot # run from inside your project directory
export COPILOT_PROVIDER_BASE_URL=https://your-endpoint.example.com/v1 export COPILOT_PROVIDER_API_KEY=sk-your-key-here export COPILOT_MODEL=your-model-name # See all provider examples built into the CLI: copilot help providers
| Env Variable | Purpose |
|---|---|
| COPILOT_PROVIDER_BASE_URL | Base URL of your OpenAI-compatible endpoint (local or remote) |
| COPILOT_MODEL | Exact model name/tag as your provider expects it |
| COPILOT_PROVIDER_API_KEY | API key for remote providers; omit or use a placeholder for local servers |
| COPILOT_OFFLINE | true disables all telemetry and blocks any contact with GitHub's servers |
Local CPU inference runs roughly 10–50× slower than cloud models; a GPU helps significantly. Many small open-weight models have limited or no tool-calling support — MCP tools may silently fail to work. 7B–14B local models are noticeably less capable than Claude/GPT-tier models on complex, multi-file coding tasks. If your provider config is invalid, Copilot CLI now shows an actionable error rather than silently falling back to a GitHub-hosted model — treat that as a debugging signal, not a bug.
You can run cloud models (Claude Sonnet 5, GPT-5.5) alongside a local model (e.g., Gemma via Ollama) across different sessions on the same machine — useful for keeping exploratory/offline work on local inference while reserving cloud credits for the tasks that actually need frontier-model quality.
Hooks, Workflows & Plugins
Hooks
Hooks execute custom shell commands at key points during an agent session. Use them for validation, logging, security scanning, or enforcing policy without modifying the agent itself.
| Hook Event | When it fires | Can block? |
|---|---|---|
| userPromptSubmitted | After the user sends a message, before model responds | Yes |
| preToolUse | Before a tool call is executed (e.g., before a file write) | Yes — can deny or modify |
| postToolUse | After a tool call completes | No — custom post-processing only |
| agentStop CLI | When the agent tries to end its turn — can force continuation | Yes — but capped at 8 consecutive blocks to avoid infinite loops |
| errorOccurred | When an error happens during agent execution | No |
An agentStop hook that always returns "block" used to cause the CLI to loop indefinitely. As of the July 2026 CLI release, the session now force-ends the turn after 8 consecutive blocks, and the hook receives a stop_hook_active flag so it can detect a forced continuation and self-limit rather than fighting the guard.
{
"hooks": [
{
"event": "preToolUse",
"tool": "write_file",
"command": "scripts/validate-no-secrets.sh",
"description": "Scan for secrets before writing files"
},
{
"event": "postToolUse",
"tool": "run_terminal_command",
"command": "scripts/log-command.sh",
"description": "Audit log all terminal commands executed by agent"
},
{
"event": "preToolUse",
"tool": "create_pull_request",
"command": "scripts/enforce-pr-template.sh",
"description": "Verify PR has required sections before creation"
}
]
}
Define hooks in any *.hooks.json file in .github/hooks/. Supported hook events in JetBrains: userPromptSubmitted, preToolUse, postToolUse, errorOccurred. VS Code and CLI hooks are configured in their respective settings.
Agentic Workflows
Agentic Workflows bring Copilot's coding agent directly into GitHub Actions. They run on repository events (push, PR, schedule) and can autonomously perform multi-step development tasks in CI.
--- name: dependency-update-agent description: | Automatically review dependency update PRs, run tests, and approve safe updates. Triggered on Dependabot PRs. on: pull_request: types: [opened] branches: [main] permissions: contents: read pull-requests: write safe-outputs: true --- When a Dependabot PR is opened: 1. Read the dependency diff to understand what changed 2. Check if the package has known CVEs (use GitHub Security Advisory) 3. Review the CHANGELOG for breaking changes 4. If patch/minor version with no CVEs: approve the PR 5. If major version or CVE found: add a review comment explaining
| Workflow Frontmatter | Description |
|---|---|
| on | GitHub Actions trigger events (same syntax as workflow YAML) |
| permissions | GitHub token permissions granted to the agent |
| safe-outputs | true — restrict outputs to prevent injection attacks |
Plugins
Plugins bundle related agents, skills, commands, and hooks into a single installable package. They are the unit of distribution for the awesome-copilot marketplace.
{
"name": "azure-devops-plugin",
"version": "1.2.0",
"description": "Complete Azure DevOps toolset for Copilot",
"agents": ["agents/azure-iac-agent.agent.md"],
"skills": ["skills/azure-iac-export/", "skills/bicep-review/"],
"mcp_servers": [
{
"name": "azure-mcp",
"source": { "npm": "@azure/mcp-server" }
}
]
}
# Install from awesome-copilot marketplace (registered by default) copilot plugin install azure-devops@awesome-copilot # Install from any GitHub repo copilot plugin install owner/repo # List installed plugins copilot plugin list # Validate a plugin during development npm run plugin:validate
Copilot CLI
GitHub Copilot CLI (GA February 2026) brings a full agentic development environment to the terminal. It plans, builds, reviews, and remembers across sessions — with skills, agents, hooks, and plugins — all without leaving the terminal.
# Install via npm npm install -g @github/copilot-cli # Or via homebrew brew install gh-copilot # Authenticate copilot auth login # Initialize project (generates instructions + AGENTS.md) copilot /init # Start a session copilot
CLI Commands & Flags
| Command / Flag | Purpose |
|---|---|
| /init | Generate copilot-instructions.md + AGENTS.md for the project |
| /model | Show and switch models. Includes free (GPT-4.1) and premium models |
| /diff | Review all session changes with syntax-highlighted inline diffs |
| /review | Analyze staged/unstaged changes before committing |
| /delegate <task> | Dispatch a coding agent to work on the task in the background |
| /memory | View and manage agent instruction files and cross-session memory |
| Shift+Tab | Switch to plan mode — Copilot asks clarifying questions, builds structured plan first |
| Esc Esc | Undo/rewind — revert file changes to any previous session snapshot |
| --allow-all-tools | Auto-approve all tool use (for containers / isolated environments) |
| --allow-tools <list> | Allowlist specific tools only |
| --deny-tools <list> | Block specific tools (e.g., deny git push) |
| --allow-paths <glob> | Restrict file access to specific paths |
| -p / --pipe | Non-interactive pipeline mode for scripts and CI |
| --model <name> | Set model for this session |
Built-in CLI Agents
| Agent | Purpose |
|---|---|
| Explore | Fast codebase analysis. Ask questions without cluttering main context. |
| Task | Run commands like tests and builds. Iterates until they pass. |
| Plan | Decompose a large task, build a structured plan, ask questions first. |
# Start and describe a task copilot > Add input validation to all API endpoints in src/api/ # Copilot plans, writes code, runs tests automatically # Review what changed > /diff # Delegate a related task to cloud agent while you continue > /delegate Write E2E Playwright tests for the new validation endpoints # Check for related open issues via GitHub MCP > Are there any open issues related to input validation? # Switch to plan mode before a big change (Shift+Tab) # Copilot asks clarifying questions, shows plan, waits for approval # Use in CI pipeline (non-interactive) copilot -p "Review the diff and check for security issues" \ --allow-tools workspace,github \ --deny-tools terminal
When your session approaches 95% of the context window, Copilot CLI automatically compresses conversation history in the background — no restart needed. Sessions can run as long as you need.
Prompting Best Practices
The quality of Copilot's output scales directly with the quality of your prompts. These principles apply across chat, agent mode, and instructions files.
Prompt Anatomy
Prompting Principles
Name the exact files, methods, or classes. "Refactor the OrderController.cs file" beats "refactor the order controller."
Tell Copilot how you'll verify the result: "All existing tests must pass, and add tests for the new happy path."
"Don't change the public API", "don't add new NuGet packages", "don't touch files in /tests/" — these prevent common mistakes.
"Follow the same pattern as ProductController.cs" gives Copilot a concrete model — better than describing conventions abstractly.
Press Shift+Tab in CLI (or ask "create a plan first") before large refactors. Review and refine the plan before execution begins.
For cloud agent tasks, leave specific line comments on the draft PR — Copilot reads and addresses them in the next iteration.
Instructions File Writing Tips
Very long instruction files cause some instructions to be overlooked (context limits). Target under 500 lines. Use path-specific *.instructions.md to split language-specific rules from general ones.
Instead of "write clean code", write: "Use primary constructors for simple service classes. Example: public class OrderService(IOrderRepo repo, ILogger<OrderService> log)."
If both copilot-instructions.md and a *.instructions.md give conflicting guidance, Copilot's choice is non-deterministic. Structure instructions carefully to avoid overlap.
Power-User Tips
Prefix with @workspace in VS Code chat to give Copilot access to your entire project. Essential for cross-file refactoring.
Use #file:path/to/file.cs to attach specific files, or #selection to reference what you've highlighted in the editor.
Copilot Spaces (GA Sep 2025) combine code, docs, and notes into a shared context — great for team standards and project wikis.
Copilot CLI remembers conventions and preferences across sessions. Build up good memory by consistently naming patterns in prompts.
While you focus on one task in CLI, delegate related work to the cloud agent. Both run in parallel — check the cloud agent PR when you're done.
Enable tool auto-approve + preToolUse hooks that validate safety. You get speed without sacrificing security controls.
In VS Code chat, check the References list on any response — confirms whether copilot-instructions.md and skills were actually loaded.
Right-click in VS Code Chat view → Diagnostics — shows all loaded instruction files and any loading errors. Invaluable for debugging why instructions aren't applied.
Personal ~/.copilot/ instruction files sync across devices via VS Code Settings Sync. Enable "Prompts and Instructions" in Settings Sync config.
Slash Commands Reference
| Command | What it does | Where |
|---|---|---|
| /explain | Explain selected code in plain English | VS Code, JetBrains |
| /fix | Fix issues in selected code | VS Code, JetBrains |
| /tests | Generate unit tests for selection | VS Code, JetBrains |
| /doc | Generate documentation/comments for selection | VS Code, JetBrains |
| /new | Create a new file/project from a template | VS Code |
| /newNotebook | Create a new Jupyter notebook | VS Code |
| /init | Generate project instructions (CLI + VS Code) | CLI, VS Code |
| /diff | Review session changes with syntax-highlighted diff | CLI |
| /review | Quick sanity check on staged changes | CLI |
| /delegate | Dispatch cloud agent to work on task in background | CLI |
| /model | View/switch models | CLI |
| /memory | Open agent instruction/memory settings | CLI, JetBrains |
| /skill-name | Manually invoke a named skill | VS Code, CLI |
awesome-copilot Community
The github/awesome-copilot repository is a community-driven collection of instructions, agents, skills, hooks, workflows, and plugins — maintained by GitHub and the developer community.
| Resource | Description |
|---|---|
| awesome-copilot.github.com | Full website with search, filtering, learning hub, tools section |
| github.com/github/awesome-copilot | Source repository — contribute via PRs to staged branch |
| awesome-copilot.github.com/skills/ | Browse all skills with descriptions and install commands |
| llms.txt | Machine-readable listing of all resources — for AI agents browsing the collection |
| Learning Hub | Curated articles on skills, agents, MCP, hooks, agentic workflows |
Contributing to awesome-copilot
# Fork the repo and clone git clone https://github.com/YOUR_USERNAME/awesome-copilot cd awesome-copilot # Create your content (skill, agent, instruction, etc.) # File names: lower-case-with-hyphens.md # Run validation npm run skill:validate # validate SKILL.md frontmatter npm run plugin:validate # validate plugin.json # Build (required — updates README automatically) npm run build # Fix line endings (required — CI will fail otherwise) bash eng/fix-line-endings.sh # PRs now target 'main' directly (changed from 'staged' in 2026) git checkout -b feat/my-awesome-skill git push origin feat/my-awesome-skill # Open PR → base: main
External plugin submissions go through an approval workflow tracked as issues, and closed external-plugin submissions get a nightly automated re-review once they're six months old — maintainers respond with /re-review-keep, /re-review-needs-changes, or /re-review-remove to keep the marketplace current.
Required Frontmatter Checklist
All PRs target the main branch. File names must be lowercase with hyphens. Only .md files accepted — no .yml, .yaml, or .lock.yml. Run npm run build and bash eng/fix-line-endings.sh before committing; plugins additionally need .github/plugin/plugin.json with name, description, version, and a logo asset.
Recommended Repository Structure
Quick-Start: First 30 Minutes
Run copilot /init in CLI or type /init in VS Code chat. Copilot analyzes your repo and creates .github/copilot-instructions.md + AGENTS.md.
Open VS Code MCP settings and add the GitHub MCP server. Use OAuth — no PAT needed. This gives Copilot access to issues, PRs, and workflows.
Visit awesome-copilot.github.com/skills/ and find a skill relevant to your stack. Install via CLI: copilot plugin install <name>@awesome-copilot.
Find a small, well-scoped issue. Go to the Issue → Assignees → select Copilot. Check back in 5–10 minutes to review the draft PR.
Identify a repetitive task your team does (e.g., PR review checklist). Write a SKILL.md in .github/skills/ and test it by describing the task in chat.