Tool brief · June 17, 2026
GitHub Copilot CLI slash commands: control the agent loop from your terminal
The tool
GitHub Copilot CLI slash commands
What it is
Slash commands are typed directives inside the GitHub Copilot CLI session — /model, /clear, /resume, /diff, /mcp, and so on — that control the agent without you having to phrase a natural-language prompt. Unlike natural language prompts that invoke the AI model, slash commands trigger predictable, repeatable actions for session management, configuration, and workflow automation. Think of them as the agent loop's equivalent of git subcommands: deterministic levers around a non-deterministic model.
The Monday-morning test
You're mid-debug on a flaky eval harness. You ask Copilot to patch the retry logic, it does, you want to see exactly what it touched before you let it keep going. Run /diff to see recent updates — a clear view of what modifications were made during your session, so you can validate changes before moving forward. If the context has drifted, /clear resets your environment entirely, and /resume brings back a previous session. That's the change: fewer cat-and-grep detours, fewer "wait, what did the agent edit?" moments.
For SDK work specifically: /cwd lets you change working directory across repositories without exiting Copilot — useful when you're cross-referencing a client SDK against the service repo in the same session.
Pricing
Verified via GitHub's pricing page. Copilot CLI is included as a core feature of all GitHub Copilot plans (Free, Pro, Pro+, Max, Business, and Enterprise) — access is included as part of your Copilot subscription. The Free plan supports CLI and agent mode, but note that billing moved to a credit model: only chat, agent mode, pull request reviews, and Copilot CLI draw from your monthly credit pool, and Copilot Pro is $10/month including $10 in monthly AI Credits; Pro+ is $39/month including $39 in monthly AI Credits.
Translation: slash commands themselves cost nothing extra, but every agent turn they wrap around still burns credits. Watch /usage.
What we'd actually use it for
Three honest uses, narrower than GitHub's "terminal AI assistant" pitch:
Reviewing agent edits before they compound. /diff after each meaningful turn. If you skip this, you end up with a 200-line patch you can't reason about.
Model swapping mid-task. You can switch models during an interactive session using the /model slash command — handy when a cheaper model can't reason about your eval but you don't want to burn premium credits on boilerplate scaffolding.
MCP server hygiene. The CLI cross-references per-server MCP tool token costs within the /mcp and /context views, which is the only sane way to figure out which MCP server is silently eating your context window.
Limits
- It's still an agent loop. Slash commands don't make the model deterministic; they make the scaffolding deterministic. Same hallucinations, same need to read every diff.
- Context window is real. Each AI model has a maximum context window that limits how much conversation history it can process; the CLI tracks token usage against these limits to determine when compaction is necessary. Long sessions either need
/compactor a/clearand resume from notes. - Org policies override your model picker. In managed environments, the CLI handles model restrictions through filtering in the
/modelpicker and fallback behavior — so what you see locally may not be what your teammate sees. - Not a replacement for proper eval tooling. Slash commands help you steer one session. They don't give you reproducible runs, golden datasets, or regression tracking. Pair with a real eval harness.
Try it if
- You live in tmux and resent every context switch to a browser-based chat.
- You're building or debugging MCP servers and need
/mcpand/contexttoken visibility. - You want a
/diff-gated workflow before letting the agent touch your repo further. - Your team already pays for Copilot and you're not using the CLI yet — it's included.
Skip it if
- You need reproducible agent runs for evals — slash commands are session-scoped, not scriptable pipelines.
- You're on Copilot Free and already bumping the credit ceiling; the CLI will accelerate that.
- Your org restricts model access tightly enough that
/modelis mostly empty. - You prefer a fully scripted CLI (
gh copilot suggest-style one-shots) over an interactive agent — that's a different tool.
The full command list and behavior is in GitHub's cheat sheet to slash commands in Copilot CLI, and the canonical reference lives in the Copilot CLI command reference. Read both before you wire this into a daily workflow.
Source: github.blog