Claude Code Cheat Sheet & Quick Reference

Setup and Access

$curl -fsSL https://claude.ai/install.sh | bash
$curl -fsSL https://claude.ai/install.sh | bash

Install Claude Code natively on macOS, Linux, or WSL with automatic background updates.

$irm https://claude.ai/install.ps1 | iex

Install Claude Code with the native installer from Windows PowerShell with automatic background updates.

$curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd

Install Claude Code with the native installer from Windows CMD with automatic background updates.

$brew install --cask claude-code

Install Claude Code with Homebrew on macOS.

$brew upgrade claude-code

Homebrew installations do not auto-update. Run this to get the latest features and security fixes (use brew upgrade claude-code@latest if you installed that cask).

$winget install Anthropic.ClaudeCode

Install Claude Code with WinGet on Windows.

$winget upgrade Anthropic.ClaudeCode

WinGet installations do not auto-update. Run this command to get the latest features and security fixes.

$claude

Start an interactive Claude Code session in the current project.

$claude -v

Show the installed Claude Code version.

$claude update

Manually update Claude Code to the latest version.

$claude -p --init "query"

Run Setup hooks with the init matcher before the session (print mode only).

$claude auth login

Log in to your Claude account from the terminal. Use --email to pre-fill email, --sso to force SSO, or --console to use Console API billing.

$claude auth status
$claude auth status --text

Show authentication status as JSON, or pass --text for human-readable output. Exits with code 0 if logged in, 1 if not.

$claude "explain this project"

Start an interactive session with an initial prompt.

/init

Initialize project guidance files for the current project.

/memory

Open Claude memory management from inside the session.

/login

Sign in to your Anthropic account.

/logout

Sign out from your Anthropic account.

/mobile
/ios
/android

Show QR code to download the Claude mobile app.

/import codex
/import gemini
/import cursor

Bring configuration from OpenAI Codex, Google Gemini CLI, or Cursor into Claude Code, including instruction files, MCP servers, commands, subagents, and skills.

$claude install stable

Install or reinstall the native Claude Code binary. Pass a version number, stable, or latest.

$claude doctor

Run read-only installation and settings diagnostics without starting a session.

$claude setup-token

Generate a long-lived OAuth token for CI and scripts. Requires a Claude subscription.

Prompting and Input

$claude -p "explain this function"

Run Claude once in print mode and exit with a single response.

Ctrl + G
Ctrl + X then Ctrl + E

Open the current prompt in your default text editor.

/btw what was the name of that config file again?

Ask a side question without adding it to the main conversation history. Can run while Claude is working.

Ctrl + K

Delete from the cursor to the end of the line.

Ctrl + U

Delete from the cursor back to the start of the current line. Press again to clear across lines in multiline input.

Ctrl + Y

Paste text deleted with readline kill commands.

Alt + Y

Cycle through earlier kill-ring entries after pasting.

Alt + B

Move the cursor back by one word.

Alt + F

Move the cursor forward by one word.

Ctrl + V (or Cmd + V in iTerm2)Alt + VCtrl + V (or Alt + V on WSL)

Paste an image from the clipboard.

\ + Enter
Shift + Enter
Ctrl + J
Option + EnterShift + EnterShift + Enter

Insert a newline for multiline input. Shift+Enter needs a supported terminal (run /terminal-setup); on macOS, enable Option as Meta for Option+Enter.

/

Open the slash command picker from the start of the prompt.

!

Enter bash mode from the start of the prompt.

@

Trigger file path autocomplete.

Tab

Accept a prompt suggestion for editing.

Enter

Submit the prompt suggestion already placed in the input with Tab or the right arrow.

Escape
Backspace
Ctrl + U

Exit bash mode when the prompt is empty.

/voice

Toggle voice dictation (hold or tap mode).

Space
Enter
Escape

Dismiss a /btw side-question overlay and return to the main prompt.

/goal all tests passing
/goal clear

Set a goal: Claude keeps working across turns until the condition is met. Pass clear to remove an active goal early.

/loop 5m check if the deploy finished

Run a prompt repeatedly while the session stays open, with an interval such as 5m, or let Claude self-pace. Alias: /proactive.

/schedule

Create, update, list, or run routines, which execute in the cloud on a schedule. Alias: /routines.

/deep-research compare state of the art RAG approaches

Fan out web searches on a question, fetch and cross-check sources, and synthesize a cited report.

Ctrl + S

Stash the current prompt for later. With text in the input, stashes it and clears the prompt; pressed again on an empty prompt, restores the stashed text.

Ctrl + A

Move the cursor to the start of the current line. In multiline input, moves to the start of the current logical line.

Ctrl + E

Move the cursor to the end of the current line. In multiline input, moves to the end of the current logical line.

Ctrl + W

Delete back to the previous whitespace. One press removes a whole path or --flag=value.

Alt + D

Delete to the end of the current word, or to the end of the next word when the cursor is between words.

Ctrl + _
Ctrl + Shift + -

Undo the last input edit, restoring the previous input text and cursor position.

Ctrl + Enter
Ctrl + X then Ctrl + S

Send your queued messages, and your draft with them, right away while Claude is still working.

$claude -p "query" --output-format json

Get JSON output from print mode for scripts and automation.

$claude --fallback-model sonnet,haiku "query"

Enable automatic fallback to the specified model(s) when the primary model is overloaded or unavailable. Accepts a comma-separated list tried in order.

$claude -p --max-turns 3 "query"
$claude -p --max-budget-usd 5.00 "query"

Limit agentic turns or set a spending cap for print mode runs.

Sessions and Context

$claude -c
$claude --continue

Continue most recent conversation in current directory.

$claude --resume auth-refactor
$claude -r

Resume a specific session by ID or name, or show an interactive picker to choose a session.

/clear
/reset
/new

Clear the current session and start a fresh conversation.

/compact "keep only the important parts"

Compact the current conversation to keep only the important context.

/resume

Resume a conversation by ID or name, or open the session picker; background sessions appear marked with bg.

/rename feature-auth

Rename the current conversation.

/fork bug-investigation

Copy the current conversation into a new background session and keep working here. Pass a prompt to start the copy on it immediately. To switch into a branch yourself, use /branch; to hand a task to a subagent that reports back, use /subtask.

/context

Show how much context is currently in use.

/plan fix the auth bug

Enter plan mode, optionally passing a task description to start planning immediately.

/tasks

View and manage background work in the current session, including running shells and finished subagents. This is the background-task view, not Claude's to-do checklist.

/copy

Copy the last assistant response to the clipboard. Pass a number N to copy the Nth-latest response, or pick individual code blocks from the interactive picker.

/export notes.txt

Export the current conversation as plain text, optionally to a file.

/desktop
/app

Continue the current session in the Claude Code Desktop app (macOS or x64 Windows).

/add-dir <path>

Add a new working directory to the current session.

/branch feature-auth

Create a branch of the current conversation at this point.

/remote-control
/rc

Enable remote control of the current session from claude.ai.

Esc + Esc

Clear the input draft when text is present (press Up to recall it); on an empty prompt, open the rewind menu to restore or summarize code and conversation.

/background

Detach the current session to run as a background agent and free your terminal. Pass a prompt to send one more instruction before detaching. Alias: /bg.

/subtask refactor the auth module

Spawn a forked subagent that inherits the full conversation and works on the task while you keep working. Its result returns to this conversation when it finishes.

/cd ../other-project

Move the session to a new working directory while keeping the conversation.

/recap

Generate a one-line summary of the current session on demand.

/teleport

Pull a cloud session from claude.ai into this terminal. Opens a picker, then fetches the branch and conversation. Alias: /tp.

/autocompact 500k
/autocompact auto

Set the auto-compact window: how full the context window gets before Claude Code compacts automatically. Pass a size such as 500k, or auto for the model-tuned default.

$claude -w feature-auth
$claude --worktree

Start Claude in an isolated git worktree at .claude/worktrees/<name> so parallel sessions do not conflict. If no name is given, one is auto-generated.

$claude -n "my-feature-work"

Set a display name for the session, shown in /resume and the terminal title. Resume it later with claude --resume <name>.

$claude --resume abc123 --fork-session

When resuming, create a new session ID instead of reusing the original, keeping the original conversation untouched.

$claude --from-pr 123

Open the session picker filtered to sessions linked to a pull request; accepts a PR number or GitHub/GitLab/Bitbucket URL. Sessions link automatically when Claude creates the PR.

$claude --teleport

Resume a web session from claude.ai in your local terminal.

$claude --cloud "Fix the login bug"

Create a new cloud session on claude.ai with the provided task description. The --remote alias is deprecated.

$claude --remote-control "My Project"
$claude --rc "My Project"

Start an interactive session with Remote Control enabled so you can also control it from claude.ai or the Claude app.

$claude --bg "investigate the flaky test"
$claude --bg --exec 'pytest -x'

Start the session as a background agent and return immediately. Combine with --exec to run a shell command as a background job.

$claude agents

Open agent view to monitor and dispatch parallel background sessions.

$claude logs 7c5dcf5d
$claude attach 7c5dcf5d

Print recent output from a background session, or attach to it in this terminal.

$claude stop 7c5dcf5d
$claude respawn 7c5dcf5d
$claude rm 7c5dcf5d

Stop, restart, or remove a background session from the shell.

Navigation and Control

Ctrl + C

Cancel the current input or generation.

Ctrl + X then Ctrl + K

Stop all running background subagents in this session (press twice within 3 seconds to confirm).

Ctrl + D

Exit the Claude Code session.

/exit
/quit

Exit Claude Code from the command prompt.

Ctrl + L

Redraw the terminal screen, keeping input and conversation history.

Ctrl + O

Toggle the transcript viewer to inspect detailed tool usage and execution.

Ctrl + B

Background running tasks. Tmux users press Ctrl+B twice.

Ctrl + T

Show or hide the task list.

Cycle through tabs in dialogs and menus.

Navigate command history.

Ctrl + Z

Suspend Claude Code to your shell (Unix only). Run fg to resume.

Review and Diagnostics

/diff

Show the current diff inside Claude.

/rewind
/checkpoint
/undo

Rewind the conversation and/or code to an earlier checkpoint, or summarize from a selected message.

/doctor
/checkup

Run a setup checkup that diagnoses installation, settings, extension, and CLAUDE.md problems and proposes fixes Claude applies after you confirm.

/status

Show current Claude session and account status.

/stats

Alias for /usage that opens the Stats tab, showing session cost, plan usage limits, and activity stats.

/insights

Generate a report analyzing Claude Code sessions, interaction patterns, and friction points.

/usage

Show current usage information.

/cost

Show current spend and cost information.

/security-review

Review the current branch for security issues.

Cmd + ClickCtrl + ClickCtrl + Click

Open the linked pull request from the footer.

/code-review
/code-review high 1234
/code-review ultra --fix
/review

Review the current diff, or a PR number, branch, or path, for correctness bugs. Pass --fix to apply findings, --comment to post them on the PR, or ultra for a deep multi-agent cloud review. Alias: /review.

/simplify

Review the changed code for cleanup opportunities and apply the fixes. Four agents run in parallel covering reuse, simplification, efficiency, and abstraction level. Does not look for correctness bugs; use /code-review for those.

/verify

Confirm a code change does what it should by building the app, running it, and observing the result, rather than relying on tests or type checks.

/debug login fails on safari

Enable debug logging for the current session and troubleshoot issues by reading the session debug log. Optionally describe the issue to focus the analysis.

$claude ultrareview 1234 --json

Run a cloud-hosted multi-agent code review non-interactively and print the findings.

Reverse Search

Ctrl + R

Start reverse search through command history or cycle through older matches.

Tab
Esc

Accept the current reverse-search match for editing.

Enter

Accept the current reverse-search match and execute it.

Backspace

Exit reverse search when the query is empty.

Ctrl + C

Cancel reverse search and restore your original input.

Configuration and Integrations

/config
/settings
/config theme=dark

Open the Settings interface, or pass key=value pairs to set a setting directly, such as /config thinking=false or /config model=sonnet.

/theme

Open the theme picker.

/color orange

Set the prompt bar color for the current session.

/keybindings

Open keybinding configuration.

/terminal-setup

Install terminal-specific bindings such as Shift+Enter support.

/model

Switch models from inside the current session.

/effort high

Change the current reasoning effort level.

/fast on

Toggle fast mode in the current session.

/permissions
/allowed-tools

Open permission settings.

/sandbox

Toggle sandbox mode. Available on supported platforms only.

/mcp

Manage MCP server integrations.

/plugin

Manage plugins from inside the session.

/reload-plugins

Reload installed plugins.

/ide

Manage IDE integrations and show connection status.

/agents

Print a reminder to ask Claude to create or manage subagents, or to edit .claude/agents/ or ~/.claude/agents/ directly.

/hooks

View hook configurations for tool events and automations.

/config

Toggle between Vim and Normal editing modes from the Settings interface. Removed as the /vim command in v2.1.92.

/statusline

Configure Claude Code's status line display in your shell prompt.

Shift + TabShift + Tab or Alt + M (when VT input mode is unavailable)Shift + Tab

Toggle permission modes.

Option + PAlt + PAlt + P

Switch models without clearing the current prompt.

Option + TAlt + TAlt + T

Toggle extended thinking mode.

Ctrl + T

Toggle syntax highlighting inside the theme picker.

/usage-credits

Configure usage credits, or request them from your admin, when you hit a rate limit. Previously /extra-usage.

/output-style concise

List output styles or switch to one.

/update-config allow npm test without prompting

Describe a settings change, such as allowing a command or adding a hook, and Claude edits the matching settings.json file. For theme and model, use /config instead.

/fewer-permission-prompts

Scan your transcripts for common read-only Bash and MCP tool calls, then add a prioritized allowlist to project settings to reduce permission prompts.

/skill-doctor

Show what each of your skills costs in context and how often it gets used, so you can find skills to turn off.

/list-agents
/peers

List the subagents, agent team teammates, and other Claude Code sessions Claude can message, with the name to use for each. Alias: /peers.

Option + OAlt + OAlt + O

Toggle fast mode on or off.

$claude --agents '{"reviewer":{"description":"Reviews code","prompt":"You are a code reviewer"}}'

Define custom subagents dynamically at launch via JSON; with --print, also accepts the path to a JSON file.

$claude --tools "Bash,Edit,Read"

Restrict which built-in tools Claude can use. Use "" to disable all, "default" for the default set, or list tool names.

$claude --effort high

Set the effort level for the session at launch: low, medium, high, xhigh, max, or ultracode (model-dependent).

$claude --add-dir ../apps ../lib

Add additional working directories for Claude to access at launch.

$claude --permission-mode plan

Begin the session in a specified permission mode, such as plan.

$claude --mcp-config ./mcp.json
$claude --strict-mcp-config --mcp-config ./mcp.json

Load MCP servers from JSON files or strings, optionally ignoring all other MCP configuration.

$claude --safe-mode

Start with all customizations disabled to troubleshoot a broken configuration.

$claude --bare -p "query"

Start in minimal mode for scripts: skip hooks, skills, plugins, MCP servers, and CLAUDE.md discovery.

$claude --chrome
$claude --no-chrome

Enable or disable the Chrome browser integration for web automation and testing.

$claude --settings ./settings.json

Load settings from a JSON file or an inline JSON string for this session.

$claude --plugin-dir ./my-plugin

Load a plugin from a directory or .zip archive for this session only.

$claude -p --json-schema '{"type":"object","properties":{...}}' "query"

Get validated JSON output matching a JSON Schema after the agent completes its workflow (print mode only).

Help and Discovery

/help

Open the built-in slash command help.

/skills

Open the available skills list.

/release-notes

View the full changelog with recent version updates.

/feedback
/bug

Submit feedback or report bugs. /bug (alias /share) opens the same dialog as /feedback.

?

Toggle the keyboard shortcut help panel when the prompt is empty.