Brifing

Mastering Slash Commands in GitHub Copilot

Boost your productivity with AI-powered shortcuts

The GitHub Blog2 min

1What Are Slash Commands?

Slash commands are text-based shortcuts starting with / in the GitHub Copilot app. As you type, an autocomplete menu displays available commands. Unlike CLI commands in terminals, these are designed specifically for workflow management in the app. They accelerate tasks like project navigation, session management, and customizing Copilot behavior without breaking your coding flow.

2Planning Mode (/plan)

The /plan command helps break down tasks before coding. This mode can also be selected from the 'Mode' dropdown in the chat interface. It's particularly useful for feature implementation, major refactors, or debugging scenarios. For example, when adding two-factor authentication, it identifies affected files and suggests implementation approaches, creating a roadmap for development.

3Devil's Advocate Mode (/spar)

/spar turns Copilot into a constructive critic, challenging your technical decisions. It pressure-tests architecture choices, implementation options, and migration plans. When considering Redis for caching, it might question your invalidation strategy or suggest alternative solutions. This feature acts like a virtual team member who identifies blind spots before they become production issues.

4Autopilot Execution (/autopilot)

After planning with /plan, /autopilot converts your specifications into working code. In this mode, Copilot manages the implementation steps autonomously. It's ideal for feature development, modifications, and iterations. For instance, when adding an API endpoint, it can generate all necessary code segments while maintaining context awareness throughout the development process.

5Project Navigation Commands

Unlike terminal environments, the GitHub Copilot app automatically manages project context without requiring traditional directory commands. Instead, use /sessions to switch between coding contexts or /projects to manage multiple repositories. The visual interface eliminates the need for manual file path specifications, making project navigation more intuitive for developers.

6CLI vs. App Differences

CLI slash commands focus on terminal workflows (directory management, environment settings). The Copilot app's visual interface handles these aspects automatically. While some commands like /clear and /model work in both environments, app-specific commands enable advanced features like multi-session management. This reflects the shift from terminal-first to GUI-enhanced development experiences.

7Performance Optimization

/spar critically examines performance improvements. For lazy loading implementations, it might reveal UX tradeoffs or unnecessary complexities. Copilot can suggest alternative optimization strategies and identify hidden bottlenecks. This pre-production validation helps developers avoid performance anti-patterns and maintain optimal user experience during scaling.

8Database Migrations

/spar identifies risks in database migration plans. When transitioning to managed services, it questions downtime strategies, data consistency measures, and rollback procedures. Copilot flags potential edge cases and recommends phased migration approaches. This reduces operational risks and helps maintain service continuity during critical infrastructure changes.

9Productivity Impact

Slash commands fundamentally transform developer workflows with GitHub Copilot. They minimize context switching, automate routine tasks, and validate complex decisions. 2023 data shows developers using these commands report up to 35% faster project completion times. By integrating planning, validation, and execution tools, these features represent a significant evolution in AI-assisted development environments.

Original article: The GitHub Blog — GitHub Copilot'da Slash Komutlarıyla Çalışma Rehberi