Claude Code CLI commands and shortcuts cheat sheet
Compatible with v2.1.x | Updated February 2026
Enter a command name in the search field, or filter by category (Slash Commands, Keyboard Shortcuts, etc.) to find the command you need.
Check the command description and practical usage examples.
Click the copy button to copy the command to your clipboard for immediate use in your terminal.
/helpDisplay available commands and help/compactSummarize and compress conversation history/compact [instructions]Compact with custom instructions/clearReset the current conversation/configView and modify current settings/contextCheck current context window usage as a colored grid/copyCopy Claude's last response to clipboard (shows picker for multiple code blocks)/costDisplay token usage for the current session/debugDisplay debug information and logs/desktopOpen current session in Claude Desktop app/doctorCheck environment and connection status/exitEnd the Claude Code session/exportExport current conversation/initGenerate CLAUDE.md file to set up the project/mcpCheck and manage MCP server status/memoryOpen and edit CLAUDE.md files/modelSelect and change model (use arrow keys to adjust Effort level)/model claude-sonnet-4-6Switch to a specific model/permissionsView and modify tool permissions/planSwitch to plan mode for creating implementation plans/rename [new name]Give the session a name for easier management/resumeSelect and resume from previous sessions/rewindUndo recent changes and revert to previous state/statsDisplay usage statistics/statusDisplay model, context usage, and more/statuslineCustomize status line display/tasksCheck running background tasks/teleportResume a session started on claude.ai in the CLI/terminal-setupCheck recommended terminal settings/themeSelect and change the UI color theme/todosView TODO items in the task list/usageCheck current plan usage and remaining limits/vimEnable or disable Vim-style keybindings/agentsView available sub-agents and their settings/fastEnable or disable Fast mode for faster output with the same model/hooksSet up and view shell command hooks for tool execution/pluginList, install, or remove pluginsEscapeStop running operations or clear current inputTabComplete file paths and commands while typingEnterSend the typed message to ClaudeShift+TabCycle through available permission modesUp ArrowShow previously entered messagesCtrl+BRun the current task in the backgroundCtrl+CStop running tasks or commandsCtrl+DEnd the Claude Code sessionCtrl+FStop all running background agentsCtrl+GEdit input content in your text editorCtrl+JAdd a newline while typingCtrl+KDelete text from cursor to end of lineCtrl+LClear the terminal screenCtrl+OEnable or disable verbose output modeCtrl+RIncrementally search through command historyCtrl+TShow or hide the task list panelCtrl+UDelete all text on the current lineCtrl+VPaste clipboard image into Claude CodeCtrl+YPaste text deleted with Ctrl+K or Ctrl+UEsc+EscRewind recent changes or summarize conversationOption+PQuickly switch the AI modelOption+TEnable or disable extended thinking modeShift+EnterAdd a newline while typing in supported terminalsAlt+BMove cursor one word to the leftAlt+FMove cursor one word to the rightclaudeLaunch Claude Code in interactive modeclaude "Is there a bug in this code?"Execute a one-time question and exitcat file.py | claude -p "Review this code"Process data from standard inputclaude -cResume from the previous session's conversationclaude -rSelect and resume from session listclaude -r session-nameResume a specific named sessionclaude --model claude-sonnet-4-6Launch with a specific modelclaude --permission-mode planLaunch in plan mode (confirm before execution)claude --debugLaunch with debug information enabledclaude -d "api,hooks"Show debug info for specific categories onlyclaude --verboseLaunch with detailed debug loggingclaude --system-prompt "You are a TypeScript expert"Launch with a custom system promptclaude --append-system-prompt "Always respond in English"Keep the default system prompt and add custom instructionsclaude --effort highSet model reasoning level to highclaude --worktreeRun in an isolated Git worktree environmentclaude --worktree --tmuxLaunch worktree in a tmux session (uses iTerm2 native panes when available)claude --allowedTools "Bash,Read,Write"Restrict available tools on launchclaude --disallowedTools "Bash"Completely exclude specified tools from model contextclaude --tools "Bash,Edit,Read"Explicitly specify which built-in tools to useclaude --tools ""Disable all toolsclaude --dangerously-skip-permissionsSkip all permission checks in offline sandbox environmentsclaude --allow-dangerously-skip-permissionsAllow permission bypass without enabling it by defaultclaude -p "test" --output-format jsonOutput results in JSON formatclaude -p --input-format stream-jsonRun with realtime streaming input format (--print mode only)claude -p "user info" --json-schema '{"type":"object"}'Get structured output conforming to the specified JSON Schemaclaude -p --output-format stream-json --include-partial-messagesInclude partial message chunks in streaming outputclaude -p --input-format stream-json --output-format stream-json --replay-user-messagesRe-emit stdin user messages to stdout for acknowledgmentclaude --agent my-agentStart session with a specified agent configurationclaude --agents '{"reviewer":{"description":"Reviews code","prompt":"You are a code reviewer"}}'Define and use custom agents inlineclaude --mcp-config mcp.jsonLoad MCP server settings from a JSON file on launchclaude --mcp-config mcp.json --strict-mcp-configUse only the specified MCP servers, ignoring all other MCP configurationsclaude --disable-slash-commandsLaunch with all custom skills disabledclaude -c --fork-sessionContinue conversation as a new sessionclaude --session-id <uuid>Start or resume a session with a specific UUIDclaude -p --no-session-persistence "test"Run as a temporary session that is not saved and cannot be resumedclaude --from-pr 123Resume a session associated with the specified PR numberclaude -p "test" --fallback-model sonnetAuto-switch to fallback model when default is overloadedclaude --max-budget-usd 10Set maximum API spending in USD for the sessionclaude --add-dir /path/to/other-projectSpecify additional directories alongside the main directoryclaude --file file_abc:doc.txt file_def:img.pngDownload specified file resources on startupclaude --chromeLaunch with Claude in Chrome integration enabledclaude --ideAuto-connect to available IDE on startupclaude --plugin-dir /path/to/pluginsLoad plugins from the specified directory on launchclaude --settings settings.jsonLaunch with a custom settings fileclaude --setting-sources user,projectLoad only user and project settingsclaude --debug-file /tmp/claude-debug.logWrite debug logs to the specified file pathclaude --betas feature-nameInclude beta headers in API requestsclaude auth loginLog in to your Anthropic accountclaude auth logoutLog out of the current accountclaude agentsDisplay list of available agentsclaude mcp add server-name -s user -- commandAdd an MCP serverclaude mcp listList configured MCP serversclaude plugin listList installed pluginsclaude doctorDiagnose auto-updater statusclaude updateUpdate to the latest versionclaude installInstall Claude Code or switch to a specific versionclaude setup-tokenConfigure a long-lived authentication token for CI/CD environmentsClaude Code Commands is a comprehensive cheat sheet of slash commands, keyboard shortcuts, and CLI options available in Claude Code CLI. It covers all commands needed for daily development work, with descriptions and examples that can be copied with one click.
Claude Code is an AI coding assistant by Anthropic that allows you to interactively create, edit, and review code in the terminal.
/compact summarizes and compresses conversation history to reduce context window usage. /clear completely clears the conversation history and starts a new session.
claude "prompt" is one-shot mode that executes a prompt and displays the result. claude -p is pipe mode that can receive data from standard input and work with other commands via pipes.
Yes, use the /model command to switch models during a session. A list of available models will be displayed for you to choose from.
MCP (Model Context Protocol) servers are like plugins that extend Claude Code's capabilities. They enable integration with external tools and services, managed via the /mcp command or claude mcp command.