Skip to content
GitHub Copilot · Cheat Codes

GitHub Copilot Cheat Codes (2026): Slash Commands, Agents & Chat

Copilot Chat parses a real command language. These shortcuts are literal — they'll be recognised by Copilot in VS Code, JetBrains and github.com.

Updated 2026-07-28

⚡ Slash Commands

Cheat CodeUseExample
/explainExplain code/explain this function
/fixFix problems in selection/fix the failing test
/testsGenerate tests/tests for edge cases
/docAdd documentation/doc JSDoc for exported fns
/optimizeOptimise selection/optimize this loop
/newScaffold a new project/new Node CLI with TS
/newNotebookNew Jupyter notebook/newNotebook EDA on sales.csv
/clearClear the chat/clear

🤖 @ Agents

Cheat CodeUseExample
@workspaceReason about whole workspace@workspace /explain the auth flow
@vscodeAsk about VS Code itself@vscode how do I change keybinds?
@terminalTerminal commands@terminal find files > 100MB
@githubGitHub knowledge@github open PRs assigned to me

# Context variables

Cheat CodeUseExample
#fileAttach a file#file:src/index.ts
#selectionSelected code/fix #selection
#editorCurrent file/tests #editor
#terminalLastCommandLast terminal output/fix #terminalLastCommand
#codebaseWhole codebase search@workspace /explain #codebase auth

🧑‍✈️ Copilot in the IDE

Cheat CodeUseExample
TabAccept suggestionGhost-text completion
Alt+]/[Next / previous suggestionCycle alternatives
Ctrl+EnterOpen suggestions panelSee top N completions
Cmd/Ctrl+IInline chatRefactor selection

🚀 Copilot Agent (github.com)

Cheat CodeUseExample
@copilotAssign an issue to Copilot'@copilot implement this'
Plan firstAsk for plan in PR'Post a plan before pushing code'
Constrain scopeLimit files'Only touch src/api/*'

Frequently asked questions

Are these commands the same across editors?

The /commands and #variables are consistent in VS Code and JetBrains. github.com Chat supports most but not all.

Does @workspace read every file?

It uses a semantic index — huge repos may need you to point it with #file or #folder for accuracy.