The Claude Code cheat sheet that's actually current
Every Claude Code slash command, keyboard shortcut, hook event, and CLI flag in one searchable page, checked against the version installed right now. Free to use. No sign up required.
Slash commands
77 entries/add-dir <path>Add a working directory for file access during the current session.
/advisor [model|off]Enable or disable the advisor tool, which consults a second model for guidance.
/agentsReminder to ask Claude to create or manage subagents, or edit agent configurations.
/autofix-pr [prompt]Spawn a Claude Code on the web session that watches the current branch's PR and pushes fixes.
/background [prompt]Detach the current session to run as a background agent and free up the terminal.
/batch <instruction>Orchestrate large-scale changes across a codebase in parallel using worktrees.
/branch [name]Create a branch of the current conversation to try a different direction.
/btw [question]Ask a quick side question without adding it to the conversation history.
/bug [report]Report a bug, optionally sharing your conversation with session history.
/cd <path>Move this session to a new working directory.
/chromeConfigure the Claude in Chrome browser integration.
/claude-api [migrate|managed-agents-onboard]Load Claude API reference material and Managed Agents reference into context.
/clear [name]Start a new conversation with empty context. Resets input history for the session.
/code-review [level] [--fix] [--comment] [target]Review the current diff for correctness bugs and cleanup opportunities.
/color [color|default]Set the prompt bar color for the current session.
/compact [instructions]Free up context by summarizing the conversation so far.
/config [key=value ...]Open the Settings interface, or set preferences directly from the command line.
/context [all]Visualize current context window usage as a colored grid.
/copy [N]Copy the last assistant response (or the Nth one back) to the clipboard.
/costAlias for /usage - show token usage and cost for the current session.
/dataviz [request]Get design guidance for charts, graphs, and dashboards before writing chart code.
/debug [description]Enable debug logging and troubleshoot a runtime issue.
/deep-research <question>Fan out web searches on a question and synthesize a cited report.
/design-loginAuthorize design-system access so /design-sync can run.
/design-sync [hint]Convert your repo's React design system and upload it to Claude Design.
/desktopContinue the current session in the Claude Code Desktop app.
/diffOpen an interactive diff viewer showing uncommitted changes.
/doctorRun a setup checkup that diagnoses and fixes installation issues.
/effort [level|auto]Set the model's reasoning effort level for the session.
/exitExit the CLI.
/export [filename]Export the current conversation as plain text.
/fast [on|off]Toggle fast mode on or off for the session.
/feedback [report]Send product feedback about Claude Code directly to Anthropic.
/fewer-permission-promptsScan your transcripts and add an allowlist to reduce permission prompts.
/focusToggle a focus view that shows only essential information.
/fork [prompt]Copy the current conversation into a new background session.
/goal [condition|clear]Set a goal that Claude keeps working toward across multiple turns.
/heapdumpWrite a JavaScript heap snapshot for diagnosing memory usage.
/helpShow help and the full list of available commands.
/hooksView the current hook configurations for tool events.
/ideManage IDE integrations and show connection status.
/initInitialize the project with a generated CLAUDE.md guide.
/insightsGenerate a report analyzing your Claude Code sessions.
/install-github-appInstall the Claude GitHub App for a repository.
/install-slack-appInstall the Claude Slack app (Claude Tag) for a workspace.
/keybindingsOpen your keyboard shortcuts file for editing.
/loginSign in to your Anthropic account.
/logoutSign out of your Anthropic account.
/loop [interval] [prompt]Run a prompt repeatedly on an interval while the session stays open.
/mcp [reconnect <server>|enable|disable]Manage MCP server connections and OAuth authentication.
/memoryEdit CLAUDE.md memory files and manage auto-memory.
/mobileShow a QR code to download the Claude mobile app.
/model [model]Switch the active model and save the choice as your default.
/passesShare a free week of Claude Code with friends.
/permissionsSet approval rules for file access, tool use, and other sensitive operations.
/pluginManage Claude Code plugins: install, enable, disable, update.
/pr-commentsPost code review findings as inline comments on a GitHub PR.
/recapSummarize the conversation so far in one message.
/renameRename the current session.
/resumeReturn to an earlier conversation or branch.
/reviewGive a fast, single-pass, read-only review of a GitHub pull request.
/rewindRoll code and conversation back to a checkpoint, or summarize part of the conversation.
Also reachable by pressing Esc twice on an empty prompt.
/security-reviewCheck the current diff for security vulnerabilities.
/statusShow current session status and background task progress.
/statuslineConfigure the status bar shown at the bottom of the terminal.
/tasksList the current session's background work, including subagents that have finished.
/terminal-setupConfigure terminal integration, including the Shift+Enter multiline binding.
/themeSet the display theme.
/todosManage a to-do list for the current session.
/tuiToggle between fullscreen and split-pane rendering modes.
/updateCheck for and install Claude Code updates.
/upgradeUpgrade your Claude subscription plan.
/usageShow token usage and costs for the current session.
/verifySkill that verifies code correctness and test coverage.
/vimToggle vim-style keybindings for the prompt input.
/voiceEnable or disable voice input and output.
/workflowsView and manage dynamic workflows.
Keyboard shortcuts
45 entriesCtrl+CInterrupt a running operation. On empty input, one press clears the prompt and a second exits Claude Code.
Ctrl+X Ctrl+KStop all running background subagents in this session.
Press twice within 3 seconds to confirm.
Ctrl+DExit the Claude Code session (or delete the character after the cursor when the prompt has text).
Ctrl+G (or Ctrl+X Ctrl+E)Open your prompt in your default text editor.
Ctrl+LRedraw the screen if the display looks garbled.
Press twice within two seconds to also run /clear.
Ctrl+OToggle the transcript viewer, showing detailed tool usage with timestamps.
Ctrl+RReverse search through your prompt history.
Ctrl+V (Cmd+V in iTerm2, Alt+V on Windows/WSL)Paste an image from the clipboard as an [Image #N] chip.
Ctrl+BMove a running Bash command or agent to the background.
tmux users press it twice, since tmux claims Ctrl+B as its own prefix key.
Ctrl+TToggle Claude's to-do task checklist in the status area.
Ctrl+SStash the current prompt text, or restore it when pressed again on an empty prompt.
Ctrl+ZSuspend Claude Code to your shell (Unix only). Run fg to resume.
Left / Right arrowsCycle through tabs in permission dialogs and menus.
Up / Down arrows (or Ctrl+P / Ctrl+N)Move the cursor within a multiline prompt, then step through command history.
EscInterrupt Claude mid-turn, or close an open dialog.
Esc EscClear the input draft, or open the rewind menu when the prompt is already empty.
Shift+Tab (or Alt+M on some Windows terminals)Cycle through permission modes: default, acceptEdits, plan, and any you've enabled.
Option+P (macOS) / Alt+P (Windows/Linux)Switch models without clearing your current prompt.
Option+T (macOS) / Alt+T (Windows/Linux)Toggle extended thinking mode.
Option+O (macOS) / Alt+O (Windows/Linux)Toggle fast mode.
Ctrl+AMove the cursor to the start of the current line.
Ctrl+EMove the cursor to the end of the current line.
Ctrl+KDelete to the end of the line, storing the text for pasting.
Ctrl+UDelete from the cursor to the start of the line, storing the text for pasting.
Ctrl+WDelete the previous word, storing the text for pasting.
Ctrl+YPaste text deleted with Ctrl+K, Ctrl+U, or Ctrl+W.
Alt+Y (after Ctrl+Y)Cycle through previously deleted text.
Alt+BMove the cursor back one word.
Alt+FMove the cursor forward one word.
Ctrl+_ (or Ctrl+Shift+-)Undo the last input edit.
\ + EnterInsert a newline in the prompt. Works in every terminal with no setup.
Option+EnterInsert a newline after enabling Option as Meta on macOS.
Shift+EnterInsert a newline natively in iTerm2, WezTerm, Ghostty, Kitty, Warp, Terminal.app, and Windows Terminal.
In VS Code, Cursor, Alacritty, or Zed, run /terminal-setup first to install the binding.
Ctrl+JInsert a newline. Works in any terminal without configuration.
Paste directlyPaste multiline content like code blocks or logs straight into the prompt.
/ at the start of inputOpen the command or skill menu.
! at the start of inputEnter shell mode and run a command directly, without Claude's approval.
@Trigger file path autocomplete.
:name:Type a full emoji shortcode to insert it, or two-plus letters for suggestions.
? on empty inputToggle the shortcut help panel.
? (in transcript viewer)Toggle the keyboard shortcut help panel inside the transcript viewer.
{ / } (in transcript viewer)Jump to the previous or next user prompt, like a vim paragraph motion.
[ (in transcript viewer)Write the full conversation to your terminal's native scrollback so you can search it.
q, Ctrl+C, or Esc (in transcript viewer)Exit the transcript viewer.
Hold or tap SpaceVoice dictation. Hold to record, or run /voice tap for tap-to-toggle.
Vim mode
63 entries/config -> Editor modeTurn on vim-style editing for the prompt input.
vimInsertModeRemaps (settings.json)Map a two-key INSERT-mode sequence like "jj" to Escape.
Only read from user or managed settings, never a project's .claude/settings.json - a checked-out repo can't remap your keystrokes.
EscEnter NORMAL mode from INSERT or VISUAL mode.
iInsert text before the cursor.
IInsert text at the beginning of the line.
aInsert text after the cursor.
AInsert text at the end of the line.
oOpen a new line below and enter INSERT mode.
OOpen a new line above and enter INSERT mode.
vStart character-wise visual selection.
VStart line-wise visual selection.
h / j / k / lMove left / down / up / right.
SpaceMove right.
wJump to the next word.
eJump to the end of the current word.
bJump to the previous word.
0Jump to the beginning of the line.
$Jump to the end of the line.
^Jump to the first non-blank character on the line.
ggJump to the beginning of the input.
GJump to the end of the input.
f{char}Jump to the next occurrence of a character.
F{char}Jump to the previous occurrence of a character.
t{char}Jump to just before the next occurrence of a character.
T{char}Jump to just after the previous occurrence of a character.
;Repeat the last f/F/t/T motion.
,Repeat the last f/F/t/T motion in reverse.
/ (in NORMAL mode)Open reverse history search, same as Ctrl+R.
xDelete the character under the cursor.
ddDelete the current line.
DDelete to the end of the line.
dw / de / dbDelete the word, to its end, or back a word.
ccChange (clear and re-insert) the current line.
CChange to the end of the line.
cw / ce / cbChange the word, to its end, or back a word.
sSubstitute the character under the cursor and enter INSERT mode.
SSubstitute the whole line and enter INSERT mode.
yy / YYank (copy) the current line.
yw / ye / ybYank the word, to its end, or back a word.
pPaste after the cursor.
PPaste before the cursor.
>>Indent the current line.
<<Dedent the current line.
JJoin the current line with the next.
uUndo the last change.
.Repeat the last change.
iw / awInner or around a word (a text object, used with d, c, or y).
iW / aWInner or around a WORD, delimited by whitespace only.
i" / a"Inner or around double quotes.
i' / a'Inner or around single quotes.
i( / a(Inner or around parentheses.
i[ / a[Inner or around brackets.
i{ / a{Inner or around braces.
d / x (VISUAL mode)Delete the selection.
y (VISUAL mode)Yank the selection.
c / s (VISUAL mode)Change the selection.
p (VISUAL mode)Replace the selection with register contents.
r{char} (VISUAL mode)Replace every selected character with {char}.
~ / u / U (VISUAL mode)Toggle, lowercase, or uppercase the selection.
> / < (VISUAL mode)Indent or dedent the selected lines.
J (VISUAL mode)Join the selected lines.
o (VISUAL mode)Swap the cursor and the anchor of the selection.
v / V (VISUAL mode)Toggle between character-wise and line-wise selection, or exit visual mode.
Permissions & settings
12 entriesdefaultRequires your approval for each action.
Shown as "Manual" in the mode indicator.
acceptEditsAutomatically accepts file edits without prompting for approval.
planRequires you to review and approve Claude's plan before it executes anything.
autoClassifier-based mode that automatically blocks or allows actions based on configured rules.
bypassPermissionsSkips every permission check.
Recommended only in sandboxes with no internet access.
Shift+TabCycles through default, acceptEdits, plan, and any other modes you've enabled.
Managed settingsHighest precedence. Deployed by IT to every organization member or machine user.
.claude/settings.local.jsonProject-specific and personal. Gitignored, applies to you alone in this repository.
.claude/settings.jsonProject scope. Committed to the repo so every collaborator gets the same rules.
~/.claude/settings.jsonUser scope. Applies to every project on your machine and is never shared.
.mcp.jsonProject-scoped MCP server config, meant to be committed so the whole team gets the same servers.
~/.claude.jsonUser-scope MCP servers and CLI state, tracked per project, never committed.
Hooks events
34 entriesSessionStartFires when a session begins or resumes.
SetupFires when you start Claude Code with --init-only, or with --init or --maintenance in -p mode.
UserPromptSubmitFires when you submit a prompt, before Claude processes it.
UserPromptExpansionFires when a user-typed command expands into a prompt, before it reaches Claude.
PreToolUseFires before a tool call executes.
PermissionRequestFires when a tool call needs a permission decision.
PermissionDeniedFires when a tool call is denied by the auto mode classifier.
PostToolUseFires after a tool call succeeds.
PostToolUseFailureFires after a tool call fails.
PostToolBatchFires after a full batch of parallel tool calls resolves, before the next model call.
NotificationFires when Claude Code sends a notification.
MessageDisplayFires while assistant message text is displayed.
SubagentStartFires when a subagent is spawned.
SubagentStopFires when a subagent finishes.
TaskCreatedFires when a task is being created via TaskCreate.
TaskCompletedFires when a task is being marked as completed.
StopFires when Claude finishes responding.
One of several events that ignores matchers entirely.
StopFailureFires when the turn ends due to an API error.
TeammateIdleFires when an agent team teammate is about to go idle.
InstructionsLoadedFires when a CLAUDE.md or .claude/rules/*.md file is loaded into context.
ConfigChangeFires when a configuration file changes during a session.
CwdChangedFires when the working directory changes.
DirectoryAddedFires when a working directory is added mid-session.
FileChangedFires when a watched file changes on disk.
WorktreeCreateFires when a worktree is being created.
The one event where any non-zero exit code aborts the action, not just exit 2.
WorktreeRemoveFires when a worktree is being removed.
PreCompactFires before context compaction.
PostCompactFires after context compaction completes.
ElicitationFires when an MCP server requests user input during a tool call.
ElicitationResultFires after a user responds to an MCP elicitation.
SessionEndFires when a session terminates.
Exit 0Success. Claude Code parses stdout for JSON output fields - JSON is only processed on exit 0.
Exit 2Blocking error. Stderr is fed back to Claude as the reason; the exact effect depends on the event (PreToolUse blocks the tool call, UserPromptSubmit rejects the prompt).
Any other exit codeNon-blocking error for most events - the transcript shows the first line of stderr and execution continues.
CLI flags
45 entries--add-dir <directories...>Allow tool access to additional directories beyond the current working one.
--agent <agent>Set the agent for the current session, overriding the agent setting.
--agents <json>Define custom agents inline as a JSON object for this session only.
--allowedTools, --allowed-tools <tools...>Allow specific tools without a permission prompt, e.g. "Bash(git *) Edit".
--disallowedTools, --disallowed-tools <tools...>Deny specific tools for this session.
--append-system-prompt <prompt>Append extra instructions to the default system prompt.
-c, --continueContinue the most recent conversation in the current directory.
-r, --resume [value]Resume a conversation by session ID, or open the interactive picker.
--dangerously-skip-permissionsBypass all permission checks.
Recommended only for sandboxes with no internet access.
-d, --debug [filter]Enable debug mode, optionally filtered by category, e.g. "api,hooks".
--effort <level>Set the reasoning effort for the session: low, medium, high, xhigh, or max.
--fallback-model <model>Automatically fall back to another model when the default is overloaded.
Only works with --print.
--ideAutomatically connect to the IDE on startup if exactly one valid IDE is available.
--mcp-config <configs...>Load MCP servers from JSON files or strings for this session.
--strict-mcp-configOnly use MCP servers passed via --mcp-config, ignoring every other configured source.
--model <model>Set the model for the session, by alias (fable, opus, sonnet) or full name.
-n, --name <name>Set a display name for the session, shown in the prompt box and the /resume picker.
--no-chromeDisable the Claude in Chrome integration for this session.
--permission-mode <mode>Set the permission mode at startup: acceptEdits, auto, bypassPermissions, manual, dontAsk, or plan.
--plugin-dir <path>Load a plugin from a local directory or .zip for this session only.
-p, --printPrint the response and exit, for piping into other commands.
--output-format <format>Set the print-mode output format: text, json, or stream-json.
--input-format <format>Set the print-mode input format: text or stream-json.
--json-schema <schema>Constrain print-mode output to a JSON Schema.
--max-budget-usd <amount>Cap dollar spend on API calls for this run.
Only works with --print.
--session-id <uuid>Use a specific session ID for the conversation.
--setting-sources <sources>Choose which settings sources load: user, project, local.
--settings <file-or-json>Load extra settings from a file path or a JSON string.
--system-prompt <prompt>Replace the default system prompt entirely.
--tools <tools...>Restrict the built-in tool list available this session.
--verboseOverride the verbose mode setting from config.
-v, --versionPrint the installed Claude Code version.
-w, --worktree [name]Create a new git worktree for this session.
--bareMinimal mode: skip hooks, plugins, auto-memory, and CLAUDE.md auto-discovery.
--safe-modeDisable all customizations (CLAUDE.md, skills, plugins, hooks, MCP, themes) to troubleshoot a broken config.
claude mcp add <name> <commandOrUrl>Add an MCP server, local (stdio) or remote (HTTP), to Claude Code.
claude mcp listList every configured MCP server and its connection health.
claude mcp remove <name>Remove a configured MCP server.
claude agentsManage background agents from the terminal: list, dispatch, inspect.
claude auth loginSign in to your Anthropic account from the CLI.
claude auth statusShow the current authentication status.
claude doctorCheck the health of your Claude Code installation from outside a session.
claude plugin install <plugin>Install a plugin from an available marketplace.
claude updateCheck for updates and install the latest version.
claude project purge [path]Delete all Claude Code state for a project: transcripts, tasks, file history, config entry.
This is one searchable page, not a PDF: every built-in slash command, every keyboard shortcut and vim binding, the five permission modes and the settings file precedence, all 31 hook lifecycle events with their exit-code rules, and the CLI flags you actually reach for. Type into the search box and it filters across all of it at once, or pick a category tab to browse one section at a time.
The reason this exists is that Claude Code ships changes constantly and a cheat sheet written once goes stale fast. Pulling the list straight from the installed CLI's own help output turned up commands that most write-ups from even a few months back miss entirely: /btw for a side question that never touches your conversation history, /goal for a condition Claude keeps working toward across turns, /loop for running a prompt on a repeating interval, and /workflows for the scripted multi-agent runs this exact page could be one of. A static list can't catch up to that pace. This one gets rechecked against the CLI and the official docs, not rewritten from memory.
The permission modes section is the part people usually get wrong by half-remembering it. Shift+Tab cycles through default (labeled Manual in the UI), acceptEdits, plan, and auto or bypassPermissions if you've turned them on, and settings resolve in a fixed order: managed settings first, then command-line flags, then .claude/settings.local.json, then the committed .claude/settings.json, then your personal ~/.claude/settings.json last. Get that order backwards and a rule that should win silently loses. The settings.json generator builds the file itself if you're setting these rules up for the first time.
Hooks are the section with the most room to get burned, because the exit code is the only thing that decides whether anything actually blocks. Exit 0 means success and Claude Code parses stdout for JSON; exit 2 is the one that blocks the action and hands your stderr message back to Claude as the reason; any other code is non-blocking almost everywhere except WorktreeCreate, which treats every non-zero exit as a hard failure. All 31 events are listed here with when each one fires, and the complete hooks guide is where I go deeper on why PreToolUse and Stop are the two worth building around first.
Vim mode gets maybe a sentence in most other write-ups on this keyword, if it gets mentioned at all. It's here in full: mode switching, every NORMAL-mode motion and edit, the text objects, and visual mode, plus the vimInsertModeRemaps setting for mapping something like jj to Escape. Turn it on from /config under Editor mode.
I run Claude Code daily and this is the same reference I keep open in a tab while I work. If you want the finished version of the whole idea - a tuned CLAUDE.md, a tuned settings.json, and the full vetted tool stack, installed in one paste - that is what ClockedCode is. The link is at the bottom of this page.
FAQ
What's actually in this Claude Code cheat sheet?
Six categories: every built-in slash command, keyboard shortcuts (general controls, text editing, multiline input), vim-mode bindings, the five permission modes plus the settings file precedence, all 31 hook lifecycle events with their exit-code rules, and the CLI flags and subcommands from claude --help. It adds up to around 280 entries, all searchable from one box.
How do I know this is actually up to date?
The version and date are printed in the ledger above the search box. Every entry was pulled from the CLI actually installed on the machine that built this page (v2.1.220) and the official docs at code.claude.com, not copied from an older write-up, so it catches newer commands like /btw and /workflows that predate most competing lists.
Does this cover keyboard shortcuts too, or just commands?
Yes - keyboard shortcuts and vim-mode bindings are their own tabs, covering everything from Ctrl+O toggling the transcript viewer to the full set of vim text objects like iw and i". Search box works across every category at once, so typing "model" surfaces the /model command, the Option+P shortcut, and the --model flag together.
What's the difference between the permission modes?
default (shown as Manual) asks before every action, acceptEdits auto-approves file edits only, plan makes you approve Claude's plan before anything runs, auto uses a rule-based classifier to decide automatically, and bypassPermissions skips checks entirely and is meant for sandboxes with no internet access. Shift+Tab cycles through whichever ones you have enabled.
Is this cheat sheet free?
Yes - free, no sign-up, and the search runs entirely in your browser against a static list. ClockedCode separately sells a complete done-for-you Claude Code setup, but this reference itself is not gated.
Other free tools
Hooks Preset Generator
Pick the automations you want, and get a validated Claude Code hooks block for settings.json, grouped and merged the same way the official examples are.
Try toolConfig generatorPermissions Generator
Pick a safe starting mode and your OS, and get a validated allow/deny permissions block for settings.json in under a minute.
Try toolConfig generatorOutput Style Generator
Pick a persona and a tone, and get a valid output-style file with correct frontmatter, ready to save and switch to.
Try toolConfig generatorSubagent Generator
Describe the job in plain English, pick a specialty, and get a complete subagent file ready to save.
Try toolConfig generatorMCP Config Generator
Pick the MCP servers you use and get the exact claude mcp add commands or a ready .mcp.json block, scoped and copy-pasteable.
Try toolConfig generatorSlash Command Generator
Answer 7 quick questions and get a custom Claude Code slash command with valid frontmatter, ready to drop into .claude/commands/.
Try toolConfig generatorStatusline Generator
Toggle the segments you want, watch the exact statusline render live, then copy the tested script and settings.json block.
Try toolConfig generatorsettings.json Generator
Pick permission rules, hook presets, env vars, and a model override one step at a time, then copy or download the finished settings.json.
Try toolConfig generatorCLAUDE.md Generator
Answer 7 quick questions, get a tuned CLAUDE.md for your project in 30 seconds.
Try toolTemplate libraryClaude Code Templates
A curated library of copy-paste Claude Code templates: subagents, hooks, slash commands, settings, and CLAUDE.md starters, each one explained and pulled from a setup that gets used every day.
Try toolToken scannerUsageCut
Scan your Claude Code setup in 30 seconds and see exactly what is burning your tokens - bloated context, heavy MCP servers, and settings quietly draining your usage limits.
Try tool