ext install GitHub.copilot
ext install GitHub.copilot-chat| Command | Action | Command | Action |
|---|---|---|---|
/explain | Explain selected code | /fix | Fix problems in code |
/tests | Generate unit tests | /new | Scaffold new project |
/clear | New chat session | /help | Copilot quick reference |
/init | Generate instructions | /search | Workspace search |
/delegate | Send to coding agent CLI | /compact | Compress context CLI |
ms-vscode.vscode-speech/explain + #file โ "Explain the auth flow in #file:auth.ts" (onboard to unfamiliar code)/fix + #problems โ "Fix all errors in #problems" (resolve build failures in one prompt)// fetch user by email, Copilot generates the implementationit("should...") block and Tab through the restuserId โ accountId โ change one occurrence, NES finds and fixes the rest across files| Model | Rate |
|---|---|
| GPT-4.1 / GPT-4o / GPT-5 mini | 0ร included |
| Raptor mini | 0ร included |
| Grok Code Fast 1 | 0.25ร |
| Claude Haiku 4.5 / Gemini 3 Flash | 0.33ร |
| GPT-5.1-Codex-Mini / GPT-5.4 mini | 0.33ร |
| Sonnet 4 / 4.5 / 4.6 | 1ร |
| Gemini 2.5 Pro / 3 Pro / 3.1 Pro | 1ร |
| GPT-5.1 / 5.2 / 5.4 + Codex variants | 1ร |
| Claude Opus 4.5 / 4.6 | 3ร |
| Opus 4.6 fast mode (preview) | 30ร |
| Plan | Included |
|---|---|
| Free | 2K completions + 50 premium/mo |
| Pro / Student | Unlimited + premium allowance |
| Pro+ | Unlimited + higher premium |
| Business | Unlimited + org premium pool |
| Enterprise | Unlimited + enterprise premium |
/init โ auto-generate for workspace.instructions.md) that apply conditionally based on file glob patterns or semantic matching โ e.g., Python rules only for *.py files.
---
name: 'Python Standards'
description: 'Python conventions'
applyTo: '**/*.py'
---
# Python coding standards
- Follow PEP 8 style guide
- Use type hints for all functions/instructions in chat to open Configure menu.
python.instructions.md with applyTo: '**/*.py' for PEP 8, type hints, docstringsreact-tests.instructions.md with applyTo: '**/*.test.tsx' for RTL best practices.prompt.md) you invoke as slash commands. Encode frequent tasks like scaffolding components or running reviews โ type /prompt-name instead of re-writing the prompt..prompt.md files/prompt-name in chat.github/prompts/prompts/ folder---
description: 'Create React form'
agent: agent
tools: ['editFiles', 'search']
model: GPT-5.2
---
Generate a React form component
with validation for ${input:fields}${input:name} for user-provided values.
/create-api generates REST endpoint with controller, service, tests, and OpenAPI spec/review-pr checks for security, performance, and accessibility issues every time| Mode | Purpose |
|---|---|
| Ask | Read-only Q&A, no code changes |
| Edit | Direct code edits |
| Agent | Autonomous tool use + edits |
| Plan | Create plan before implementation |
---
description: 'Security reviewer'
tools: ['search', 'readFile']
model: Claude Sonnet 4.6
agents: ['*']
handoffs:
- label: Fix issues
agent: implementation
prompt: Fix the issues above.
send: false
---
Review code for OWASP Top 10...| Field | Description |
|---|---|
description | Shown as placeholder text (required on github.com) |
name | Display name (defaults to filename) |
tools | List of available tools; omit for all tools |
agents | Allowed subagents (* = all, [] = none) |
model | AI model (string or prioritized array) |
handoffs | Sequential workflow transitions (label, agent, prompt, send, model) |
target | vscode or github-copilot (omit for both) |
mcp-servers | MCP server configs scoped to this agent |
hooks | Agent-scoped hooks Preview |
user-invocable | Show/hide in dropdown (default: true) |
disable-model-invocation | Prevent subagent invocation (default: false) |
argument-hint | Hint text in chat input field |
/agents to configure or /create-agent to generate with AI. On github.com, use the Agents tab at github.com/copilot/agents to create and manage agents.
search, readFile), scans for OWASP Top 10, hands off to "fix" agentsend: true) auto-submits to implementation agent.github-private repo to share across all repos in your org/enterprise---
name: webapp-testing
description: 'Run and debug
web app integration tests'
---
# Testing Workflow
Use describe + it + AAA pattern
Use factory mocks for fixtures/skill-name in chat/create-skill โ AI-generate a skill/deploy runs the full pipeline{
"servers": {
"github": {
"type": "http",
"url": "https://api.githubcopilot.com/mcp"
},
"playwright": {
"command": "npx",
"args": ["-y",
"@microsoft/mcp-server-playwright"]
}
}
}| Capability | Description |
|---|---|
| Tools | Execute operations (file, DB, API) |
| Resources | Read-only context (Add Context โ MCP Resources) |
| Prompts | Templates via /server.prompt |
| MCP Apps | Interactive UI in chat |
| Sampling | Server-initiated model calls |
| Elicitation | Server asks user for input |
| Event | When |
|---|---|
SessionStart | First prompt of new session |
UserPromptSubmit | User submits a prompt |
PreToolUse | Before tool invocation |
PostToolUse | After tool completes |
PreCompact | Before context compaction |
SubagentStart/Stop | Subagent lifecycle |
Stop | Agent session ends |
{
"hooks": {
"PostToolUse": [{
"type": "command",
"command": "npx prettier --write \"$TOOL_INPUT_FILE_PATH\""
}]
}
}deny is currently processed)permissionDecision: "deny" in JSON output to block specific tool calls.
prettier --write on every file the agent edits{"permissionDecision": "deny"} for rm -rf and DROP TABLE/delegate in chat or @cli in terminalcopilot-setup-steps.yml (GitHub Actions workflow)/delegate + link to GitHub issue โ agent creates a branch, implements, and opens a PR| Command | Action |
|---|---|
/model | Switch AI model |
/compact | Compress conversation context |
/context | View token usage breakdown |
/usage | Session stats (premium reqs, duration, LOC) |
/agent | Select a custom agent |
/mcp | List MCP servers; /mcp add to add |
/resume | Resume a previous session |
/add-dir | Trust an additional directory |
/cwd / /cd | Change working directory |
/login | Authenticate with GitHub |
/feedback | Submit feedback, bugs, features |
/allow-all | Auto-approve all tools this session |
| Key / Syntax | Action |
|---|---|
| Shift+Tab | Toggle Ask / Plan mode |
| Ctrl+T | Show/hide model reasoning |
| Esc | Stop current operation |
@path/to/file | Include file as context |
!git status | Run shell command directly |
copilot -p "Run tests, fix failures, commit" --allow-all-tools in CI/CD/resume to pull a coding agent session from github.com into your terminalcopilot -p "Rename all .jpeg files to .jpg recursively" with --allow-tool='shell'.jsonc files via Chat: Configure Tool Sets#toolset-nametools: ['my-toolset']#edit, #search{
"reader": {
"tools": ["search/changes", "search/codebase",
"read/problems", "search/usages"],
"description": "Tools for reading context",
"icon": "book"
}
}search, readFile, grep into a #reader set for safe auditing#reader in prompt to enable all read tools at once.env, **/secrets/** from being sent to AI/delegate to coding agent for implementationinstructions/ for frontend (React) and backend (Python) with different applyTo globs.github/ folder to Git so all team members get the same Copilot behavior| Agent | Provider | Status |
|---|---|---|
| Claude | Anthropic | Preview |
| Codex | OpenAI | Preview |
@AGENT_NAME in a comment| Tool | Action |
|---|---|
openBrowserPage | Open a URL in integrated browser |
navigatePage | Navigate to a different URL |
readPage | Read page content & structure |
screenshotPage | Take a screenshot for visual review |
clickElement | Click a page element |
hoverElement | Hover over an element |
dragElement | Drag and drop elements |
typeInPage | Type text into inputs |
handleDialog | Accept/dismiss browser dialogs |
runPlaywrightCode | Run custom Playwright automation |
workbench.browser.enableChatTools to truechat.checkpoints.enabledchat.checkpoints.showFileChangeschat.editRequests| Type | Runs | Best For |
|---|---|---|
| Local | VS Code (interactive) | Brainstorm, debug, browse |
| Copilot CLI | Background on machine | Well-defined tasks, POCs |
| Cloud | Remote infra | PRs, team collaboration |
| Third-party | Claude / Codex | Provider-specific models |
/delegate in CLI โ sends to cloud agentchat.agentsControl.enabled// TODO: add input validation in code โ right-click โ assign to Copilot coding agent โ agent creates a PRWrite a TypeScript function that validates
email addresses. Return true for valid,
false otherwise. Don't use regex.
Example: validateEmail("user@example.com")
โ true
Example: validateEmail("invalid") โ false#codebase#file, #folder, #symbol#fetch โ pull info from web pages / docs| Mode | When to Use |
|---|---|
| Inline suggestions | In-flow coding, boilerplate |
| Ask | Questions, brainstorm, explore |
| Inline chat | Targeted in-place edits |
| Agent | Multi-file autonomous changes |
| Plan | Architecture, migration strategy |
| Smart actions | One-click commit msg, fix, rename |
| Action | Where |
|---|---|
| Generate Commit Message | Source Control panel |
| Rename Symbol | F2 on any symbol |
| Fix with Copilot | Lightbulb on errors/warnings |
| Fix Test Failure | Test Explorer failed tests |
| Generate Docs | Right-click โ Generate Code |
| Semantic Search | Search view (meaning, not keywords) |
| Generate PR Summary | PR description field |
processData โ Copilot suggests transformUserPayload based on function body semanticsChat: Manage Language Models command| What | Behavior |
|---|---|
| Prompts & suggestions | Not retained after response delivered |
| Training on your code | No (all plans โ cannot be enabled) |
| Telemetry opt-out | Individual users can opt out |
| Code snippets | Encrypted in transit & at rest |
| Policy | Controls |
|---|---|
| Features | Chat, completions, agents, MCP |
| Models | Enable/disable premium models |
| Coding agent | Enable cloud agent + 3rd-party |
| Editor preview | Opt in to preview features |
| Public code filter | Block public code matches |
| Content exclusion | Exclude files/repos from AI |
| Subagent | Purpose |
|---|---|
| Explore | Quick codebase analysis & Q&A |
| Task | Run tests/builds, return brief summaries |
| Code-review | Review changes, surface real issues |
| General-purpose | General-purpose subagent |
| Research | Deep research tasks |
| Scope | Endpoint |
|---|---|
| Enterprise | GET /enterprises/{ent}/copilot/metrics |
| Organization | GET /orgs/{org}/copilot/metrics |
| Team | GET /orgs/{org}/team/{slug}/copilot/metrics |
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $TOKEN" \
-H "X-GitHub-Api-Version: 2026-03-10" \
https://api.github.com/orgs/my-org/copilot/metrics\
?since=2026-02-01&until=2026-03-01| Category | Key Metrics |
|---|---|
| IDE Completions | Suggestions, acceptances, lines suggested/accepted โ by language, editor, model |
| IDE Chat | Total chats, insertion events, copy events โ by editor, model |
| GitHub.com Chat | Total chats, engaged users โ by model |
| PR Summaries | Total summaries created โ by repo, model |
manage_billing:copilot, read:org, or read:enterprise/copilot/metrics endpoints are being deprecated. Migrate to the newer Copilot usage metrics endpoints for more depth and flexibility.
[{
"date": "2026-03-24",
"total_active_users": 24, // licensed users
"total_engaged_users": 20, // actually used Copilot
"copilot_ide_code_completions": {
"total_engaged_users": 20,
"languages": [{ "name": "python", "total_engaged_users": 10 }, ...],
"editors": [{
"name": "vscode", "total_engaged_users": 13,
"models": [{
"name": "default", "languages": [{
"name": "python",
"total_code_suggestions": 249, // suggested to user
"total_code_acceptances": 123, // user accepted
"total_code_lines_suggested": 225,
"total_code_lines_accepted": 135
}]
}]
}]
},
"copilot_ide_chat": { ... }, // chats, insertions, copies
"copilot_dotcom_chat": { ... }, // GitHub.com chat usage
"copilot_dotcom_pull_requests": { ... } // PR summaries by repo
}]| Mode | Behavior |
|---|---|
| Block | Suggestions matching public code (~150 chars) are hidden โ user never sees them. Eliminates IP risk. |
| Allow | Suggestions are shown with references โ source repo URL, license type, and code snippet displayed. |
function fizzBuzz() โ a common implementation will match and show references in the log.
| Repo Type | Autofix Access |
|---|---|
| Public repos | Free |
| Org repos (GitHub Code Security) | Included |
| Enterprise (GHES + Code Security) | Code Security |
| Feature | Autofix Role |
|---|---|
| Code Scanning | Generates code patches for CodeQL alerts (SQL injection, XSS, etc.) |
| Secret Scanning | AI-assisted secret rotation guidance |
| Dependabot | Dependency review integration โ verify fixes don't add insecure deps |
| Security Overview | Org-level dashboard of autofix suggestion counts & resolution rates |
| Section | What It Shows |
|---|---|
| System Prompt | Full instructions, agent description, loaded skills โ verify custom instructions appear |
| User Prompt | Exact text sent to model โ confirm #-mentions resolved to real content |
| Context | Files, symbols, attachments โ check if expected files are included or context window is full |
| Response | Raw model output including reasoning โ understand how model interpreted your request |
| Tool Responses | Input/output for each tool call โ debug MCP servers, verify correct payloads |
| View | What It Shows |
|---|---|
| Logs | Chronological events โ LLM requests, tool calls, discovery, errors. Filter by type. |
| Summary | Aggregate stats โ total tool calls, token usage, error count, duration |
| Flow Chart | Visual agent โ subagent interaction graph โ pan, zoom, click nodes |
github.copilot.chat.agentDebugLog.enabled/troubleshoot list loaded instructions| Problem | Where to Look | What to Check |
|---|---|---|
| AI ignores workspace files | Agent Logs โ Discovery events + Chat Debug โ Context | Workspace indexed? Files in context window? |
| MCP tool not invoked | Agent Logs โ Tool Calls filter + Chat Debug โ System Prompt | Tool listed in available tools? Server running? |
| Response truncated | Agent Logs โ LLM Requests โ token usage | Context window full? Start a new session. |
| Prompt file not applied | Agent Logs โ Discovery events | File loaded/skipped? applyTo glob match? |
| Custom instructions missing | Chat Debug โ System Prompt section | Expand and search for your instruction text |
Developer: Set Log Level โ select Trace for GitHub Copilot and GitHub Copilot Chat extensions.
| Shortcut | Action |
|---|---|
| โโI / Ctrl+Alt+I | Open Chat panel |
| โI / Ctrl+I | Inline chat |
| โโงI | Toggle secondary sidebar |
| Tab | Accept suggestion |
| Esc | Dismiss suggestion |
| Alt+] / Alt+[ | Next / prev suggestion |
| Ctrl+โ | Accept word by word |
| Command | Action |
|---|---|
/init | Generate workspace instructions |
/explain | Explain selected code |
/fix | Fix problems in code |
/tests | Generate unit tests |
/new | Scaffold a new project |
/clear | Start a new chat session |
/help | Copilot quick reference |