A beginner's guide to Copilot CLI slash commands
By GitHub
Categories: Product, Tools
Summary
GitHub Copilot CLI offers 10+ slash commands that let developers control model selection, manage token usage, and scope context—essential for optimizing AI assistance across different project phases without restarting sessions.
Key Takeaways
- Use '/model' to switch between AI models with different capabilities: lightweight models for refactoring tasks versus reasoning-heavy models for feature planning. Cost multipliers are displayed to identify plan-included vs. paid options.
- Monitor token consumption with '/context' to view remaining tokens, system usage, and buffer. Proactively use '/compact' to summarize conversations before hitting limits, or let Copilot compress automatically.
- Use '/resume' to restore previous sessions (local and remote) and continue work within the same context, eliminating context loss when switching between tasks or projects.
- Switch project scope with '/cwd' to change working directory without exiting Copilot, or keep it scoped to specific folders within a repo for granular control.
- Reset tool permissions with '/reset-allowed-tools' after moving to new repositories—essential security practice when transitioning from permissive to restrictive environments.
Topics
- Copilot CLI Slash Commands
- AI Model Selection Strategies
- Token Management in LLM Applications
- Context Window Optimization
- Developer Tool Permissions
Transcript Excerpt
Hey everyone! Welcome back to the GitHub Copilot CLI beginner series. In this video, we’re going to do a whole overview of the CLI’s slash commands. So let’s get started. Slash commands are the control surface within Copilot CLI. They help you steer, inspect changes, manage context, switch sessions, and keep permissions tidy. Let’s take a rapid-fire look at some of the popular ones. To look at all of the slash commands, just type “/” and you can scroll through the options. If you want to change ...