Slash Commands: Your Control Surface for Copilot CLI

GitHub Copilot CLI exposes a set of built-in controls called slash commands that let you manage your sessions directly from the terminal. These commands let you guide Copilot’s behavior, inspect what it has changed, manage how much context it retains, and move between projects—without ever leaving the command line.

To see everything that’s available, simply type / at the prompt and you’ll get a scrollable list of all currently supported slash commands. Here’s a look at the most useful ones.

Picking the Right Model for the Job

Different tasks call for different models. Type /model to see a list of available models along with details that can inform your choice:

  • Capabilities: Some models are optimized for lighter, quicker jobs like refactoring, while others are better suited for deeper reasoning such as feature planning.
  • Availability: The list can change depending on your plan or your organization’s settings.
  • Cost: Each model displays a cost multiplier, so you can balance performance against usage when working under a particular plan.

Keeping an Eye on Context and Tokens

Copilot CLI works within a context window that defines how much it can remember during a session. Type /context to see how many tokens you have left, along with system usage and available buffer.

If you’re running low, type /compact to summarize the current conversation and free up space. Copilot CLI can also do this automatically when you approach the limit, but running it manually is useful when you want to transition to a new task mid-session. For a complete reset, /clear wipes the session entirely.

Jumping Back Into Old Sessions

Use /resume to pick up where you left off. This brings up a list of previous sessions—both local and remote—so you can review your history and continue an earlier conversation without re-establishing context.

Reviewing What Changed

When Copilot has been editing your project, run /diff to see recent updates. This gives you a clear view of modifications made during the current session, which is handy for validating changes before you move forward.

Switching Directories on the Fly

You can work across repositories or directories without exiting Copilot. Type /cwd to change your working directory to another repo. This scopes Copilot’s work to a specific area of your project while you multitask across codebases.

Resetting Tool Permissions

If you’ve previously granted Copilot CLI permission to perform actions like editing files, you might want to revoke those when moving to a more sensitive repository. Run /reset-allowed-tools to clear those permissions and start fresh.

These commands give you more deliberate control over how Copilot works inside your terminal. Open a session, type /, and explore the full set—switching models, managing context, and navigating projects becomes routine once you know what’s available.