Claude Code has dozens of slash commands. A handful keep me in flow, so those come first. The rest are organized by the moment you need them, from setting up a project to shipping and automating the work.

My go-to five

These are the built-in commands and settings that show up most in my own Claude Code history since June 2026. Each one saves me a stop: an approval, a copy-paste or a restart.

What I useWhy it stays in my routine
/clearI start fresh for each new task instead of letting unrelated work pile into one conversation
! shell modeI run a command myself and Claude reads the output, without me pasting anything
/mcpI connect the servers a project needs and turn off the ones it doesn't
/plugin and /reload-skillsI build and edit skills often, and these load changes without restarting
auto permission modeMost of my sessions run in auto mode, so long tasks don't stop for every approval

Most of what I build runs through custom skills, which you can make with the template in Repeat and automate.

Three prefixes to learn first

TypeWhat happensExample
/Runs a command or skill. It only works at the start of a message/context
!Runs a shell command yourself. The output goes into the conversation and Claude responds to it! npm test
@Mentions a file with path autocompleteexplain @src/auth.ts

Press ? on an empty prompt to see shortcuts. If you send a command while Claude is working, it waits until the turn ends. A few, like /usage, run right away.

Set up a project

CommandWhat it doesUse it when
/initGenerates a starter CLAUDE.md for the projectIt's your first session in a repository
/memoryEdits CLAUDE.md files and turns auto memory on or offClaude keeps missing a project convention
/permissionsManages allow, ask and deny rules for toolsYou approve the same safe command over and over
/mcpConnects, signs in to, enables or disables MCP serversYou add a server or want to trim unused ones
/modelSwitches the model and saves it as your defaultA task needs more capability or more speed
/importBrings settings from Codex, Gemini CLI or CursorYou're moving over from another coding agent

Plan and run a task

CommandWhat it doesUse it when
/plan [task]Enters plan mode so Claude investigates and proposes before editingThe change is large or touches unfamiliar code
/goal <condition>Keeps Claude working across turns until a separate model confirms the condition is metThe end state is verifiable, like "all tests pass"
/effort <level>Sets reasoning effort, from low to maxThe task is harder or simpler than usual
/fastToggles fast mode for quicker outputYou're iterating on small changes
Ctrl+BMoves a running command to the backgroundA build or test run is blocking the session

Permission modes decide what Claude does without asking. Press Shift+Tab to cycle through default, acceptEdits and plan.

ModeWhat runs without askingBest for
defaultReading filesSensitive work where you review every action
acceptEditsFile edits and common filesystem commandsIterating on code you're watching
planReading and planningExploring before changing anything
autoEverything, with background safety checksLong tasks with fewer interruptions
dontAskOnly pre-approved tools. Everything else is deniedScripts and CI
bypassPermissionsEverythingIsolated containers and VMs only

Keep context clean

CommandWhat it doesUse it when
/contextShows what's filling the context window, with suggestionsResponses slow down or quality drops
/compact [focus]Summarizes the conversation to free space. Add what the summary should keepA long task still has work left
/clearStarts a fresh conversation. Project memory staysYou're switching to an unrelated task
/btw <question>Answers a side question from what's already in context, without adding to historyYou need a quick answer mid-task

/btw works even while Claude is busy, but it can't read files or run commands. To add instructions mid-task, type your message and press Enter. Claude Code queues it for Claude. Press Esc to interrupt instead.

Undo, branch and resume

CommandWhat it doesUse it when
/rewind or Esc EscRolls code, conversation or both back to an earlier checkpointClaude went the wrong way
/branch [name]Branches the conversation at this pointYou want to try another approach without losing this one
/resumeOpens a picker of earlier sessionsYou're returning to past work
/rename [name]Names the session so you can find it laterThe session matters beyond today
/exportSaves the conversation as plain textYou want a record outside Claude Code

Checkpoints have limits. They don't track files changed by shell commands or edits made outside Claude Code. Commit to git before risky work.

From your terminal, claude -c continues the most recent conversation in the current folder, and claude -r "<name>" resumes a specific one.

Run work in parallel

CommandWhat it doesUse it when
/tasksLists background work in this session, including finished subagentsYou want to check what's still running
/subtask <task>Starts a background subagent that inherits the full conversationA side task needs the same context
/fork [prompt]Copies the conversation into a new background sessionYou want to explore two directions at once
/backgroundDetaches the whole session to keep running and frees your terminalA long task doesn't need you watching
/batch <instruction>Splits a codebase-wide change into parts that run in separate worktreesA migration or refactor touches many files

Starting Claude with claude -w puts the session in its own git worktree, so parallel sessions don't edit the same files.

Review before you ship

CommandWhat it doesUse it when
/diffShows changes in your working tree, including Claude's editsBefore you commit
/code-review [level] [--fix]Checks the diff for bugs and cleanups. --fix applies the findings. Pass a PR number to review a pull requestBefore you open or merge a PR
/security-reviewChecks your branch's changes for security vulnerabilitiesThe change touches auth, input handling or data
/simplifyReviews changed code for cleanup and applies the fixesThe code works but feels heavier than it should
/verifyBuilds and runs your app to confirm the change actually worksTests pass but you want proof in the real app

/code-review ultra runs a deeper multi-agent review in the cloud.

Repeat and automate

CommandWhat it doesUse it when
/loop [interval] [prompt]Repeats a prompt while the session stays openYou're watching a deploy or a flaky test
/scheduleCreates cloud routines that run with no open sessionWork should happen nightly or every morning
/hooksShows hooks that run scripts on events, like after every editA rule must hold every time, not just when Claude remembers
claude -p "prompt"Runs one prompt without the interactive interface and exitsYou're scripting Claude Code or running it in CI
OptionRuns onNeeds an open sessionShortest interval
/loopYour machineYes1 minute
/scheduleThe cloud, on a fresh cloneNo1 hour

Make your own command. Save instructions to .claude/skills/<name>/SKILL.md and they become /<name>. Older files in .claude/commands/ still work the same way.

PROMPT / COPY-PASTE
---
name: pre-pr
description: Prepare this branch for a pull request.
---

1. Run the test suite and fix any failures.
2. Review the diff for bugs, missing tests and leftover debug code.
3. Draft a PR description: what changed, why, and how to test it.
Ask me before pushing or opening the PR.

Check usage and setup

CommandWhat it doesUse it when
/usageShows session cost, plan limits and activityYou're near a limit or tracking spend
/insightsGenerates a report on how you've used Claude Code recentlyYou want to find patterns in your sessions
/skill-doctorShows each skill's context cost and how often it's usedYour setup feels bloated
/doctorChecks your installation and configuration and can fix issuesSomething isn't loading or behaving right
/release-notesShows what changed in each versionA command behaves differently than you remember

Keyboard shortcuts

ShortcutAction
EscInterrupt Claude or close a dialog
Esc EscClear your draft, or rewind
Shift+TabCycle permission modes
Option+P / Alt+PSwitch model
Option+T / Alt+TToggle extended thinking
Ctrl+BSend a running task to the background
Ctrl+OOpen the transcript viewer
Ctrl+RSearch your prompt history
Ctrl+GWrite your prompt in your text editor
Ctrl+SStash your prompt and restore it later
Ctrl+VPaste an image
\ then Enter, or Ctrl+JNew line without sending

On macOS, Option shortcuts require setting Option as Meta in your terminal.

Go deeper: Claude Code commands reference · MCP vs CLI · Claude, End to End · Routine vs Schedule vs Loop

Last checked against Claude Code's command reference on September 17, 2026. Available commands depend on your version, plan and platform. Type / in a session to see yours.