Skip to content

The Best Claude Code Slash Commands to Set Up in 2026

The built-in and custom Claude Code slash commands worth knowing in 2026 — context, cost, model switching, clear, plus custom commands you should build.

MGMCSA Guru Team June 8, 2026 5 min read
A list of useful Claude Code slash commands shown in a terminal menu

Slash commands are how you steer a Claude Code session without leaving the keyboard. Some are built in — managing context, cost, models, and connected tools — and some you write yourself. Knowing the right handful turns Claude Code from something you type paragraphs at into something you actually drive.

This is the shortlist: the built-in commands worth committing to muscle memory, and the custom ones most people should build. Command sets evolve between releases, so run /help in your version to see exactly what’s available — but the categories below are stable.

Built-in commands worth memorizing

These ship with Claude Code and handle the mechanics of a session.

Daily-driver built-in commands

/context Show how the context window is allocated
/clear Reset the conversation and free the window
/compact Summarize the conversation to reclaim space
/model Switch models without restarting
/mcp List connected MCP servers and their tools
/agents Manage and inspect subagents
/hooks Add and review hooks
/help List every available command

/context and /clear — the two you’ll lean on most

/context shows where your window is going — system, tools, conversation. When responses start feeling vague or the session slows, check it first. Often the culprit is a bloated conversation or too many connected MCP servers, which this guide on MCP context cost gets into.

/clear is the reset button. When a session has wandered and accumulated junk, clearing it and re-stating just the relevant context is faster than fighting a cluttered window. Make it a reflex between unrelated tasks.

/compact — continuity without the bloat

When you want to keep going but the window is filling, /compact summarizes the conversation so far and frees space while preserving the gist. The difference from /clear: compact keeps continuity, clear throws it away. Use compact mid-task, clear between tasks.

/model — switch tiers on the fly

/model changes the model without restarting the session. Drop to a cheaper, faster model for routine edits and bump back up for a hard problem. If you route through a proxy, the available names reflect your config — see the Claude Code Router setup and the cheap-models guide for that.

Commands for managing your setup

These don’t do work; they show you the state of your tools.

/mcp lists connected servers and the tools each exposes — your first stop when a server isn’t behaving or you’re auditing context cost. /agents opens subagent management, scaffolding new ones and showing which are available. /hooks walks you through adding hooks without hand-editing JSON. Together they’re how you inspect and tune the extension points covered in the power-user guide.

Custom commands you should build

Built-ins handle the session; custom commands handle your repeated prompts. The mechanics — a markdown file in .claude/commands/ — are in creating custom slash commands. Here’s what’s worth building:

  • /review — your code-review prompt applied to current changes. The single most useful custom command for most teams.
  • /commit — generate a commit message in your house format.
  • /test — write tests for a given file following your conventions.
  • /explain — explain a file or module, taking the path as an argument, for onboarding or unfamiliar code.
  • /pr-desc — draft a pull request description from the branch’s diff.
  • /security — a focused security pass over the current changes.
Review the current changes for bugs, missing error handling, and
security issues. Point to a file and line for each finding and rank
them: blocker, should-fix, nitpick. If the change is clean, say so.

A practical starter set

You don’t need every command on day one. Learn these built-ins and build these custom ones:

Slash command starter set

  • Built-in: /context, /clear, /compact for managing the window
  • Built-in: /model to switch tiers, /mcp and /agents to inspect tools
  • Custom: /review for code review on demand
  • Custom: /commit for your commit message format
  • Custom: /explain with an argument for unfamiliar code
  • Run /help to see everything your version offers

Wrapping up

The built-in commands you’ll actually use boil down to a handful: /context and /clear to manage the window, /compact for continuity, /model to switch tiers, and /mcp and /agents to inspect your tools. Layer on a few custom commands for the prompts you repeat — /review and /commit first — and you’re driving Claude Code instead of typing at it.

To build the custom ones, follow creating custom slash commands; to see where commands fit among skills, hooks, and subagents, the power-user guide ties it together.

Frequently asked questions

What are the most useful built-in Claude Code slash commands?

The ones you'll use daily are /context to see how the window is allocated, /clear to reset the conversation, /model to switch models, /mcp to check connected servers, and /agents to manage subagents. /cost or the status line helps track spend. These cover most session management.

How do I clear context in Claude Code?

Use /clear to reset the conversation and free the context window. It's the fastest fix when a session has accumulated too much history and responses are degrading. Start fresh and re-state only the context that still matters.

Can I make my own slash commands?

Yes. Drop a markdown file in .claude/commands/ and its filename becomes a command. The file contents are the prompt that runs. See the guide on creating custom slash commands for arguments and namespacing.

How do I switch models mid-session?

Use /model to change the model without restarting. It's useful for dropping to a cheaper model for routine work and switching back to a stronger one for hard problems. The available names depend on your setup and any router you use.

What's the difference between /clear and /compact?

/clear wipes the conversation and starts fresh. /compact summarizes the existing conversation to reclaim space while keeping the gist. Use compact when you want continuity, clear when you want a clean slate.

Sources & further reading

Official vendor documentation referenced while writing this guide.

MG

MCSA Guru Team

IT & Systems Administration

We are working IT pros and system administrators who spend our days in Windows Server, Microsoft 365, and the wider Microsoft stack. MCSA Guru is where we write down the fixes and walkthroughs we wish we had found the first time.

MCSA Guru provides independent, educational IT guidance. Microsoft, Windows, Windows Server, Microsoft 365, Exchange, and Microsoft Teams are trademarks of Microsoft Corporation; Docker is a trademark of Docker, Inc. MCSA Guru is not affiliated with or endorsed by Microsoft or Docker. Always test changes in a safe environment before applying them in production.

Related guides

Fixing something right now?

Jump straight into the guide library or search for the exact error or task you are dealing with.