Claude Code Commands & Prompt Reference

157 commands & parameters · 3 categories · Sources: Claude Code Docs — Commands (current for Claude Code v2.1.296) and 3 more · Checked

Slash commands, prompt input prefixes and hook events of Claude Code, checked against the official commands, interactive-mode and hooks references as published for v2.1.296 (October 2026). Arguments keep the vendor's notation: <path> is required, [name] optional. Rows marked bundled skill are prompts handed to Claude, not coded commands. A command runs only at the start of a message, and some depend on plan or platform. Keyboard shortcuts and CLI flags are on the Claude Code shortcuts page.

Also see: Claude Code keyboard shortcuts & CLI flags.

All Commands

Built-in Slash Commands (119)

Command / SyntaxWhat it doesNotes
/add-dir <path>Add a working directoryPartial paths get suggestions and Tab accepts one; most .claude/ configuration in that folder is not picked up.
/advisor [model|off]Toggle the advisor modelAccepts fable, opus or sonnet, or any full model ID; run it bare for a picker.
/agentsSubagent setup reminderNow only prints a hint to ask Claude or edit .claude/agents/; v2.1.197 and earlier opened a management interface.
/artifact-capabilitiesArtifact capabilities referenceBundled skill listing what a published page can do on your account, such as calling connectors or offering downloads.
/artifact-diagrammingArtifact diagram guidanceBundled skill on when a diagram helps and how to keep inline SVG readable in light and dark themes.
/artifactsBrowse your artifactsPick an owned or shared artifact, then attach it here, open it in a browser or copy the link.
/auto-mode-setupDraft auto mode environmentBuilds autoMode.environment entries from the project and recent sessions for review; needs Pro, Max or Team and v2.1.228+.
/autocompact [auto|<tokens>]Auto-compact thresholdTakes a size like 500k, or auto for the model's tuned default; the value is saved to user settings.
/autofix-pr [prompt]Auto-fix the branch's PRRuns in the cloud, fixing CI failures and review comments on the open PR; a prompt changes its instructions, gh required.
/background [prompt]Send session to backgroundFrees the terminal while the session keeps running as an agent; claude agents monitors it, and /bg is an alias.
/batch <instruction>Parallel codebase-wide changeBundled skill: once you approve its plan, 5 to 30 subagents each build one unit in their own worktree.
/branch [name]Branch the conversationSwitches you into the new branch and keeps the original for /resume, unlike /fork, which runs a background copy.
/btw [question]Ask a side questionThe answer never enters the conversation history; run it bare to reread your latest side question.
/bug [report]Report a bugA consent screen sets how much history is sent; on third-party providers the report is saved locally. Alias /share.
/cd <path>Change working directoryMoves the session to another folder without losing the conversation; Tab accepts a suggested path.
/chromeClaude in Chrome settings
/claude-api [migrate|upgrade|managed-agents-onboard|prompt-audit|cost-optimize|build-eval|hillclimb|preserved-thinking-migration]Claude API reference skillBundled skill that also loads itself when your code uses an Anthropic SDK (anthropic or @anthropic-ai/sdk); subcommands like migrate run one task.
/claude-in-chrome [task]Run a browser taskBundled skill that drives Chrome to test pages, fill forms or read console logs; needs Chrome integration, e.g. claude --chrome.
/clear [name]Start a new conversationA name labels the old conversation in the /resume picker; aliases /reset and /new, while /compact keeps the thread.
/code-review [low|medium|high|xhigh|max|ultra] [--fix] [--comment] [--max-findings n|all|default] [pr#|branch|path]Review the diff for bugsBundled skill: --fix applies findings, --comment posts them to the PR or merge request, ultra runs a deep cloud review.
/color [color|default]Prompt bar colorEight colors from red to cyan are offered; default resets, and running it bare picks a random one.
/compact [instructions]Summarize to free contextOptional instructions tell the summary what to focus on; the conversation carries on afterwards, unlike /clear.
/config [key=value ...]Open SettingsPairs such as theme=dark change a setting without the panel, also under -p; /config --help lists keys. Alias /settings.
/context [all]Show context usage gridFlags context-heavy tools and memory bloat; in fullscreen the per-item breakdown stays collapsed until you pass all.
/copy [N]Copy the last responseN picks an older reply (2 is second-to-last); with code blocks a picker opens, where w writes to a file.
/costAlias of /usageFolded into /usage and kept as a typing shortcut that opens the matching tab of that screen.
/dataviz [request]Chart design guidanceBundled skill: picks chart forms, colors by role and checks the palette for colorblind safety with a bundled script.
/debug [description]Debug the sessionBundled skill; logging starts when you run it unless you launched with claude --debug, and a description narrows the analysis.
/deep-research <question>Cited web research reportBundled workflow that fans out across many subagents in the background; Claude starts it only when you invoke it.
/design [brief]Draft UI mockupsBundled skill that publishes artboards as a Claude Design artifact you edit in a browser and export as PNG or PDF.
/design-loginAuthorize design-system access
/design-sync [hint]Upload your design systemBundled skill converting your repo's React components for Claude Design; a first sync checks each component and can take hours.
/desktopContinue in the Desktop appNeeds macOS or x64 Windows plus a Claude subscription; alias /app.
/diffReview working-tree changesShows Claude's edits so far next to your other uncommitted work, in a side panel or a dialog depending on the renderer.
/doctor [prompt-audit [path]]Setup checkupBundled skill that finds install, settings and CLAUDE.md problems and fixes them once you confirm; prompt-audit audits instructions. Alias /checkup.
/effort [level|auto|status|ultracode [on|off]]Set effort levelLevels run low to xhigh, plus a session-only max; status prints the level, and ultracode on or off toggles ultracode.
/exitExit the CLIIn an attached background session it only detaches, leaving the session running; alias /quit.
/export [filename]Export conversation as textWith a filename it writes straight to that file; without one a dialog offers clipboard or file.
/fast [on|off]Toggle fast modeSwitching mid-turn takes effect at once, though the running turn keeps its original speed; needs v2.1.205+.
/feedback [report]Send product feedbackSame dialog and consent step as /bug; with Claude-drafted feedback on, running it bare lists the queued drafts to review.
/fewer-permission-promptsBuild a read-only allowlistBundled skill: ranks the read-only Bash and MCP calls your transcripts show most often and allowlists them in project settings.
/focusToggle focus viewHides everything but your latest prompt, a tool-call summary line and Claude's final reply; needs fullscreen rendering and persists.
/fork [prompt]Fork into a background sessionYou keep working here while the copy runs; with a prompt it starts at once, otherwise it waits in agent view.
/goal [condition|clear]Set a completion goalWork continues turn after turn until that condition holds; no argument shows the goal, and clear, stop or cancel drops it.
/heapdumpWrite a heap snapshotHidden from the menu, so type it in full; share only the -diagnostics.json file, since the snapshot holds credentials.
/helpShow help and commands
/hooksList configured hooks
/ideManage IDE integrations
/import [codex|gemini|cursor] [--dry-run] [--yes]Import other agents' configCarries over instructions, MCP servers, custom commands, subagents and skills; --dry-run previews and --yes skips the picker.
/initCreate a CLAUDE.mdCLAUDE_CODE_NEW_INIT=1 adds an interactive flow covering skills, hooks and personal memory; found Codex or Gemini config can be imported.
/insightsUsage insights reportWrites an HTML report on your projects, habits, failure points and suggested features; cloud sessions cannot run it.
/install-github-appInstall the GitHub AppSupports github.com repositories only; a GitLab or Bitbucket remote prints a notice instead of starting setup.
/install-slack-appInstall the Slack appSetup finishes in the browser through an OAuth flow.
/keybindingsOpen keybindings file
/list-agentsList messageable agentsGives the name to address each subagent, teammate or session by; needs cross-session messaging. Alias /peers.
/loginSign in to Anthropic
/logoutSign out of Anthropic
/loop [interval] [prompt]Repeat a prompt on a loopBundled skill; without an interval Claude paces itself, and without a prompt it runs the maintenance prompt or loop.md.
/mcp [reconnect (<server>|all)|enable|disable [<server>|all]]Manage MCP serversNo argument opens the server list; reconnect all retries servers that failed or need auth, and under -p it prints a status summary.
/memoryEdit memory and CLAUDE.mdAlso switches auto memory on or off and shows the entries it has saved.
/mobileMobile app QR codeScan it to get the Claude mobile app on your phone; aliases /ios and /android.
/model [model]Switch modelSaves the choice as your default; in the picker, press s to switch for this session only, and arrows adjust effort.
/output-style [style]Change output styleLists the available styles, or switches straight to one such as concise; needs v2.1.269+.
/passesShare free Claude Code weeksVisible only when your account qualifies for passes.
/permissionsManage tool permission rulesA dialog to view rules by scope, edit them, manage working directories and review auto mode denials; alias /allowed-tools.
/plan [description]Enter plan modeA description starts planning that task straight away, as in /plan fix the auth bug.
/plugin [subcommand]Manage pluginsNo argument opens the plugin menu; subcommands like list, install, enable or disable act directly.
/plugin-authoringMod-writing referenceComes from a plugin bundled with Claude Code that /plugin can disable; Claude also loads it when asked for a mod.
/powerupInteractive feature lessonsShort lessons with animated demos that walk you through Claude Code features.
/pr-comments [PR]PR comments (removed)No longer available since v2.1.91; simply ask Claude to show the comments on a pull request.
/privacy-settingsPrivacy settingsAvailable only to Pro and Max plan subscribers.
/radioLo-fi radio streamOpens Claude FM in your browser; without a browser, the stream URL is printed instead.
/rate-limit-optionsUsage-limit options menuOffers waiting and auto-continuing when the limit resets, buying usage credits, or upgrading; needs a claude.ai subscription.
/recapOne-line session summaryProduces the recap on demand, separate from the automatic one shown after you have been away.
/release-notesBrowse release notesPick one version or all; the notes show in the transcript but stay out of Claude's context.
/reload-plugins [--force]Reload active pluginsApplies pending plugin changes without a restart; --force proceeds even when MCP tool changes would invalidate the prompt cache.
/reload-skillsRescan skill directoriesPicks up skills added or edited on disk mid-session, then reports the totals and what changed.
/remote-controlEnable Remote ControlLets you continue this session from claude.ai; requires a claude.ai subscription. Alias /rc.
/remote-envDefault cloud environment
/rename [name]Rename the sessionWithout a name one is generated from the conversation; names show on the prompt bar and are capped at 200 characters.
/resume [session]Resume a conversationTakes an ID or name, or opens a picker where bg marks background sessions; a running one gets attached. Alias /continue.
/review [low|medium|high|xhigh|max|ultra] [--fix] [--comment] [--max-findings n|all|default] [pr#|branch|path]Alias of /code-reviewSame levels and flags, e.g. /review 1234; with no level it reuses the last one from low to max you typed.
/rewindRewind to a checkpointRolls back conversation, code or both, or summarizes from a chosen message; aliases /checkpoint and /undo.
/runRun your appBundled skill that launches and drives the app so you see the change working, not just tests passing.
/run-skill-generatorGenerate a run skillBundled skill writing a per-project skill so /run and /verify know how to build and launch your app.
/sandboxToggle sandbox modeOnly offered on platforms that support sandboxing.
/schedule [description]Manage cloud routinesClaude sets up, updates, lists or runs routines with you in conversation; alias /routines.
/scroll-speedMouse scroll speedFullscreen rendering only, and unavailable in JetBrains IDE terminals.
/security-reviewSecurity review of branchCompares your branch with origin's default branch for injection, auth and data-exposure risks; needs an origin remote.
/setup-bedrockAmazon Bedrock setup wizardType it in full: the menu hides it unless CLAUDE_CODE_USE_BEDROCK=1; covers auth, region and model pins.
/setup-vertexAgent Platform setup wizardShown in the menu only with CLAUDE_CODE_USE_VERTEX=1; sets Google Cloud auth, project, region and model pins.
/simplify [target]Clean up changed codeBundled skill: four parallel review agents check reuse, simplicity, efficiency and abstraction level, but not correctness bugs.
/skill-doctorSkill cost and usageReveals each skill's context cost and how often it runs, to spot skills worth turning off; needs v2.1.252+.
/skillsList skillsType to filter, t sorts by token count, and Space or Enter changes whether Claude and the / menu see a skill.
/slides [brief]Make a slide deckBundled skill that fills a Claude Slides artifact from your brief; needs v2.1.265+ and artifacts on your account.
/statsAlias of /usageOpens the usage screen directly on its Stats tab.
/statusStatus tab in SettingsShows version, model, account and connectivity, and works while Claude is responding.
/statuslineConfigure the status lineDescribe the line you want, or run it bare to derive one from your shell prompt.
/stickersOrder stickers
/stopStop a background sessionKeeps the transcript and any worktree; /exit or the left arrow detaches without stopping.
/subtask <task>Spawn a forked subagentThe subagent inherits the whole conversation and reports back here when done, while you carry on working.
/tasksManage background workIncludes subagents that already finished; also available as /bashes.
/team-onboardingTeam onboarding guideBuilds a markdown guide from 30 days of your sessions, commands and MCP usage for a teammate to paste in.
/teleportPull in a cloud sessionPick a session and its branch and conversation are fetched here; needs a claude.ai subscription. Alias /tp.
/terminal-setupTerminal newline setupAdds a Shift+Enter newline binding in VS Code, Cursor, Alacritty or Zed, or Option+Enter in Apple Terminal.
/themeChange color themeIncludes auto, light, dark, colorblind-friendly and ANSI themes plus custom ones from ~/.claude/themes/ or plugins.
/tui [default|fullscreen]Switch UI rendererRelaunches with the conversation intact; fullscreen is the flicker-free renderer, and no argument prints the current one.
/ultraplan <prompt>Cloud planning (removed)No longer available: use plan mode, which replaced this browser-reviewed cloud planning command.
/ultrareview [PR or branch]Deep cloud code reviewAlias of /code-review ultra: a multi-agent review in a cloud sandbox; Pro and Max include 3 free runs.
/update-config [request]Edit settings by requestBundled skill: describe a change such as an allowed command, env variable or hook and Claude edits settings.json.
/upgradeUpgrade your planIf the browser cannot open, a sign-in prompt appears instead of the URL.
/usageCost, limits and activityPaid plans also itemize what draws on plan limits; /cost and /stats open the same screen.
/usage-creditsConfigure usage creditsOpens billing in the browser; Team and Enterprise users lacking billing rights send their admin a request instead.
/verifyVerify a change worksBundled skill that builds, runs and observes your app rather than trusting tests; runs only when you invoke it.
/vimVim mode toggle (removed)Gone since v2.1.92; switch between Vim and Normal editing in /config under Editor mode.
/voice [hold|tap|off]Toggle voice dictationThe hold, tap or off argument picks the dictation mode; a Claude.ai account is required.
/web-setupConnect GitHub for cloudUses the credentials of your local gh CLI to link your GitHub account.
/workflow-authoringWorkflow script referenceBundled skill covering the script API, resume behavior and examples; load it before hand-editing a saved workflow script.
/workflowsWorkflow progress viewLets you pause, resume, keep watching or save workflows, whether still running or done.

Prompt Input Prefixes (5)

Command / SyntaxWhat it doesNotes
/Run a command or skillCounts only at the start of a message; typed after a space mid-prompt it just completes a command name.
!Shell modeMust start the input; the command skips Claude's approval, and Claude responds once its output lands in the transcript.
@File path mentionOpens path autocomplete; with cross-session messaging, a letter after it also suggests other live sessions.
:name:Insert an emojiTwo or more letters after a colon open suggestions; the shortcode must start the input or follow a space.
?Toggle shortcut helpWorks on an empty prompt only; with text already typed it inserts a question mark.

Hook Events (33)

Command / SyntaxWhat it doesNotes
SessionStartSession begins or resumesMatcher picks the start type: startup, resume, clear, compact or fork; exit 2 stderr goes to the user only.
SetupOne-time setup runFires for --init-only, or --init and --maintenance under -p; matcher values init and maintenance, exit codes ignored.
UserPromptSubmitPrompt submittedNo matcher; exit 2 blocks the prompt so Claude never sees it, including on turns Claude Code begins by itself.
UserPromptExpansionCommand expands to a promptMatcher takes skill or command names; exit 2 stops the expansion before Claude receives it.
PreToolUseBefore a tool callMatcher filters tool names such as Bash, Edit|Write or mcp__.*; exit 2 blocks the call.
PermissionRequestPermission decision neededMatches tool names; exit 2 is not honored here, so deny through the decision object instead.
PermissionDeniedAuto mode denied a callMatches tool names; the denial already happened, so exit codes are ignored and only the JSON retry flag counts.
PostToolUseAfter a successful tool callMatches tool names; exit 2 cannot undo the call but passes stderr to Claude.
PostToolUseFailureAfter a failed tool callMatches tool names; on exit 2 Claude sees stderr, since the tool has already failed.
PostToolBatchParallel tool batch resolvedNo matcher; exit 2 halts the agentic loop instead of making another model request.
NotificationNotification sentMatcher filters the notification type, e.g. permission_prompt, idle_prompt or agent_completed; exit codes are ignored.
MessageDisplayAssistant text shownDisplay-only with no matcher; on exit 2 the original text is still displayed.
SubagentStartSubagent spawnedMatcher takes agent types such as general-purpose, Explore, Plan or custom names; exit 2 stderr lands in the subagent's own transcript.
SubagentStopSubagent finishedSame matcher values as SubagentStart; exit 2 keeps the subagent working instead of stopping.
TaskCreatedTask being createdFires on TaskCreate with no matcher; exit 2 rolls the new task back.
TaskCompletedTask marked completeNo matcher; exit 2 keeps the task from being marked done.
StopClaude finished respondingNo matcher; exit 2 makes Claude carry on with the conversation instead of stopping.
StopFailureTurn ended by API errorMatcher takes error types like rate_limit, overloaded or server_error; output and exit code are ignored.
TeammateIdleTeammate about to idleAgent teams only, with no matcher; exit 2 keeps the teammate working.
InstructionsLoadedInstructions file loadedFires at session start and on lazy loads; matcher values include session_start, nested_traversal, include and compact.
ConfigChangeConfig file changedMatcher takes the source, e.g. user_settings or skills; exit 2 blocks the change except for policy_settings.
CwdChangedWorking directory changedNo matcher, so it fires on each change; handy for reloading environment variables with direnv.
DirectoryAddedDirectory added mid-sessionMatcher values slash_command and register_repo_root; stderr goes only to the debug log.
FileChangedWatched file changedThe matcher lists literal file names to watch, such as .envrc|.env, separated by a pipe.
WorktreeCreateWorktree being createdTakes over from the default git behaviour; any non-zero exit makes the creation fail.
WorktreeRemoveWorktree being removedCovers worktrees a WorktreeCreate hook made; a non-zero exit fails removal if the directory still exists.
PreCompactBefore compactionMatcher manual or auto; exit 2 blocks the compaction.
PostCompactAfter compactionMatcher manual or auto; stderr from exit 2 is shown to the user only.
PreModelSwitchBefore a model switchMatcher tests the canonical target model name, e.g. claude-opus-5; exit 2 blocks the switch and shows stderr.
PostModelSwitchAfter the model changedAlso fires for switches Claude Code makes itself, like restoring the model on resume; it cannot undo the switch.
ElicitationMCP server asks for inputMatcher takes MCP server names; exit 2 declines the request without showing a dialog.
ElicitationResultElicitation answeredRuns before the reply returns to the server; exit 2 turns the action into a decline.
SessionEndSession endsMatcher gives the reason: clear, resume, logout, prompt_input_exit or other; stderr goes to the user only.

Recipes

Command chains for recurring Claude Code situations, from a filling context window to session cost; the slash commands in them all appear in the tables above.

Keep a long session inside its context window

/context all → /compact [instructions] → /autocompact [auto|<tokens>]

/context draws the window as a grid and points at context-heavy tools and memory bloat; in fullscreen, add all to see the per-item breakdown. /compact takes instructions on what the summary should keep, which beats a generic summary. If automatic compaction arrives at awkward moments, /autocompact sets how full the window may get first (a size such as 500k), and auto returns to the default for your model.

Try another direction without losing the conversation

/branch [name] → /resume [session]

/branch moves you into a copy of the conversation at this point and keeps the original, which /resume brings back. /fork starts a background copy while you keep working here, and /subtask hands a task to a forked subagent whose result returns to this conversation. If an attempt goes wrong, /rewind rolls code and conversation back to a checkpoint.

Check a change before you ship it

/diff → /code-review high --fix → /security-review

/diff shows Claude's edits next to anything else you have not committed. /code-review looks for correctness bugs at the level you pick, and --fix applies what it finds; pass a PR number to review a pull request instead. /security-review then checks the branch against origin's default branch for injection, auth and data-exposure risks.

Feed a command's real output back to the model

! npm test

The ! prefix runs a shell command without going through Claude and adds the output to the session. Claude answers it on its own, so one line gets you an explanation of the failing tests, at the cost of a normal prompt; set respondToBashCommands to false to add output without a reply.

See what a session is costing

/usage → /rate-limit-options

/usage shows session cost, plan limits and activity; /cost and /stats are aliases, and /stats opens on the Stats tab. When a claude.ai usage limit blocks a request, /rate-limit-options lists the ways to continue: wait for the reset, add usage credits or upgrade.

Point Claude at an outcome instead of a single instruction

/plan [description] → /goal [condition|clear] → /loop [interval] [prompt]

/plan enters plan mode so you can approve the approach first. /goal keeps Claude working across turns until a condition is met, and /goal clear drops it early. /loop repeats a prompt while the session stays open, for example every 5m; leave out the interval and Claude paces itself.

Frequently Asked Questions

How do I see which slash commands my Claude Code version supports?

Type / in the Claude Code prompt, or / plus a few letters to filter. Commands that are not available to you are left out of the menu. A few commands stay out of the menu until you type the full name, for example /heapdump, and /setup-bedrock or /setup-vertex before their provider variable is set.

What do the square and angle brackets in the command column mean?

They follow the vendor's notation: <path> marks a required argument and [name] an optional one; type the value, not the brackets. A bar separates choices, so /fast [on|off] takes on, off or nothing.

What is the difference between / and ! at the start of a message?

/ runs a command or skill. ! enters shell mode: the command runs directly, its output is added to the session, and Claude can respond to it.

Which hook events can stop an action with exit code 2?

PreToolUse, UserPromptSubmit, UserPromptExpansion, PostToolBatch, Stop, SubagentStop, TeammateIdle, TaskCreated, TaskCompleted, ConfigChange, PreCompact, PreModelSwitch, Elicitation and ElicitationResult block or reverse what they fire on; WorktreeCreate and WorktreeRemove fail on any non-zero exit. For PermissionRequest, deny through the JSON decision object instead.

Where did the Claude Code keyboard shortcuts go?

Keyboard shortcuts and CLI startup flags are on the Claude Code shortcuts page. This page covers in-session commands, prompt input prefixes and hook events.

Sources and checks

Every row on this page was matched to a line in the documentation above on . A command or parameter that could not be found there is not listed.

AI tools change their commands, parameters and model names between releases: the vendor's current documentation and the version you run have the last word. Found a wrong or missing entry? Tell us and it gets checked against the source. How we verify describes the process and its limits.

Related prompt references

Cursor (72) · OpenAI Codex CLI (49) · Aider (46) · All AI prompt references