Claude Code commands
Every slash command in Claude Code, explained in plain words. Start with the 15 commands most people use every day, then look up the other 96 by category, along with CLI flags and keyboard shortcuts.
Checked against the official Claude Code docs on September 24, 2026. Type / in Claude Code to see what your version and plan include.
Top 15 commands to learn first
- 01/init
Creates a CLAUDE.md so Claude knows how your project builds, tests and is laid out.
/init - 02/plan
Makes Claude think through a large change and show you the plan before it edits anything.
/plan add rate limiting to the public API - 03/clear
Starts a clean conversation for a new task, so old context does not steer the new one.
/clear auth-refactor - 04/compact
Summarizes a long conversation to free up context without losing the thread.
/compact keep the failing test names and the fix plan - 05/context
Shows what is filling the context window, so you know what to trim.
/context - 06/resume
Picks up an earlier conversation by name or from a list, with its full history.
/resume auth-refactor - 07/rewind
Rolls code and conversation back to an earlier checkpoint when a change goes wrong.
/rewind - 08/model
Switches models, for example to a faster one for simple edits or a stronger one for hard bugs.
/model sonnet - 09/diff
Lets you read every change Claude made before you commit it.
/diff Checks your current changes, or a pull request, for correctness bugs.
/code-review high 1234- 11/btw
Asks a quick side question without adding it to the main conversation.
/btw what does the -z flag in grep do? - 12/mcp
Connects and manages MCP servers that give Claude access to tools like GitHub, databases or browsers.
/mcp reconnect github - 13/memory
Edits the CLAUDE.md files and memory Claude loads into every session.
/memory Sets which tools and commands Claude can run without asking you each time.
/permissions- 15/usage
Shows what the session cost and how close you are to your plan limits.
/usage
All 111 slash commands
Bundled skills and workflows run like any other command. Version tags show the minimum Claude Code version the docs list; run claude update if a command is missing.
Sessions and context
/add-dir <path>Give Claude access to another folder for this session.
Use it when a task spans two repositories or needs files outside your project. Claude can read and edit files there, but most .claude/ settings in that folder are not picked up. Network share paths are generally not supported.
/autocompact [auto|<tokens>]Set how full the context gets before Claude compacts it.
Pass a size such as 500k, or auto to go back to the default for your model. The value is saved to your user settings. Run it with no argument to see the current setting.
v2.1.221+Docs/branch [name]Try a different direction without losing the current conversation.
Creates a copy of the conversation at this point and switches you into it. The original stays intact and you can go back with /resume. Use /fork to run the copy in the background instead.
/btw [question]Ask a side question that does not go into the conversation.
Handy for a quick lookup while Claude works on the main task. The answer is shown to you but not added to the history Claude uses. Run it with no question to see your earlier side answers.
/cd <path>Move the session to another working directory.
Keeps your conversation but changes where Claude works. Unlike /add-dir, which adds a second folder, /cd switches the main one. Press Tab to accept a suggested path.
/clear [name]Also: /reset, /newStart a new conversation with an empty context.
Use it when you switch to an unrelated task. Pass a name to label the old conversation so it is easy to find in /resume. To keep the thread but free space, use /compact instead. Also available as /new and /reset.
/compact [instructions]Summarize the conversation so far to free up context.
Claude replaces the long history with a summary and keeps going. You can pass instructions for what the summary must keep, such as file names or open questions. Run it before a long session starts to feel slow or forgetful.
/context [all]See what is using your context window.
Shows a colored grid of context usage, broken down by messages, tools, memory files and more, with tips for trimming. Pass all to expand every item. Check it when responses slow down or Claude seems to forget things.
/copy [N]Copy Claude's last response to the clipboard.
Pass a number to copy an older response, such as /copy 2. When the response has code blocks you can pick a single block. Press w in the picker to save to a file instead, which helps over SSH.
/exitAlso: /quitQuit Claude Code.
Ends the session. In an attached background session it detaches and leaves the session running. Also available as /quit.
/export [filename]Save the conversation as plain text.
Pass a filename to write it straight to a file, or run it bare to copy to the clipboard or pick a location. Useful for sharing a session or keeping notes.
/recapGet a one-line summary of the session.
Helpful when you come back to a session and want a quick reminder of where things stand.
/rename [name]Rename the current session.
The name shows on the prompt bar and in /resume. Run it with no name and Claude suggests one from the conversation.
/resume [session]Also: /continueGo back to an earlier conversation.
Pass a session name or ID, or run it bare to pick from a list. The full history comes back, so you do not need to re-explain the task. Also available as /continue. From the shell, use claude -c or claude -r.
/rewindAlso: /checkpoint, /undoRoll back code and conversation to an earlier point.
Pick a checkpoint to restore the code, the conversation or both, or to summarize from that point on. Pressing Esc twice on an empty prompt opens the same menu. Also available as /checkpoint and /undo.
/stopStop the background session you are attached to.
The transcript and any worktree are kept. To leave the session running and just detach, use /exit.
Planning and agents
/agentsReminds you how to create and manage subagents.
In current versions it no longer opens a menu. Ask Claude to create a subagent for you, or edit the files in .claude/agents/ (project) or ~/.claude/agents/ (personal) directly.
/background [prompt]Also: /bgSend this session to the background and free your terminal.
The session keeps running as a background agent. You can add one last instruction before it detaches, then check on it with claude agents. Use /fork instead if you want to keep working here too. Short form: /bg.
/batch <instruction>Split a large codebase change into parallel units of work.
Claude researches the change, breaks it into 5 to 30 independent pieces and shows you a plan. After you approve, each piece runs in its own git worktree and opens its own pull request. Good for migrations; requires a git repository.
/deep-research <question>Research a question across many web sources and get a cited report.
A bundled workflow that runs many searches in parallel, checks sources against each other and writes a report with citations. It runs in the background, so you can keep working.
WorkflowDocs/fork [prompt]Copy the conversation into a new background session.
The copy works on its own while you carry on here. Give it a prompt to start right away. Use /branch to switch into a copy yourself, or /subtask to get a result back in this conversation.
v2.1.212+Docs/goal [condition|clear]Keep Claude working until a condition is met.
Set a goal such as all tests passing and Claude continues across turns until it gets there. Run it with no argument to see the current goal, or pass clear to stop early.
/list-agentsAlso: /peersList the agents and sessions Claude can message.
Shows subagents, agent team members and other local sessions, with the name to use for each. Only available when cross-session messaging is turned on. Also available as /peers.
v2.1.224+Docs/loop [interval] [prompt]Also: /proactiveRun a prompt again and again while the session is open.
Give an interval and a prompt, such as /loop 5m check if the deploy finished. Leave out the interval and Claude paces itself. It only runs while this session stays open; use /schedule for jobs that run in the cloud. Also available as /proactive.
Bundled skillDocs/plan [description]Switch to plan mode before a big change.
In plan mode Claude explores and proposes a plan without editing files, so you can agree on the approach first. Add a description to start right away, such as /plan fix the auth bug. You can also cycle into plan mode with Shift+Tab.
/schedule [description]Also: /routinesCreate and manage routines that run in the cloud.
Claude walks you through setting up a routine, such as a nightly dependency check, and can report on recent runs. Routines keep running when your laptop is closed. Also available as /routines.
/subtask <task>Hand a side task to a subagent that reports back here.
The subagent gets the full conversation, works in the background, and its result lands back in this conversation. Use /fork if you want a fully separate session instead.
v2.1.212+Docs/tasksAlso: /bashesSee and manage background work in this session.
Lists running and finished background shells and subagents. This is different from Claude's to-do checklist, which you toggle with Ctrl+T. Also available as /bashes.
/workflowsWatch, pause, resume or save workflows.
Opens the progress view for running and finished multi-agent workflows.
Review and verify
/autofix-pr [prompt]Start a cloud session that fixes CI failures and review comments on your PR.
It finds the open pull request for your current branch and keeps pushing fixes as CI fails or reviewers comment. Add a prompt to narrow the job, for example only lint errors. Needs the gh CLI and cloud session access.
Needs gh CLIDocs/code-review [low|medium|high|xhigh|max|ultra] [--fix] [--comment] [pr#|branch|path]Also: /reviewReview your changes or a pull request for bugs.
Reviews the current diff by default, or a PR number, branch or path you pass. Add an effort level such as high, --fix to apply the findings, or --comment to post them on the PR. The ultra level runs a deeper multi-agent review in the cloud. Also available as /review.
Bundled skillDocs/diffReview every change in your working tree.
Shows the edits Claude made along with any other uncommitted changes. Read through it before committing, the same way you would review a teammate's work.
/review [low|medium|high|xhigh|max|ultra] [--fix] [--comment] [pr#|branch|path]Another name for /code-review.
Takes the same effort levels and flags as /code-review, for example /review 1234 to review pull request 1234.
Alias of /code-reviewDocs/runLaunch your app and see a change working.
A bundled skill that has Claude start and drive your app, so a change is checked in the real app and not only by tests.
Bundled skillDocs/run-skill-generatorTeach /run and /verify how to start your app.
Writes a project skill with the steps to build, launch and drive your app from a clean environment, so /run and /verify work reliably.
Bundled skillDocs/security-reviewCheck your branch for security issues.
Reviews the diff between your branch and the default branch for risks such as injection, broken auth and data leaks. Needs an origin remote.
/simplify [target]Clean up changed code and apply the fixes.
Four review agents look for reuse of existing helpers, simpler code, efficiency and the right level of abstraction. It does not hunt for bugs; use /code-review for that. Pass a path or PR to target something specific.
Bundled skillDocs/ultrareview [PR or branch]Run a deep multi-agent code review in the cloud.
The preferred way to run it is /code-review ultra; /ultrareview is an alias. Pass a PR or branch to review. Pro and Max include a few free runs, then it uses usage credits.
/verifyConfirm a change works by running your app.
A bundled skill that builds and runs your app and checks the result, instead of relying only on tests or type checks.
Bundled skillDocs
Project setup and memory
/claude-api [migrate|upgrade|managed-agents-onboard|prompt-audit|cost-optimize|build-eval|hillclimb]Load Claude API reference material for your project.
A bundled skill that gives Claude up-to-date API and SDK details for your language. It also has subcommands such as migrate (move code to a newer model), prompt-audit and cost-optimize. It loads automatically when your code imports the Anthropic SDK.
Bundled skillDocs/fewer-permission-promptsCut down on repeated permission prompts.
A bundled skill that scans your past sessions for safe, read-only commands you approve often and adds them to the project allowlist in .claude/settings.json.
Bundled skillDocs/hooksView the hooks configured for tool events.
Hooks run your own scripts before or after events like a tool call or session start, for example to format files after edits. This shows which hooks are active and where they come from.
/import [codex|gemini|cursor] [--dry-run] [--yes]Bring settings over from Codex, Gemini CLI or Cursor.
Copies instruction files, MCP servers, commands, subagents and skills into Claude Code. Add --dry-run to preview or --yes to skip the picker. Not available on Bedrock, Google Cloud or Foundry.
v2.1.213+Docs/initCreate a starter CLAUDE.md for your project.
Claude studies the repo and writes a CLAUDE.md with build commands, structure and conventions, which it then reads at the start of every session. Run it once per project, then refine the file with /memory.
/memoryEdit CLAUDE.md files and auto memory.
Opens the memory files Claude loads into each session, so you can add rules and project facts. You can also turn auto memory on or off and see what Claude has saved on its own.
/reload-skillsPick up skills you added or changed during the session.
Rescans your skill and command folders so new skills are usable without restarting, and reports how many were added or removed.
/skill-doctorSee what each skill costs in context and how often it is used.
Helps you find skills that take up context but rarely get used, so you can turn them off.
v2.1.252+Docs/skillsList and filter your available skills.
Type to filter by name or source, press t to sort by token cost, and press Space or Enter to change whether a skill is visible to Claude and the / menu.
/team-onboardingWrite an onboarding guide for teammates from your usage.
Claude looks at your last 30 days of sessions, commands and MCP servers and writes a guide a new teammate can paste in to get set up fast.
Models and settings
/advisor [model|off]Turn on a second model that Claude consults at key moments.
Pass fable, opus, sonnet, a full model ID, or off. With no argument you get a picker. Useful on long or tricky tasks where a second opinion can catch a wrong turn early.
/auto-mode-setupDraft auto mode environment rules from your project.
Claude looks at your project and recent sessions, proposes autoMode.environment entries, and saves them to your user settings once you approve. Needs a Pro, Max or Team plan.
/color [color|default]Change the prompt bar color for this session.
Pick red, blue, green, yellow, purple, orange, pink or cyan, or default to reset. Useful for telling several terminal sessions apart at a glance.
/config [key=value ...]Also: /settingsOpen settings, or change one directly.
With no argument it opens the settings screen for theme, model, editor mode and more. Pass key=value pairs, such as /config theme=dark, to change a setting without the screen. Run /config --help to list the keys. Also available as /settings.
/effort [level|auto|status]Set how much reasoning effort Claude uses.
Choose from low up to xhigh, max, ultracode or auto, or pass status to see the current level. Higher effort helps on hard problems but uses more tokens and time. max and ultracode last for the current session only.
/fast [on|off]Turn fast mode on or off.
Fast mode gives quicker output on supported models at a higher price. You can toggle it mid-response; the current turn finishes at its original speed.
v2.1.205+Docs/focusToggle a compact view of each turn.
Shows only your last prompt, a one-line summary of tool calls and the final answer. Only works with fullscreen rendering. The choice is remembered across sessions.
/keybindingsOpen your keyboard shortcuts file.
Lets you rebind shortcuts, for example to change which key sends a message or opens the editor.
/model [model]Switch models and set your default.
With no argument it opens a picker; use the arrow keys to adjust effort on models that support it, or press s to switch for this session only. Passing a name such as sonnet or opus switches directly and saves it as your default.
/output-style [style]List output styles or switch to one.
Output styles change how Claude writes its responses, for example /output-style concise for shorter answers.
v2.1.269+Docs/permissionsAlso: /allowed-toolsManage which tools Claude can use without asking.
Add allow, ask and deny rules by scope, manage extra working directories and review what auto mode blocked. Well-tuned rules save a lot of approval clicks. Also available as /allowed-tools.
/sandboxTurn sandbox mode on or off.
Sandboxing limits what commands Claude runs can reach on your machine. Only available on supported platforms.
/scroll-speedAdjust mouse wheel scroll speed.
Preview the change live while the dialog is open. Only in fullscreen rendering, and not in the JetBrains terminal.
/statuslineSet up the status line at the bottom of the screen.
Describe what you want to see, such as the git branch and model, or run it bare to copy your shell prompt style.
/terminal-setupSet up Shift+Enter for new lines in your terminal.
Adds the keybinding in editors and terminals such as VS Code, Cursor, Alacritty and Zed. In Apple Terminal and iTerm2 it adjusts the settings Claude Code needs instead.
/themeChange the color theme.
Includes light, dark, auto (follows your terminal), colorblind-friendly and custom themes.
/tui [default|fullscreen]Switch the terminal renderer.
Pass fullscreen for the flicker-free renderer or default to go back. Your conversation stays intact when it relaunches.
/update-config [request]Describe a settings change and let Claude make it.
For example, allow a command, set an environment variable or add a hook. Claude edits the right settings.json file. For simple options like theme or model, /config is quicker.
Bundled skillDocs
MCP, plugins and integrations
/artifactsList your artifacts and attach, open or share one.
Shows artifacts you own or that were shared with you. You can attach one to the session, open it in the browser, or copy its link. Only available where artifacts are supported.
v2.1.208+Docs/chromeConfigure the Claude in Chrome browser integration.
Opens the settings for the Chrome extension that lets Claude control your browser for testing and web tasks.
/dataviz [request]Get design guidance for charts and dashboards.
A bundled skill that helps Claude choose the right chart type, accessible colors and clear labels. It ships a neutral palette you can swap for your brand colors.
/design [brief]Draft UI mockups and screens as an editable design.
Describe what you need, such as a settings screen, and Claude lays it out as artboards you can edit in the browser and export as PNG or PDF. Needs a session where artifacts are available.
/design-loginAuthorize design-system access for /design-sync.
Signs in with your claude.ai account so /design-sync can upload your design system.
/design-sync [hint]Upload your React design system so designs use your real components.
Converts the components in your repo for Claude Design. The first sync checks every component and can take hours on a large repo. Not available on Bedrock, Google Cloud or Foundry.
Bundled skillDocs/ideManage IDE integrations.
Shows and manages the connection to editors such as VS Code and JetBrains, so Claude can see your open files and show diffs in the editor.
/install-github-appSet up the Claude GitHub App for a repository.
Walks you through installing the app and, optionally, GitHub Actions workflows and secrets, so you can mention Claude in issues and pull requests. Works with github.com repositories only.
/install-slack-appInstall the Claude Slack app.
Opens your browser to finish the Slack sign-in and connect Claude to your workspace.
/mcp [reconnect <server>|enable|disable [<server>|all]]Manage MCP server connections and sign-ins.
Opens a list of your MCP servers with their status and OAuth sign-in. Pass reconnect with a server name to fix a dropped connection, or enable and disable to switch servers on and off without the menu. Add new servers from your shell with claude mcp add.
/plugin [subcommand]Browse, install and manage plugins.
Opens the plugin menu, or pass a subcommand such as install, list, enable or disable. Plugins can bundle skills, agents, hooks and MCP servers. If a change does not show up, run /reload-plugins.
/reload-plugins [--force]Apply plugin changes without restarting.
Reloads active plugins and reports any load errors. If the reload would change which MCP tools are loaded, it warns and skips unless you pass --force, because that resets the prompt cache.
Cloud and other devices
/desktopAlso: /appContinue this session in the Claude Code desktop app.
Hands the session over to the desktop app. Needs macOS or x64 Windows and a Claude subscription. Also available as /app.
Needs Claude subscriptionDocs/mobileAlso: /ios, /androidShow a QR code to get the Claude mobile app.
Scan it to install the app, which you can use with Remote Control. Also available as /ios and /android.
/remote-controlAlso: /rcControl this session from claude.ai or your phone.
Makes the current session available through Remote Control, so you can keep going from another device. Needs a claude.ai subscription. Also available as /rc.
/remote-envChoose the default cloud environment.
Sets which cloud environment new cloud sessions use when you start them from the CLI.
/setup-bedrockSet up Amazon Bedrock with a guided wizard.
Configures authentication, region and model choices. Hidden until CLAUDE_CODE_USE_BEDROCK=1 is set; type it in full.
Type in fullDocs/setup-vertexSet up Google Cloud with a guided wizard.
Configures authentication, project, region and model choices. Hidden until CLAUDE_CODE_USE_VERTEX=1 is set; type it in full.
Type in fullDocs/teleportAlso: /tpPull a cloud session into this terminal.
Pick a cloud session and Claude Code fetches its branch and conversation so you can continue locally. Needs a claude.ai subscription. Also available as /tp.
Needs claude.ai subscriptionDocs/web-setupConnect GitHub for cloud sessions.
Uses your local gh CLI credentials to link your GitHub account, so cloud sessions can work on your repositories.
Account and usage
/costAnother name for /usage.
Opens the same view as /usage, with session cost and plan limits.
Alias of /usageDocs/insightsGet a report on how you use Claude Code.
Builds an HTML report from your recent sessions on this machine: which projects you work in, where things go wrong and features worth trying. Not available in cloud sessions.
/login/logout/passesShare a free week of Claude Code with friends.
Only shows up if your account is eligible to share passes.
/privacy-settingsView and update your privacy settings.
Only available on Pro and Max plans.
Needs Pro and Max plan subscribersDocs/rate-limit-optionsSee your options when you hit a usage limit.
Choose to wait and continue automatically when the limit resets, add usage credits, or upgrade. Needs a claude.ai subscription. Hidden from the menu, so type it in full.
/statsAnother name for /usage, opened on the Stats tab.
Shows your activity statistics in the usage view.
Alias of /usageDocs/statusShow version, model, account and connection status.
A quick health check of your current setup. It works even while Claude is responding.
/upgrade/usageShow session cost, plan limits and activity.
On paid plans it breaks down what counts toward your limits. Check it on long sessions to avoid surprises. Also available as /cost and /stats.
/usage-creditsAdd usage credits, or ask your admin for them.
Opens billing settings in your browser. Team and Enterprise members without billing access send a request to their admin instead. Previously called /extra-usage.
Help and troubleshooting
/bug [report]Also: /shareReport a bug to Anthropic, with session context if you choose.
You pick how much of the session to include and confirm before anything is sent. On third-party providers the report is saved locally for you to forward. Also available as /share.
/debug [description]Turn on debug logging and troubleshoot a problem.
Starts capturing a debug log from this point and has Claude read it to find the cause. Describe the issue to focus the search. To log from the very start of a session, launch with claude --debug.
Bundled skillDocs/doctorAlso: /checkupCheck your setup and fix common problems.
Looks for broken or duplicate installs, PATH issues, bad settings files, slow hooks and unused skills or MCP servers. It reports first and asks before changing anything. For read-only checks from the shell, run claude doctor. Also available as /checkup.
Bundled skillDocs/feedback [report]Send product feedback about Claude Code.
Opens the same consent dialog as /bug. If Claude has drafted feedback during the session, running it with no argument lets you review, edit or discard those drafts first.
/heapdumpSave a memory snapshot to diagnose high memory use.
Writes a heap snapshot and a memory breakdown to your Desktop or home folder. Share only the -diagnostics.json file; the snapshot contains your conversation and credentials. Hidden from the menu, so type it in full.
Type in fullDocs/helpShow help and the commands available to you.
A quick way to see what you can run in your current setup, since availability depends on your plan and platform.
/powerupLearn Claude Code features through short interactive lessons.
Quick guided lessons with animated demos, useful when you are new or want to find features you have not tried.
/release-notesRead the Claude Code changelog.
Pick a version to see what changed. The notes appear on screen but are not added to the conversation.
Extras
/radioOpen lo-fi radio in your browser.
Plays Claude FM while you work. Prints the stream link if no browser is available.
/stickers/voice [hold|tap|off]Turn voice dictation on or off.
Pass hold or tap to choose how recording works, or off to disable it. Needs a Claude.ai account.
Needs Claude.ai accountDocs
Terminal commands
Run these from your shell, not inside a session.
claudeStart an interactive session in the current folder.claude "query"Start an interactive session with a first prompt already sent.claude -p "query"Run one prompt, print the answer and exit. Use it in scripts and CI.cat file | claude -p "query"Pipe a file or command output in and ask about it.claude -cContinue the most recent conversation in this folder.claude -c -p "query"Continue the last conversation non-interactively with a new prompt.claude -r "<session>" "query"Resume a named or specific session and send it a prompt.claude updateUpdate Claude Code to the latest version.claude gatewayRun the self-hosted gateway that admins put in front of Bedrock, Google Cloud or Foundry.claude install [version]Install or reinstall the native binary, optionally a specific version such as stable.claude auth loginSign in. Add --console to bill API usage to an Anthropic Console account.claude auth logoutSign out of your Anthropic account.claude auth statusPrint whether you are signed in, as JSON or with --text.claude agentsOpen agent view to watch and manage background sessions.claude attach <id>Attach this terminal to a running background session.claude auto-mode defaultsPrint the built-in auto mode rules as JSON.claude auto-mode resetRestore the default auto mode configuration.claude daemon statusShow the state of the background-session supervisor.claude daemon stop --anyStop the background-session supervisor, for example when it stops responding.claude doctorPrint read-only install and settings diagnostics without starting a session.claude import [source]Import settings from Codex, Gemini CLI or Cursor.claude logs <id>Print recent output from a background session.claude mcpAdd, list and remove MCP servers, for example claude mcp add.claude mcp login <name>Run an MCP server's sign-in flow from the shell.claude mcp logout <name>Remove the saved sign-in for an MCP server.claude pluginInstall and manage plugins from the shell.claude project purge [path]Delete all local Claude Code data for a project, including transcripts and history.claude remote-controlRun a Remote Control server so you can drive Claude Code from claude.ai or the app.claude respawn <id>Restart a background session with its conversation intact.claude rm <id>Remove a background session from the list.claude self-hosted-runnerHost Claude Code cloud sessions on your own infrastructure.claude setup-tokenCreate a long-lived sign-in token for CI and scripts.claude stop <id>Stop a background session.claude ultrareview [target]Run a deep cloud code review from the shell and print the findings.
Flags worth knowing
--print, -pRun one prompt without the interactive screen and print the answer. The basis for scripts and CI.
claude -p "summarize the last 10 commits"--continue, -cContinue the most recent conversation in this folder.
claude -c--resume, -rResume a session by name or ID, or pick from a list.
claude -r "auth-refactor"--modelChoose the model for this session, such as sonnet, opus or a full model name.
claude --model opus--effortSet the reasoning effort for this session.
claude --effort high--permission-modeStart in a permission mode such as plan, acceptEdits or auto.
claude --permission-mode plan--worktree, -wStart in an isolated git worktree so parallel work does not collide.
claude -w feature-auth--add-dirGive Claude access to extra folders from the start.
claude --add-dir ../shared-lib--allowed-toolsPre-approve specific tools or commands so Claude does not ask.
claude --allowed-tools "Bash(npm test *)"--output-formatGet text, json or stream-json output in print mode for scripts.
claude -p "list TODOs" --output-format json--max-turnsCap how many agent turns a print-mode run can take.
claude -p --max-turns 3 "fix the lint errors"--mcp-configLoad MCP servers from a JSON file for this run.
claude --mcp-config ./mcp.json--append-system-promptAdd your own instructions on top of the default system prompt.
claude --append-system-prompt "Always use TypeScript"--bg, --backgroundStart a session in the background and get your terminal back.
claude --bg "update the changelog"--safe-modeStart with all customizations off to troubleshoot a broken setup.
claude --safe-mode--dangerously-skip-permissionsSkip all permission prompts. Only use in a sandbox or throwaway container.
claude --dangerously-skip-permissions
There are 79 flags in total. See the CLI reference for the full list.
Keyboard shortcuts and input prefixes
Start your prompt with
- / at start
- Command or skill
- ! at start
- Shell mode
- @
- File path mention
- :
- Emoji shortcode
- ? on empty input
- Toggle the shortcut help panel
New line without sending
- \ + Enter
- Works in all terminals
- Option+Enter
- After enabling Option as Meta on macOS
- Shift+Enter
- Native in iTerm2, WezTerm, Ghostty, Kitty, Warp, Apple Terminal, Windows Terminal. For other terminals, see Enter multiline prompts
- Ctrl+J
- Works in any terminal without configuration
- Paste directly
- For code blocks, logs
While Claude works
- Ctrl+C
- Interrupt, or clear input
- Ctrl+X Ctrl+K
- Stop all running background subagents in this session, and turn off artifact auto-replies for the rest of it
- Ctrl+D
- Exit Claude Code session
- Ctrl+G or Ctrl+X Ctrl+E
- Open in default text editor
- Ctrl+L
- Redraw the screen
- Ctrl+O
- Toggle transcript viewer
- Ctrl+R
- Reverse search command history
- Ctrl+V or Cmd+V (iTerm2) or Alt+V (Windows and WSL)
- Paste image from clipboard
- Ctrl+B
- Background running tasks
- Ctrl+T
- Toggle Claude's task checklist
- Ctrl+S
- Stash or restore prompt
- Ctrl+Z
- Suspend Claude Code
- Left/Right arrows
- Cycle through dialog tabs
- Tab
- Accept an autocomplete suggestion, or add a comment to a permission answer
- Up/Down arrows or Ctrl+P/Ctrl+N
- Move cursor or navigate command history
- Esc
- Interrupt Claude, or close a dialog
- Esc + Esc
- Clear input draft, or rewind
- Ctrl+Enter or Ctrl+X Ctrl+S
- Send queued messages now
- Shift+Tab, or Alt+M on Windows when the Node or Bun runtime doesn't enable VT input mode
- Cycle permission modes
- Option+P (macOS) or Alt+P (Windows/Linux)
- Switch model
- Option+T (macOS) or Alt+T (Windows/Linux)
- Toggle extended thinking
- Option+O (macOS) or Alt+O (Windows/Linux)
- Toggle fast mode
Text editing shortcuts
- Ctrl+A
- Move cursor to start of current line
- Ctrl+E
- Move cursor to end of current line
- Ctrl+K
- Delete to end of line
- Ctrl+U
- Delete from cursor to line start
- Ctrl+W
- Delete back to previous whitespace
- Ctrl+Y
- Paste deleted text
- Alt+Y (after Ctrl+Y)
- Cycle paste history
- Alt+B
- Move cursor back one word
- Alt+F
- Move cursor forward one word
- Alt+D
- Delete to end of word
- Ctrl+_ or Ctrl+Shift+-
- Undo last input edit
Removed commands and common mix-ups
- This command was removed in v2.1.91. Asking Claude directly, for example "show me the comments on this PR", does the same job.
/pr-commentsRemoved - This command used to send planning work to a cloud session. Use /plan or Shift+Tab to enter plan mode.
/ultraplanRemoved - This command was removed in v2.1.92. Open /config and change Editor mode to switch between Vim and normal editing.
/vimRemoved - There is no redo. /rewind (also /undo) restores an earlier checkpoint; pick a later one to move forward again if it is still listed.
/redoNot a command - Press Ctrl+R to search your prompt history, or Up and Down to step through it. Use /resume for past conversations.
/historyNot a command - Press Ctrl+R to search prompt history. In fullscreen mode, open the transcript with Ctrl+O to search the conversation.
/searchNot a command - Press Ctrl+T to show or hide Claude's to-do checklist. /tasks shows background shells and subagents.
/todosNot a command
Questions about Claude Code commands
How do I see which commands I can use?
Type / at the start of the prompt in Claude Code. A menu lists every command available to you, and typing more letters filters it. Availability depends on your plan, platform and version, so some commands on this page may not appear for you.
Is there an undo command in Claude Code?
Yes. /rewind rolls code and conversation back to an earlier checkpoint, and /undo and /checkpoint are aliases for it. You can also press Esc twice on an empty prompt to open the same menu.
What is the difference between /clear and /compact?
/clear starts a new conversation with an empty context, which is best when you switch to an unrelated task. /compact keeps the same conversation but replaces the history with a summary to free up space.
How do I make my own slash command?
Create a skill: a folder with a SKILL.md file inside .claude/skills/ in your project, or ~/.claude/skills/ for all your projects. The folder name becomes the command, so .claude/skills/deploy/SKILL.md runs as /deploy.
What is the difference between slash commands and CLI flags?
Slash commands run inside a Claude Code session, such as /model or /compact. CLI flags are added when you start Claude Code from your shell, such as claude -c to continue your last conversation or claude -p to run one prompt from a script.
Looking for hooks, subagents and settings too? See the Claude Code cheatsheet.