Claude Code reference

Claude Code commands list and CLI flags

Type / at the start of a message to open the Claude Code commands list, then type a few letters to filter it. Text after a command supplies its arguments. To reopen a session, use /resume inside Claude or pass --resume to claude in your terminal.

Last updated · Published

By CWYN · Published

1. Claude Code command lookup

Use the slash commands inside a conversation and the CLI flags when starting Claude from your shell. For a shorter printable sheet, jump to daily commands.

Checked against docs, not run. Anthropic’s command reference and CLI reference (as of ).

Built-in slash commands

Names on the same row are aliases. Availability depends on your platform, plan and environment. The workflow examples also cover bundled skills such as /doctor and /code-review.

Session · Context · Model · Permissions · Config

Slash commandWhat it does
Session
/artifactsFind an artifact you own or can access, then attach it to the session or open it.
/autofix-prStart a cloud session that watches the current branch’s pull request and pushes fixes for CI or review feedback.
/background, /bgDetach the session so it can keep working after you leave the terminal.
/branchSwitch to a copy of this conversation and keep the original available to resume.
/bug, /shareChoose how much session history to include in a bug report before sending it.
/cdChange the working directory while keeping the current conversation.
/desktop, /appContinue this terminal session in the Claude Code desktop app.
/diffInspect uncommitted changes in the working tree, including edits Claude made.
/exit, /quitLeave the CLI or detach from an attached background session.
/feedbackOpen the feedback dialog to send Anthropic a product suggestion.
/forkStart a background copy of the conversation, or a subagent when agent view is off.
/goalGive Claude a condition to work toward across turns, check progress or clear the goal.
/insightsGenerate an HTML report about your recent local sessions and how you use Claude Code.
/list-agents, /peersList the agents, teammates and sessions you can message.
/planEnter plan mode, optionally supplying the task you want Claude to plan.
/rate-limit-optionsSee the options available when your account reaches a usage limit.
/remote-control, /rcConnect to this local session from another device using Remote Control.
/renameGive this session a name you can recognize in the session picker.
/restart, /updateRestart into an installed update and resume the session on supported installations.
/resume, /continueReopen a saved conversation by name or ID, or pick one from the list.
/rewind, /checkpoint, /undoReturn code or conversation history to a checkpoint, or summarize from that point.
/schedule, /routinesCreate, inspect, update or run a scheduled cloud task.
/security-reviewCheck the current branch’s diff against the default branch on origin for security issues.
/stopStop a background session while retaining its transcript and worktree.
/subtaskDelegate a task to a subagent that inherits the conversation and reports back here.
/tasks, /bashesCheck progress on background work and see which subagents have finished.
/teleport, /tpBring a selected cloud conversation into your local terminal.
/usage, /cost, /statsInspect session cost, plan limits and activity, with /stats opening the statistics tab.
/workflowsView progress, pause or resume a workflow, or save it for later.
Context
/autocompactChoose how full the context window can get before Claude summarizes it automatically.
/btwAsk a side question without adding the exchange to the main conversation.
/clear, /new, /resetStart with empty conversation context while keeping the previous session available to resume.
/compactSummarize the conversation to make room, optionally naming details to keep.
/contextSee which tools, instructions and messages are taking up the context window.
/copyCopy Claude’s latest reply to the clipboard, or pass a number to select an earlier reply.
/exportSave the conversation as plain text or copy it to the clipboard.
/initCreate a starter CLAUDE.md with project instructions.
/memoryEdit CLAUDE.md instructions and inspect or toggle auto memory.
/recapGet a one-line reminder of what you were doing in this session.
/skill-doctorSee how much context each skill uses and how often it is called.
Model
/advisorChoose the second model Claude can consult for advice, or turn the advisor off.
/effortSet the reasoning effort or check the current level.
/fastTurn fast mode on or off for a supported model.
/modelChoose a model and save the default, or press s in the picker to switch only this session.
Permissions
/add-dirGive Claude file access to an additional working directory.
/auto-mode-setupDraft auto mode rules from the project and recent sessions, then review them before saving.
/design consentGrant Claude access to Claude Design.
/design revokeWithdraw Claude’s access to Claude Design.
/design-loginSign in to authorize access to your design system.
/loginSign in to your Anthropic account.
/logoutSign out of the account connected to Claude Code.
/permissions, /allowed-toolsInspect and edit rules for which tool calls Claude can run, must ask about or must deny.
/privacy-settingsReview or update the privacy settings available to your account.
/sandboxSwitch sandboxing on or off on supported platforms.
/web-setupConnect GitHub for cloud sessions using the credentials from your local GitHub CLI.
Config
/agentsShow how to create or edit subagent definitions.
/chromeConfigure the Claude in Chrome integration.
/colorChange the color of this session’s prompt bar.
/config, /settingsOpen settings or pass a supported key and value to change it directly.
/focusSwitch the fullscreen view between the full transcript and a compact summary of the turn.
/heapdumpWrite local memory diagnostics to investigate high memory use.
/helpOpen help and see the commands available in this session.
/hooksInspect the hooks configured for Claude Code.
/ideCheck the IDE connection and manage editor integrations.
/importBring local settings and other configuration from Codex, Gemini CLI or Cursor into Claude Code.
/install-github-appSet up the Claude GitHub App for a repository on GitHub.com.
/install-slack-appOpen the sign-in flow to install the Claude Slack app.
/keybindingsOpen the file where you customize keyboard shortcuts.
/mcpManage MCP server connections and authentication.
/mobile, /ios, /androidShow a QR code for downloading the Claude mobile app.
/output-styleList output styles or select the one Claude should use.
/passesShare a week of Claude Code access if your account is eligible.
/pluginInspect, install, enable or disable Claude Code plugins.
/powerupExplore Claude Code features through short interactive lessons.
/radioOpen Claude FM in a browser or get the stream address.
/release-notesPick a release to read its changes.
/reload-pluginsApply changes to active plugins without restarting Claude Code.
/reload-skillsRescan skill and command directories to pick up edits made during the session.
/remote-envChoose the default environment for cloud sessions launched from the CLI.
/scroll-speedAdjust mouse-wheel scrolling in supported fullscreen terminals.
/setup-bedrockConfigure credentials, region and model choices for Amazon Bedrock.
/setup-vertexConfigure authentication, project, region and model choices for Google Cloud.
/skillsBrowse available skills and manage which ones appear in the slash menu.
/statusInspect the running version, model, account and connection status.
/statuslineConfigure the information shown in the terminal status line.
/stickersCheck whether Claude Code stickers are available.
/team-onboardingCreate a guide for teammates using examples from your recent Claude Code sessions.
/terminal-setupApply the newline, bell or clipboard settings supported by your terminal.
/themeChoose a color theme or follow the terminal’s light or dark appearance.
/tuiCheck the active terminal renderer or relaunch with a different renderer.
/upgradeOpen the page for changing to a higher plan.
/usage-creditsOpen usage-credit settings or request credits from a billing administrator.
/voiceEnable, disable or change the activation mode for voice dictation.

Anthropic’s slash command reference (as of ).

Main CLI flags

Put flags after claude at your shell prompt. For example, claude --continue reopens recent work and claude -p "Explain this project" prints an answer and exits. Replace values in angle brackets with your own. Square brackets mark optional values.

Session · Context · Model · Permissions · Config

FlagWhat it does
Session
--background, --bgStart a background session and return control to the shell.
--continue, -cContinue the most recent eligible conversation for the current directory.
--fork-sessionGive a resumed conversation its own session ID when used with --resume or --continue.
--from-pr <PR>Open the session picker filtered to a particular pull request.
--max-budget-usd <amount>Stop a print-mode run when its estimated API spend reaches the dollar limit.
--max-turns <count>Limit how many turns Claude can take in a print-mode run.
--name, -n <name>Name the session so you can find it again.
--no-session-persistenceSkip saving a print-mode session to disk.
--print, -pWrite the response to standard output and exit.
--remote-control, --rcStart an interactive session you can also control from Claude on another device.
--resume, -r [session]Reopen the session with this name or ID, or show the picker if you omit it.
--worktree, -w [name]Start the session in a separate Git worktree.
Context
--append-system-prompt <text>Add instructions to the default system prompt.
--autocompact <size>Set the automatic compaction threshold for this session.
--system-prompt <text>Replace the default system prompt with your own instructions.
Model
--effort <level>Set the reasoning effort for this session on a model that supports it.
--fallback-model <model>Select a model to try if the primary model is unavailable or overloaded.
--model <model>Choose the model for this session by alias or full model name.
Permissions
--add-dir <path>Allow Claude to read and edit files in an additional directory.
--allowedTools, --allowed-tools <rules>Preapprove tool calls that match the supplied permission rules.
--dangerously-skip-permissionsRun with permission prompts bypassed, a mode Anthropic recommends only in an isolated environment.
--disallowedTools, --disallowed-tools <rules>Deny matching tool calls or remove a named tool from the available set.
--permission-mode <mode>Start in the selected permission mode, such as plan.
--tools <list>Choose which built-in tools are available in the session.
Config
--agent <name>Use a particular agent definition for this session.
--debugTurn on diagnostic logging.
--helpDisplay the CLI’s help text.
--input-format <format>Read print-mode input as plain text or streaming JSON.
--json-schema <schema>Validate the final print-mode result against a JSON Schema.
--mcp-config <config>Load MCP server definitions from a JSON file or inline JSON.
--output-format <format>Choose text, JSON or streaming JSON for print-mode output.
--plugin-dir <path>Load a plugin from the supplied path for this session.
--settings <settings>Apply settings from a JSON file or inline JSON for this session.
--verboseShow detailed output for each turn.
--version, -vPrint the installed Claude Code version.

Anthropic’s CLI flag reference (as of ).

Daily Claude Code commands

CommandUse it when
/planYou want a plan before editing code.
/contextYou want to see what is taking up context.
/compactYou need room to keep working on the same task.
/diffYou want to read the edits in your working tree.
/rewindYou want to return to a point before a mistaken edit.
/clearYou are starting an unrelated task with empty context.
/resumeYou want to pick up a previous conversation.
/statusYou need to check the current model, account or connection.
/usageYou want to check session cost or plan usage limits. See How the 5-hour and weekly Claude Code usage limits work.

Claude Code command reference (as of ).

2. Claude Code slash commands by moment

First session

CommandWhat it doesUse it when
/initCreates a project guide in CLAUDE.md.A new repository needs project instructions.
/memoryOpens CLAUDE.md files for editing and lets you inspect or toggle auto memory.You need to check a missing project rule.
/mcpManages MCP connections and sign-in. Use reconnect with a server name to reconnect it.A configured MCP server is missing.
/permissionsOpens the allow, ask and deny rules for tools.Claude keeps asking about a command you allowed.

First-session commands (as of ).

During a task

CommandWhat it doesUse it when
/planEnters plan mode. Add a task description to start planning it.You want to review a plan before Claude edits your code.
/modelSets the default model for new sessions. Press s in the picker for this session only. See Claude Code model aliases and how to pick one.You want to try another model on the current task.
/effortSets the effort level. auto selects automatic effort and max lasts for the session.You want to adjust how much effort Claude puts into a problem.
/contextShows a grid of context usage and suggestions for freeing space.You are checking context while tracing a missing instruction.
/compactSummarizes the conversation to free context. Add instructions to focus the summary.You need more room but want to keep the failing test in view. Try /compact keep the failing test.
/btwAnswers a side question without adding it to the conversation.You have a quick question while working on something else.

Task and context commands (as of ).

Parallel work

CommandWhat it doesUse it when
/tasksShows background work, including finished subagents.You want to see which tasks have finished.
/backgroundMoves work into the background.You want to keep working while a task runs.
/batchBundled skill that splits large changes across worktrees.You have the same change to make in several independent modules.

Parallel work commands (as of ).

Before you ship

CommandWhat it doesUse it when
/diffShows working-tree changes, including Claude’s edits.You want to read the patch before you commit.
/code-reviewBundled skill that checks a diff, PR, branch or path for correctness bugs. /review is an alias.You want findings on a change. Add --fix to apply them.
/security-reviewChecks the branch diff against the default branch on origin for vulnerabilities.You have an origin remote and want a security check before merging.

Diff and review commands (as of ).

Between sessions

CommandWhat it doesUse it when
/clearStarts a conversation with empty context. /reset and /new are aliases.Your next task can start fresh.
/resumeOpens the session picker, or takes a session name or ID.You want to return to an earlier session.
/branch, /forkSwitch to a new branch of the conversation, or fork a copy into the background.You want to try a second approach from the same starting point.
/teleportPulls a cloud session into this terminal.You are changing where you work on a conversation.
/remote-controlProvides remote access to a session.You want to continue from another device.

Session commands (as of ).

When something is wrong

CommandWhat it doesUse it when
/rewindRewinds the conversation, code or both. You can also summarize from a message.You want to undo a file edit from a checkpoint.
/doctorBundled skill that checks your setup and proposes fixes for you to confirm.You suspect an installation or settings problem.
/hooksShows configured hooks.You need to see why a hook did not fire.
/debugBundled skill that uses the session debug log to investigate a problem.You want to trace an error you can reproduce.
/feedbackLets you report a problem with Claude Code.You have a bug report to share.

Troubleshooting commands (as of ).

3. Keyboard shortcuts

KeysWhat they do
Shift+TabCycle through permission modes.
EscInterrupt Claude’s response.
Esc EscPress Escape twice to open the rewind menu.
Ctrl+CCancel your input, or exit when the prompt is empty.
Ctrl+RSearch backward through your prompt history.
@ + pathReference a file. For example, @README.md.
?Show the exact shortcuts available in your environment.

Anthropic’s Claude Code cheatsheet (as of ).

4. Claude Code commands vs skills

Built-in commands are coded into the CLI. For example, /status opens the Status tab in Settings. The slash menu also includes bundled workflows and skills. A bundled skill or a skill you write gives Claude a prompt to follow.

To make a custom command for your project, write the prompt in .claude/skills/<name>/SKILL.md. The legacy .claude/commands/ directory still works. Follow the project skill walkthrough to turn a repeated request into a command.

Command types, Claude Code skills and custom command paths (as of ).

5. Claude Code commands FAQ

Why is a slash command missing?

Availability depends on your platform, plan and environment. Type / at an empty prompt to see your session’s list. If the command appears there, put it at the start of your message. Command availability (as of ).

What is the difference between /clear and /compact?

Use /compact to continue the same conversation with a shorter summary. Use /clear to start a new conversation with empty context. You can use /resume to return to the previous conversation. See what survives compaction before choosing. Context and session commands (as of ).

How do I make a custom command?

Choose a name for the skill and put its prompt in .claude/skills/<name>/SKILL.md in your project. At the Claude Code prompt, type a slash followed by the skill name to run it. For a working example, see the handoff skill in the Claude Code Complete Setup Pack. Create a project skill (as of ).

Can I run a command while Claude is working?

Yes. A command normally waits until the current turn finishes. /status, /tasks and /usage can run immediately while Claude continues responding. Commands during a response (as of ).

Where can I see my Claude Code usage?

Run /usage to see session cost, plan usage limits and activity statistics. /cost and /stats are aliases. To put the session cost in context, compare API charges with a subscription. Usage command and aliases (as of ).

Next steps

Write instructions for your project

Open the free AI instruction builder

Set up your Claude Code project

The Claude Code Complete Setup Pack ($12.95) includes editable project instructions, permission presets and hooks.