50 GitHub Copilot Commands, Actions, and Developer Workflows
Most “50 Copilot commands” articles are padded with natural-language prompts presented as if they were syntax. That is not a stylistic complaint — it actively misleads people, who then type a sentence expecting a command and conclude the feature is broken.
Every entry below carries a label saying exactly what it is:
- Official command — documented syntax you type literally in chat.
- CLI command — documented Copilot CLI syntax you type literally.
- Prompt — natural language. Nothing in it is a reserved word.
- Workflow — a sequence of steps, not a single instruction.
Key takeaways
- Chat slash commands differ by editor. Type
/in your own chat box for the authoritative list. - Chat variables (
#) control context explicitly; chat participants (@) scope a question to a domain. - Copilot CLI has by far the largest command surface, including plan, review and permission modes.
- A prompt is not syntax. Nothing in a prompt is reserved, and nothing is guaranteed.
- Where a command is destructive or grants permissions, that is stated in its limitations.
Why the distinction matters
It is worth being concrete about what goes wrong when the four categories get blurred, because the failure is not theoretical.
A command is syntax. /explain is a reserved token the client recognises
before your text reaches a model. It behaves consistently, it is documented, and
it either exists in your environment or it does not.
A prompt is text. “Explain this function and identify edge cases” has no reserved words. It works because it is specific about what it wants, not because any part of it is special. Change the wording and it still works; type it in a terminal and nothing happens.
The confusion runs in both directions. People type a prompt expecting command behaviour and conclude Copilot is broken when it does not fire. And people transcribe a “command” from an article, get nothing, and assume their installation is wrong — when the string was never a command in the first place.
There is a third failure worth naming: assuming a command exists everywhere.
/optimize is real, but only in Visual Studio. /simplify is real, but only in
Xcode. An article listing them together without saying where they work will send
you looking for a feature your editor does not have.
Availability at a glance
| Surface | What you get |
|---|---|
| VS Code chat | The widest slash command set, plus chat variables (#) and participants (@) |
| Visual Studio chat | A different slash command set, and file references instead of chat variables |
| JetBrains chat | Core commands, plus CLI-specific commands during a CLI session |
| Xcode chat | A small, focused set centred on the current selection |
| GitHub.com chat | Conversation management commands, plus @ mentions and MCP skills |
| Copilot CLI | By far the largest surface: shell commands, slash commands and options |
Notice that the concept is consistent everywhere — commands for common operations, a syntax for supplying context — while the specific tokens are not. Learning the concepts transfers; memorising a token list does not.
Chat slash commands in IDEs
Type / in a chat prompt box, followed by the command name.
Entry 1: /explain
Official commandExplains how the code in your active editor works.
/explainEntry 2: /fix
Official commandProposes a fix for problems in the selected code.
/fixEntry 3: /tests
Official commandGenerates unit tests for the selected code.
/testsEntry 4: /clear
Official commandStarts a new chat session, clearing the conversation.
/clearEntry 5: /new
Official commandCreates a new project in VS Code; starts a new conversation on GitHub.com.
/newEntry 6: /help
Official commandShows a quick reference for using Copilot.
/helpEntry 7: /fixTestFailure
Official commandFinds and fixes a failing test.
/fixTestFailureEntry 8: /doc
Official commandAdds a documentation comment for the selected symbol.
/docEntry 9: /optimize
Official commandAnalyses and improves the running time of the selected code.
/optimizeEntry 10: /simplify
Official commandSimplifies the current code selection.
/simplifyEntry 11: /compact
Official commandCompresses the current session context to keep a long-running session manageable.
/compactEntry 12: /chronicle
Official commandReviews and analyses your session history. Subcommands include standup, tips, search and improve.
/chronicle standupChat commands on GitHub.com
Entry 13: /rename
Official commandRenames the current conversation.
/renameEntry 14: /delete
Official commandDeletes a conversation.
/deleteChat context syntax
Slash commands tell Copilot what to do. Context syntax tells it what to look at, and it is the more consequential of the two.
The reason is straightforward: a slash command with the wrong context produces a
confident answer about the wrong code. /explain on a file you did not mean to
have focused is not a malfunction — it is a correct explanation of something
irrelevant. Being explicit about context removes an entire category of confusing
results.
Chat variables include specific context in a prompt. Type # in the prompt box.
These are documented for VS Code.
Entry 15: #file
Official commandIncludes the current file's content in the prompt.
Explain the caching strategy in #fileEntry 16: #selection
Official commandIncludes the currently selected text in the prompt.
Rewrite #selection to use a guard clause instead of nestingEntry 17: #project
Official commandIncludes project context in the prompt.
Where is authentication handled in #projectEntry 18: #function
Official commandIncludes the current function or method in the prompt.
What edge cases does #function missEntry 19: #class, #block, #line, #path, #sym, #comment
Official commandInclude the current class, block, line, file path, symbol or comment respectively.
Explain how #class relates to #symEntry 20: #MyFile.cs and #solution
Official commandReferences a specific file, specific lines within a file, or the whole solution.
Explain this function #MyFile.cs: 66-72Entry 21: @github
Official commandScopes the prompt so Copilot can use GitHub-specific skills.
@github What changed in the last releaseEntry 22: @terminal
Official commandGives Copilot context about the VS Code terminal shell and its contents.
@terminal Why did that command failEntry 23: @vscode
Official commandGives Copilot context about VS Code commands and features.
@vscode How do I change the default formatter for PythonEntry 24: @azure
Official commandProvides context about Azure services and how to use, deploy and manage them.
@azure How do I deploy this container appCopilot CLI — command line
Copilot CLI has a considerably larger command surface than any chat interface, for a structural reason: it is an agent with a permission model, session management and its own configuration, so it needs commands for all three.
The commands below split into three groups. Shell commands (copilot login,
copilot init) are typed at your prompt. Slash commands (/plan,
/review) are typed inside a running session. Options (--model,
--allow-all-tools) modify how a session starts. Mixing them up is the most
common CLI mistake — /plan at a shell prompt does nothing, and --model inside
a session is just text.
Run these from your shell.
Entry 25: copilot
CLI commandLaunches the interactive Copilot CLI interface.
copilotEntry 26: copilot login
CLI commandAuthenticates with Copilot via OAuth. Supports --host, --web-flow and --device-code.
copilot login --device-codeEntry 27: copilot init
CLI commandInitialises Copilot custom instructions for the current repository.
copilot initEntry 28: copilot -p
CLI commandExecutes a prompt programmatically and exits. Combine with --allow-all-tools for non-interactive use.
copilot -p "Summarise the changes on this branch" --allow-all-toolsEntry 29: copilot --model
CLI commandSelects the model for the session. Pass auto to let Copilot choose.
copilot --model claude-sonnet-4.6Entry 30: copilot --worktree
CLI commandCreates or reuses an isolated Git worktree and starts the session inside it.
copilot --worktreeEntry 31: copilot --resume
CLI commandResumes a previous session by ID, ID prefix or name.
copilot --resumeEntry 32: copilot update
CLI commandDownloads and installs the latest Copilot CLI version.
copilot updateCopilot CLI — slash commands
Type these inside an interactive session.
Entry 33: /plan
CLI commandCreates an implementation plan before writing any code.
/plan Add rate limiting to the public API endpointsEntry 34: /review
CLI commandRuns the code review agent to analyse your changes.
/reviewEntry 35: /security-review
CLI commandRuns a focused security review of local changes and returns prioritised findings with remediation suggestions.
/security-reviewEntry 36: /permissions
CLI commandSwitches between permission modes — default, assisted and allow-all — or shows the current mode.
/permissions showEntry 37: /model
CLI commandSelects the model mid-session, or chooses Auto. Scopes include --session, --global, --repo and --local.
/model gpt-5.4Entry 38: /undo
CLI commandOpens the rewind picker to roll the session back to an earlier user turn.
/undoEntry 39: /context
CLI commandShows context window token usage and a visualisation of what is consuming it.
/contextEntry 40: /diff
CLI commandReviews changes in the current directory, switching to a branch diff when the working tree is clean.
/diffEntry 41: /pr
CLI commandManages pull requests for the current branch. Subcommands include view, create, fix, auto and automerge.
/pr createEntry 42: /delegate
CLI commandDelegates changes to a remote repository with an AI-generated pull request.
/delegate Add pagination to the orders endpointEntry 43: /sandbox
CLI commandManages OS-level sandboxing that restricts filesystem and network access for shell commands, MCP and LSP servers, and built-in tools.
/sandbox statusEntry 44: /mcp
CLI commandManages MCP server configuration — list, show, add, edit, delete, disable, enable, auth, reload and search.
/mcp listEntry 45: /instructions
CLI commandViews and toggles the custom instruction files currently in effect.
/instructionsEntry 46: /usage
CLI commandDisplays session usage metrics and statistics, including per-model token totals.
/usagePrompts, not commands
These are natural language. Nothing in them is reserved syntax, and nothing is guaranteed — they work because they are specific, not because they are special.
Entry 47: Explain and identify edge cases
PromptGets an explanation framed around failure rather than the happy path.
Explain this function, identify edge cases, and write pytest tests
for success, boundary, and failure conditions.Entry 48: Refactor with a stated constraint
PromptRequests a refactor while fixing the things that must not change.
Refactor this function to reduce duplication without changing
externally observable behaviour. Keep the public signature, the
exception types, and the log messages exactly as they are.Entry 49: Generate infrastructure with justification
PromptRequests configuration alongside the reasoning, so it can be evaluated rather than trusted.
Create a Dockerfile for this FastAPI application. Use a non-root
runtime user and explain each security decision.Workflows
Sequences rather than single instructions.
Entry 50: Plan, implement, review, verify
WorkflowThe full loop for a non-trivial change, with a review gate before and after implementation.
1. /plan Add rate limiting to the public API endpoints
2. Review the plan. Correct it before any code is written.
3. Approve implementation, watching terminal approvals as they appear.
4. /review
5. /security-review
6. Run the test suite yourself, in your own terminal.
7. /pr createBuilding a command habit
Fifty entries is a reference, not a curriculum. In practice most developers settle on a small working set and reach for the rest occasionally. Here is a reasonable progression.
Week one — comprehension. Use /explain and the context syntax, nothing
else. The goal is to build the reflex of supplying context deliberately rather
than hoping the right thing is focused. #file, #selection and #function
cover almost everything at this stage.
Week two — the feedback loop. Add /tests and /fix, and start reading
what they produce rather than applying it. This is where you calibrate: you
learn what Copilot gets right in your codebase and what it consistently gets
wrong, which is knowledge no article can give you.
Week three — the CLI. Install it, run copilot init in a repository you
know well, and use /plan before /review. Planning before implementing is the
single habit that most improves agent output, and the CLI makes it explicit.
Ongoing — permissions and cost. /permissions show and /usage are the two
you should check periodically rather than daily. The first tells you what an
agent may do without asking; the second tells you what your sessions are costing.
Both are easy to leave unexamined until something surprises you.
Common mistakes
Typing a prompt as a command. /refactor this to be faster is not a
command in any documented environment. /fix is; the rest of that string is
just text following it.
Assuming cross-editor parity. Checked above, worth repeating: the sets genuinely differ, and the differences are not obvious from the names.
Using allow-all to move faster. It works, and it removes the boundary that
makes an agent with shell access safe. Reserve it for disposable environments.
Ignoring /plan because it feels like overhead. Reviewing a plan takes a
minute. Reviewing a wrong implementation takes considerably longer, and unwinding
one takes longer still.
Treating /review or /security-review as sufficient. Both are useful first
passes that clear obvious findings before a human looks. Neither is a review, and
neither can tell you that a change is wrong given something happening elsewhere
in the system.
What is not on this list
Copilot CLI alone documents considerably more slash commands and options than
appear here — /fleet, /research, /rubber-duck, /autopilot, /worktree,
/skills, /agent, /share, /session, /limits and many more, plus a large
set of command-line options.
They are omitted because this is Cluster 1, and the entries above are the ones worth knowing in your first weeks. Copilot CLI gets a full cluster later in the Academy roadmap; for the complete surface, GitHub’s CLI command reference is authoritative and is linked in the sources below.
How to find what is actually available
The single most useful habit on this page:
- In chat, type
/and read the list. It reflects your editor, version and context. - In Copilot CLI, run
/helpin a session, orcopilot helpfrom the shell. - For options, run
copilot helpand the topic —billing,config,commands,environment,logging,monitoring,permissions,providersorsandbox.
Any article, including this one, is a snapshot. Your own environment is the authority.
Related lessons
- Copilot Chat — using these commands in context.
- Keyboard Shortcuts — the bindings that go with them.
- Agent Mode — what the agentic commands are driving.
- 50 Things You Can Do with Copilot — the jobs rather than the syntax.
Sources
Every version-sensitive claim on this page was checked against first-party documentation. Only sources actually used are listed.
Your progress
Saved in this browser only. No account, no server, and nothing leaves your device. Clearing site data resets it.
Was this lesson helpful?
Your answer is stored in this browser and is not sent anywhere.