BrandGhost
GitHub Copilot CLI Slash Commands: Inside the Session Modes and Shortcuts

GitHub Copilot CLI Slash Commands: Inside the Session Modes and Shortcuts

A good GitHub Copilot CLI slash commands workflow feels less like memorizing a command list and more like learning how to steer an agentic terminal session. You still write prompts, review diffs, and decide what good looks like. But the session has modes, command affordances, keyboard bindings, context controls, and input shortcuts that make the difference between "chat in a terminal" and a practical coding loop.

Heads up: GitHub Copilot CLI moves fast. It went GA in February 2026 and ships updates constantly, so commands, flags, shortcuts, and available models change often. Everything here was verified against the official GitHub Copilot CLI command reference, GitHub docs, GitHub Blog, and the @github/copilot npm package page as of July 2026 -- always check the official GitHub Copilot CLI command reference for the very latest.

GitHub Copilot CLI Slash Commands Start With the Session Mental Model

The first thing to understand is that the interactive copilot session is a terminal UI, not just a prompt box. The official command reference says copilot launches the interactive interface, and that interface has global shortcuts, timeline shortcuts, slash commands, and special input prefixes. These controls matter because they shape how you work.

When I use an agentic CLI, I want fast steering. I do not want every correction to become a paragraph. Slash commands let you switch models, inspect context, compact history, review diffs, manage pull requests, change working directories, and invoke specialized capabilities without hoping the model interprets a natural-language instruction the same way every time.

That predictability is valuable for intermediate-to-senior developers. You can move between exploration, implementation, review, and session hygiene while keeping your mental stack small. If you want to build Copilot-like capabilities yourself, start with the GitHub Copilot SDK for .NET guide.

Copilot CLI Plan Mode, Standard Mode, and Autopilot Mode

The current docs and command reference describe three interactive modes: Standard, Plan, and Autopilot. GitHub's GA announcement calls out this mode-based workflow as part of the terminal agent experience. You cycle between modes with Shift+Tab, and that shortcut changes the posture of the session.

Standard mode is the normal conversational loop. You ask for help, Copilot responds, and you keep steering. Use it for targeted questions, short refactors, file inspections, or asking the agent to explain a failing test before touching code.

Plan mode is for shaping work before edits. GitHub's docs say you can press Shift+Tab to move into plan mode, where Copilot collaborates on an implementation plan before code is written. For a multi-file change, this is the mode I would reach for first.

Autopilot mode is for hands-off execution. The official Autopilot docs frame it as a mode where Copilot works through a task autonomously until it completes, hits a problem, you stop it, or a continuation limit is reached. I am not going deep on the permission model here because that deserves its own treatment. The practical takeaway is simpler: use Autopilot only when the task is bounded, the repo has validation, and you are prepared to review the result carefully.

# Interactive session flow
copilot

# Press Shift+Tab to cycle:
# Standard -> Plan -> Autopilot -> Standard

The tradeoff is not mysterious. Standard gives you frequent steering. Plan gives you alignment. Autopilot gives you throughput. That maps naturally to planning and execution concepts from Microsoft Agent Framework in C#: define the goal, constrain the tools, run the work, then inspect the output.

Key GitHub Copilot CLI Slash Commands for Daily Flow

The official command reference is long, and that is good. But a practical tour should start with the commands you will reach for constantly.

Use /model when the task changes. As of the July 2026 check, the current @github/copilot npm page for package version 1.0.68 says the default model is Claude Sonnet 4.5, and the command reference says /model or /models [MODEL] selects the model or Auto. Treat that default as volatile, not a contract. Run /model to see what your installation and organization policy currently allow.

Use /context when a session starts feeling fuzzy. GitHub's context-management docs explain that the context window contains your messages, Copilot responses, tool calls, results, system instructions, and tool definitions. /context visualizes the active model and token usage, including system prompt, custom instructions, tools, messages, free space, and buffer.

Use /compact when you want to summarize the conversation history and free context. The docs say Copilot auto-compacts in long sessions, but manual compaction is useful before a new phase. You can add focus instructions, such as /compact focus on the auth module, so the summary preserves what matters.

/model
/context
/compact focus on the current failing integration test and the files already edited

Those three commands make the session feel operational instead of decorative. You can steer capability, inspect context pressure, and reset the session's working memory without starting over.

Review, Diff, and Pull Request Slash Commands

Once the agent changes code, the session has to become review-oriented. /diff and /review are the checkpoint pair I would treat as the default.

The command reference says /diff reviews changes in the current directory and can auto-switch to a branch diff when the working tree is clean, with that branch-diff behavior marked experimental in the reference. The GA changelog describes /diff as an inline diff review surface for inspecting session changes, adding comments, and toggling between session changes and branch diffs.

/review [PROMPT] runs the code review agent to analyze changes. This is not a replacement for your own review, but it is a useful second pass when you keep the prompt pointed at correctness, missing tests, race conditions, or breaking changes.

/pr [view|create|fix|auto] manages pull requests for the current branch. This article is not about PR automation in depth, but /pr rounds out the terminal session loop.

/diff
/review Focus on correctness risks and missing validation. Ignore formatting-only concerns.
/pr view

This is where the TUI feels like a development cockpit. Prompt, edit, inspect, review, and prepare the PR without bouncing across interfaces. If you are already investing in CI and package workflows, this complements the discipline you need for creating NuGet packages in .NET.

Agent Environment Commands Without Going Into Authoring

A session can also expose specialized capabilities. The key commands here are /agent, /skills, /mcp, and /plugin. I am keeping this to usage-level navigation, not custom authoring or MCP configuration, because those are separate topics.

/agent browses and selects available agents. /skills [list|info|add|remove|reload] manages skills for enhanced capabilities. /mcp [show|add|edit|delete|disable|enable|auth|reload|search] manages MCP server configuration, and /mcp search is currently experimental according to the MCP docs. /plugin [marketplace|install|uninstall|update|list] manages plugins and plugin marketplaces. In a daily session, start with read-only discovery commands like /skills list, /mcp show, and /plugin list.

/agent
/skills list
/mcp show
/plugin list

If you are thinking about more advanced agent composition, the concepts in Advanced GitHub Copilot SDK in C#: Tools, Hooks, Multi-Model, Multi-Agent provide a useful mental model. Inside the Copilot CLI session, start by observing what is available before trying to extend anything.

Working Directory, Session Resume, and Access Scope Commands

A practical TUI session needs scope control. The command reference lists /cwd, /cd [PATH], /add-dir PATH, /list-dirs, /resume, and /continue [SESSION-ID]. These matter because an agent's usefulness depends on looking at the right files.

/cwd displays or changes the working directory. /add-dir PATH adds a directory to the allowed list for file access, and /list-dirs shows the current list. /resume [SESSION-ID] and /continue [SESSION-ID] switch to another session through the session picker. Many bad AI interactions are actually bad context interactions, so check scope before rewriting your prompt.

/cwd
/cwd C:devmy-reposrc
/add-dir C:devshared-libraries
/list-dirs
/resume

For a large C# solution, I would rather change the current working directory than ask a vague prompt from the repo root. The same applies when working with testing infrastructure like mocking HttpClient in C#: point the agent at the relevant files first.

Input Shortcuts: @file, #issue or PR, !shell, and & Delegation

Not everything is a slash command. Some of the most useful inputs are prefixes. The command reference lists @ FILENAME, # NUMBER, and ! COMMAND as global shortcuts, and the delegation docs describe prefixing a prompt with & to send work to the Copilot cloud agent.

Use @file to include file contents in context. The usage docs show examples like Explain @config/ci/ci-required-checks.yml or Fix the bug in @src/app.js. The TUI offers matching paths as you type.

Use #issue or #PR by number to include a GitHub issue or pull request in the context. This is one of those small affordances that makes the CLI feel connected to GitHub instead of bolted onto it.

Use !shell to execute a local shell command directly, bypassing the model. The docs also say entering ! alone on an empty prompt enters shell mode for multiple shell commands. This is convenient when you want to check git status, run a known test command, or inspect the environment yourself.

Use & when you want to delegate a prompt to the Copilot cloud agent. The official delegation docs say & complete the API integration tests... is shorthand for /delegate. That runs remotely and opens a draft pull request. Since this article is about the interactive local session, I would treat & as an escape hatch, not the default.

Explain @src/LinkDotNet.Blog.Web/Program.cs
Summarize #123 and tell me what files are likely involved.
!git status --short
& update the docs for the completed refactor and open a draft PR

The pattern is simple: use @ for file specificity, # for GitHub issue or PR context, ! when you know the exact shell command, and & when the work should leave your local session.

Keyboard Bindings That Make the TUI Feel Fast

The TUI is keyboard-first. The official command reference lists many shortcuts, but a few change the feel of the session quickly.

Shift+Tab cycles between Standard, Plan, and Autopilot. Ctrl+T expands or collapses reasoning display in responses. The GitHub Blog GA post also calls out configurable reasoning visibility and model choice, so this is part of the intended terminal experience.

For composing prompts, the current command reference lists Ctrl+G and Ctrl+X then e as ways to edit the prompt in an external editor. It also lists Ctrl+X then / for running a slash command after you have already started typing a prompt. The GitHub Blog GA post says Ctrl+X, Ctrl+E opens your preferred terminal editor; I treated the command reference as authoritative for the current binding sequence.

For flow control, Ctrl+Q or Ctrl+Enter queues a message while the agent is busy. Ctrl+R reverse-searches command history. Ctrl+L clears the screen. Ctrl+X then b backgrounds a running task or shell command. Familiar text-editing bindings are there too: Ctrl+A, Ctrl+E, Ctrl+U, Ctrl+K, Ctrl+W, and word movement with Alt or Option plus arrow keys.

These shortcuts are not trivia. They reduce friction. The more the CLI feels like a real terminal application, the more likely you are to stay in flow.

Context Management and Auto-Compaction in Long Sessions

Long sessions are where explicit context commands can save you from subtle drift. The context docs explain that every message, response, tool call, result, system instruction, and tool definition consumes the model's context window.

/context is your visibility tool. Use it when a session has been running for a while, when Copilot seems to forget earlier constraints, or when you are about to start a new phase of work. It shows the active model and token usage across the different context categories.

/compact is your reset-with-continuity tool. The docs say Copilot CLI automatically starts compacting in the background when the conversation reaches approximately 80% of context capacity. If the context fills to approximately 95% before compaction finishes, the CLI pauses briefly for compaction to complete. Manual /compact lets you do that intentionally.

Compaction is not magic memory. GitHub's docs are clear that fine-grained details can be lost because compaction summarizes. My rule of thumb is to compact at phase boundaries and add focus instructions when you care about specific files, test failures, decisions, or constraints.

/context
/compact Preserve the chosen approach, edited files, failing test names, and remaining validation steps.
/session checkpoints

Checkpoints are created when compaction happens, and /session checkpoints lets you inspect them. For complex agent work, you need to know what state the agent thinks it has.

If you are designing your own AI agent systems, the same pressure shows up in custom agents and evaluation loops. Evaluating AI agents with Microsoft.Extensions.AI.Evaluation in C# is a useful related read because context quality and behavior quality are connected.

Experimental Commands to Label Carefully

Because Copilot CLI changes quickly, label experimental features instead of presenting them as stable workflow primitives. Based on the current official references I checked, /every and /after are only available in experimental mode. /mcp search is also documented as experimental in the MCP docs. /fleet has official concept and how-to pages, but I would still treat it as an advanced workflow command because it changes task execution by involving parallel subagents and can increase AI credit usage.

/every [INTERVAL PROMPT] schedules a recurring prompt, and /after [DELAY PROMPT] schedules a one-time prompt. The command reference marks both as experimental. /mcp search discovers and installs MCP servers from the registry, not arbitrary source-code search, and the MCP docs explicitly say it is experimental. /fleet [PROMPT] enables parallel subagent execution. The tradeoff is that parallel subagents can be faster when work decomposes well, but they can also use more AI credits and add orchestration complexity.

The point is not to avoid advanced commands. The point is to name the risk correctly. Stable session hygiene commands like /context, /compact, and /diff belong in everyday flow. Experimental scheduling or advanced parallel execution should be used deliberately.

What the Copilot CLI TUI Feels Like in Practice

In practice, the TUI feels best when you stop treating it as a chatbot and start treating it as a controllable workbench. The difference is posture.

A weak session starts with "fix this project" and then waits. A stronger session starts in the right directory, references a specific file with @, uses Plan mode for scope, runs known shell checks with !, reviews output with /diff, asks /review for a focused second pass, and compacts before changing phases.

The rhythm looks like this: orient, plan, execute, inspect, validate, compact, continue. Slash commands give you explicit controls at each point in that rhythm. They do not make judgment unnecessary. They make judgment easier to apply because you have better levers.

Wrapping Up: Use GitHub Copilot CLI Slash Commands as Steering Controls

The best way to learn the command surface is not to memorize every command in the reference. Start with the session controls that change outcomes: Shift+Tab for modes, /model for model selection, /context and /compact for context management, /diff and /review for change inspection, /cwd and /add-dir for scope, and /resume for continuity.

Then layer in the input prefixes: @file for exact file context, #issue or #PR for GitHub context, !shell for commands you already know, and & for cloud delegation when local interactive work is not the right shape.

The TUI is powerful because it combines natural-language collaboration with deterministic controls. Use the natural language for intent. Use the slash commands and shortcuts for steering. That combination is where the Copilot CLI starts to feel like a serious agentic developer tool instead of another chat window.

FAQ

What are the most important GitHub Copilot CLI slash commands to learn first?

Start with /model, /context, /compact, /diff, /review, /cwd, /add-dir, and /resume. Those commands cover model selection, context hygiene, change review, working-directory scope, and session continuity. Add /agent, /skills, /mcp, and /plugin when you need to inspect loaded capabilities.

How do I switch between Standard, Plan, and Autopilot modes?

Press Shift+Tab inside the interactive session. The current command reference says this cycles between standard, plan, and autopilot mode. Use Standard for tight steering, Plan before multi-step work, and Autopilot for bounded tasks where you want Copilot to continue working with less interaction.

When should I use /compact instead of starting a new session?

Use /compact when the task is still related and you want continuity with less context pressure. Start a new session when switching to unrelated work or when earlier summaries are pulling the agent in the wrong direction.

Is /mcp search stable in GitHub Copilot CLI?

As of the official docs checked in July 2026, /mcp search is documented as experimental. You need --experimental or /experimental on to use it. Label it correctly and verify the current docs before teaching it.

Is /fleet the same thing as Autopilot?

No. /fleet is about parallel subagent execution. Autopilot is about letting Copilot continue working autonomously. The official fleet docs say they are distinct but often used together after an implementation plan.

Can I run shell commands directly inside the Copilot CLI session?

Yes. Prefix a prompt with ! to run a shell command directly, bypassing the model. Entering ! alone on an empty prompt enters shell mode for multiple shell commands.

Why do GitHub Copilot CLI slash commands matter if I can just write prompts?

Prompts are flexible, but slash commands are explicit. They give you repeatable controls for context, mode, model, review, working directory, skills, plugins, MCP visibility, sessions, and pull requests. That makes the interactive session more predictable.

The Old gh copilot Is Retired: Migrating to the New GitHub Copilot CLI

Need a gh copilot suggest replacement? Migrate from the retired GitHub CLI extension to the new GitHub Copilot CLI agent workflow safely and with confidence.

GitHub Copilot CLI: The Complete Guide to the Agentic Terminal Agent

GitHub Copilot CLI guide for senior developers: install, modes, MCP, models, headless automation, permissions, and practical .NET workflow tradeoffs today.

Build an AI CLI Developer Tool with GitHub Copilot SDK in C#

Build an AI CLI developer tool with GitHub Copilot SDK in C#. Learn CopilotClient, AIFunctionFactory tools, streaming responses, and session management.

An error has occurred. This application may no longer respond until reloaded. Reload