What Are GitHub Copilot CLI Slash Commands?
If you've just started exploring GitHub Copilot CLI, you've probably noticed that the terminal interface feels more powerful than a typical command line. One of the biggest reasons for that is slash commands — a set of built-in controls that let you direct Copilot's behavior without leaving the terminal environment.
Slash commands are prefixed with a forward slash (/) and can be entered directly into the Copilot CLI prompt. Think of them as your personal control panel for everything from switching AI models to managing conversation context and reviewing past sessions. Instead of hunting through menus or configuration files, you get instant control at your fingertips.
This article is part of the ongoing GitHub Copilot CLI for Beginners series. If you haven't already, it's worth checking out the earlier installments covering how to get started with Copilot CLI and when to use interactive versus non-interactive mode. This edition focuses entirely on slash commands — what they are, why they matter, and how to put them to work.
Why Slash Commands Matter for Developers
When you're deep in a development workflow, context switching is expensive. Every time you leave the terminal to check documentation, adjust settings, or look up a previous session, you lose momentum. Slash commands are designed to eliminate that friction entirely.
By keeping everything accessible from a single interface, slash commands allow you to:
- Guide Copilot's behavior in real time by giving it additional context or instructions without starting a new session.
- Inspect and review changes to understand what Copilot is doing and how it's interpreting your inputs.
- Manage conversation context so Copilot stays focused on the task at hand instead of drifting off course.
- Move efficiently across sessions, resuming previous conversations or clearing the slate to start fresh.
- Control model selection, switching between AI models depending on the complexity or type of task you're working on.
- Monitor token usage, giving you visibility into how much of the context window you've consumed.
This level of control matters because not every task requires the same approach. A quick shell script lookup is a very different task from debugging a complex multi-file codebase. Slash commands let you adapt Copilot's behavior dynamically rather than being locked into a single configuration.
Common Slash Commands You Should Know
Let's walk through some of the most useful slash commands you'll encounter when working with GitHub Copilot CLI. Understanding these early will make your daily workflow noticeably smoother.
/help
The /help command is the perfect starting point. It displays a list of all available slash commands along with brief descriptions of what each one does. Whenever you're unsure of what's available or how a specific command works, /help is your first stop. It's especially useful when you're still building familiarity with the interface and don't want to break your flow by searching external documentation.
/model
One of the most practical slash commands available is /model. This command lets you switch between the different AI models that GitHub Copilot supports, all without restarting your session or touching a configuration file. Different models carry different strengths — some are optimized for speed, others for deeper reasoning or more nuanced code generation. If you're working on a straightforward autocomplete task, a lighter model might be ideal. For complex architectural questions or tricky bug fixes, switching to a more powerful model can yield significantly better results. The ability to make that switch on the fly is a genuine productivity advantage.
/tokens
Every AI model operates within a context window — a limit on how much text it can process at once. The /tokens command gives you a live view of your current token usage within the session. This is particularly important for longer conversations or when you're providing large amounts of code as context. If you're approaching the limit, you'll know it's time to clear the context or start a new session rather than risk the model losing important details from earlier in the conversation.
/clear
Sometimes the cleanest move is to start fresh. The /clear command wipes the current conversation context, giving Copilot a blank slate. This is useful when you've finished one task and are moving on to something unrelated, or when the conversation has drifted in a direction that's no longer helpful. Clearing context helps keep Copilot focused and prevents earlier instructions from bleeding into new tasks.
/resume
On the opposite end of the spectrum, /resume lets you pick up where you left off. If you closed a session and need to return to a previous conversation, this command restores that context. This is invaluable for longer-running projects where continuity matters — you won't have to re-explain what you were working on or reconstruct context from scratch.
Tips for Getting the Most Out of Slash Commands
Knowing the commands is one thing; using them effectively is another. Here are a few practical tips to help you build good habits early.
- Use
/helpregularly as Copilot CLI evolves. New commands are added over time, and staying current means you won't miss useful new features. - Monitor token usage proactively with
/tokensrather than reactively. Checking it periodically during a long session prevents unexpected context loss. - Switch models intentionally. It's tempting to always reach for the most powerful model, but matching the model to the task keeps things fast and efficient.
- Develop a session hygiene habit. Use
/clearbetween distinct tasks and/resumewhen continuity matters. Treating sessions deliberately leads to more consistent and reliable results from Copilot.
Building Confidence with Copilot CLI
Slash commands represent one of the most accessible on-ramps to becoming genuinely productive with GitHub Copilot CLI. They remove the need to memorize complex configuration options or rely on external tools, putting everything you need to control Copilot directly at the command line where you're already working.
As you continue exploring the GitHub Copilot CLI for Beginners series, you'll find that these commands become second nature quickly. The more you use them, the more natural it feels to shape Copilot's behavior in real time — adapting your AI assistant to your workflow rather than the other way around.
Whether you're switching models mid-session, keeping an eye on token usage, or resuming a conversation from yesterday, slash commands keep you in control without breaking your stride. Start experimenting with them today and see how much smoother your terminal-based AI workflow can become.
