GitHub Copilot CLI Slash Commands

Slash commands: quick, explicit controls inside the interactive GitHub Copilot CLI session.

Slash commands provide quick, explicit controls inside the interactive GitHub Copilot CLI session. Type / to browse available commands, or use /help for the command list supported by the installed version.

Session and Context

CommandDescription
/clearClear the current session’s conversation history and context
/compactSummarize the current session to free context space
/contextShow the context currently available to the session
/sessionShow information about the current session
/usageShow session usage metrics
/exitExit Copilot CLI (alias: /quit)

Workspace and File Access

CommandDescription
/cwd [directory]Show or change the working directory
/add-dir <directory>Add a directory to Copilot’s allowed file-access scope
/list-dirsList directories Copilot can access

Use /add-dir and /list-dirs to make the active file-access boundary explicit before working in a larger or sensitive directory tree.

Configuration and Workflow

CommandDescription
/model [model]Select the AI model used by Copilot CLI
/theme [show|set|list]View or configure the terminal theme
/terminal-setupEnable multiline terminal input
/reset-allowed-toolsReset the allowed external tools
/agentSelect a custom agent
/mcp [show|add|edit|delete|disable|enable]Manage MCP server configurations
/initInitialize Copilot custom instructions for the repository

Code Changes and Review

CommandDescription
/planCreate an implementation plan before making changes
/reviewReview code changes and report issues or improvements
/testGenerate or improve tests for the code in context
/diffOpen a diff view for the current changes
/undoRevert the most recent Copilot change

Collaboration and Account Management

CommandDescription
/delegate <prompt>Delegate work and create an AI-generated pull request
/share [file|gist] [path]Export or share the current session
/loginLog in to Copilot
/logoutLog out of Copilot
/user [show|list|switch]Show, list, or switch GitHub accounts
/feedbackSubmit feedback about Copilot CLI

Help and Discovery

CommandDescription
/helpShow the available slash commands and descriptions

The command set can change between Copilot CLI releases. Treat /help as the runtime source of truth for the current installation.

Customization

Unlike OpenCode, Copilot CLI does not document a simple .md file convention that turns an arbitrary filename into a new /command. The supported customization options are:

FeatureLocation or commandUse it for
Custom instructions.github/copilot-instructions.md, .github/instructions/**/*.instructions.md, or AGENTS.mdProject conventions and persistent context
Custom agents.github/agents/CUSTOM-AGENT-NAME.md and /agentSpecialized workflows with tailored prompts and tools
Agent skillsProject or user skill directories and copilot skillReusable task capabilities
HooksCopilot CLI hook configurationRunning custom shell commands at agent lifecycle points
PluginsCopilot CLI plugin configurationPackaging and sharing custom agents, skills, MCP servers, and instructions

For a reusable task shortcut, use a custom agent or skill and select it through the supported CLI workflow. Prompt files (*.prompt.md) are documented primarily for supported IDEs, not as a general Copilot CLI slash-command mechanism.

These are interactive input shortcuts rather than slash commands:

ShortcutDescription
@ FILENAMEInclude a file in the prompt context
# NUMBERInclude a GitHub issue or pull request in the context
! COMMANDRun a command in the local shell
?Open quick help on an empty prompt

Top-level commands such as copilot login, copilot init, and copilot completion are CLI commands, not interactive slash commands.

Sources: