[proxy] code.claude.com← back | site home | direct (HTTPS) ↗ | proxy home | ◑ dark◐ light

Interactive mode - Claude Code Docs

Keyboard shortcuts

General controls

ShortcutDescriptionContext
Ctrl+CCancel current input or generationStandard interrupt
Ctrl+FKill all background agents. Press twice within 3 seconds to confirmBackground agent control
Ctrl+DExit Claude Code sessionEOF signal
Ctrl+GOpen in default text editorEdit your prompt or custom response in your default text editor
Ctrl+LClear terminal screenKeeps conversation history
Ctrl+OToggle verbose outputShows detailed tool usage and execution
Ctrl+RReverse search command historySearch through previous commands interactively
Ctrl+V or Cmd+V (iTerm2) or Alt+V (Windows)Paste image from clipboardPastes an image or path to an image file
Ctrl+BBackground running tasksBackgrounds bash commands and agents. Tmux users press twice
Ctrl+TToggle task listShow or hide the task list in the terminal status area
Left/Right arrowsCycle through dialog tabsNavigate between tabs in permission dialogs and menus
Up/Down arrowsNavigate command historyRecall previous inputs
Esc + EscRewind or summarizeRestore code and/or conversation to a previous point, or summarize from a selected message
Shift+Tab or Alt+M (some configurations)Toggle permission modesSwitch between Auto-Accept Mode, Plan Mode, and normal mode.
Option+P (macOS) or Alt+P (Windows/Linux)Switch modelSwitch models without clearing your prompt
Option+T (macOS) or Alt+T (Windows/Linux)Toggle extended thinkingEnable or disable extended thinking mode. Run /terminal-setup first to enable this shortcut

Text editing

ShortcutDescriptionContext
Ctrl+KDelete to end of lineStores deleted text for pasting
Ctrl+UDelete entire lineStores deleted text for pasting
Ctrl+YPaste deleted textPaste text deleted with Ctrl+K or Ctrl+U
Alt+Y (after Ctrl+Y)Cycle paste historyAfter pasting, cycle through previously deleted text. Requires Option as Meta on macOS
Alt+BMove cursor back one wordWord navigation. Requires Option as Meta on macOS
Alt+FMove cursor forward one wordWord navigation. Requires Option as Meta on macOS

Theme and display

ShortcutDescriptionContext
Ctrl+TToggle syntax highlighting for code blocksOnly works inside the /theme picker menu. Controls whether code in Claude’s responses uses syntax coloring

Multiline input

MethodShortcutContext
Quick escape\ + EnterWorks in all terminals
macOS defaultOption+EnterDefault on macOS
Shift+EnterShift+EnterWorks out of the box in iTerm2, WezTerm, Ghostty, Kitty
Control sequenceCtrl+JLine feed character for multiline
Paste modePaste directlyFor code blocks, logs

Quick commands

ShortcutDescriptionNotes
/ at startCommand or skillSee built-in commands and skills
! at startBash modeRun commands directly and add execution output to the session
@File path mentionTrigger file path autocomplete

Built-in commands

Type / in Claude Code to see all available commands, or type / followed by any letters to filter. Not all commands are visible to every user. Some depend on your platform, plan, or environment. For example, /desktop only appears on macOS and Windows, /upgrade and /privacy-settings are only available on Pro and Max plans, and /terminal-setup is hidden when your terminal natively supports its keybindings. Claude Code also ships with bundled skills like /simplify, /batch, and /debug that appear alongside built-in commands when you type /. To create your own commands, see skills. In the table below, <arg> indicates a required argument and [arg] indicates an optional one.

CommandPurpose
/add-dir <path>Add a new working directory to the current session
/agentsManage agent configurations
/chromeConfigure Claude in Chrome settings
/clearClear conversation history and free up context. Aliases: /reset, /new
/compact [instructions]Compact conversation with optional focus instructions
/configOpen the Settings interface (Config tab). Alias: /settings
/contextVisualize current context usage as a colored grid
/copyCopy the last assistant response to clipboard. When code blocks are present, shows an interactive picker to select individual blocks or the full response
/costShow token usage statistics. See cost tracking guide for subscription-specific details
/desktopContinue the current session in the Claude Code Desktop app. macOS and Windows only. Alias: /app
/diffOpen an interactive diff viewer showing uncommitted changes and per-turn diffs. Use left/right arrows to switch between the current git diff and individual Claude turns, and up/down to browse files
/doctorDiagnose and verify your Claude Code installation and settings
/exitExit the CLI. Alias: /quit
/export [filename]Export the current conversation as plain text. With a filename, writes directly to that file. Without, opens a dialog to copy to clipboard or save to a file
/extra-usageConfigure extra usage to keep working when rate limits are hit
/fast [on|off]Toggle fast mode on or off
/feedback [report]Submit feedback about Claude Code. Alias: /bug
/fork [name]Create a fork of the current conversation at this point
/helpShow help and available commands
/hooksManage hook configurations for tool events
/ideManage IDE integrations and show status
/initInitialize project with CLAUDE.md guide
/insightsGenerate a report analyzing your Claude Code sessions, including project areas, interaction patterns, and friction points
/install-github-appSet up the Claude GitHub Actions app for a repository. Walks you through selecting a repo and configuring the integration
/install-slack-appInstall the Claude Slack app. Opens a browser to complete the OAuth flow
/keybindingsOpen or create your keybindings configuration file
/loginSign in to your Anthropic account
/logoutSign out from your Anthropic account
/mcpManage MCP server connections and OAuth authentication
/memoryEdit CLAUDE.md memory files, enable or disable auto-memory, and view auto-memory entries
/mobileShow QR code to download the Claude mobile app. Aliases: /ios, /android
/model [model]Select or change the AI model. For models that support it, use left/right arrows to adjust effort level. The change takes effect immediately without waiting for the current response to finish
/output-style [style]Switch between output styles. Default is standard behavior, Explanatory adds educational insights about implementation choices and codebase patterns, and Learning pauses to ask you to write small code pieces for hands-on practice. You can also create custom output styles
/passesShare a free week of Claude Code with friends. Only visible if your account is eligible
/permissionsView or update permissions. Alias: /allowed-tools
/planEnter plan mode directly from the prompt
/pluginManage Claude Code plugins
/pr-comments [PR]Fetch and display comments from a GitHub pull request. Automatically detects the PR for the current branch, or pass a PR URL or number. Requires the gh CLI
/privacy-settingsView and update your privacy settings. Only available for Pro and Max plan subscribers
/release-notesView the full changelog, with the most recent version closest to your prompt
/remote-controlMake this session available for remote control from claude.ai. Alias: /rc
/remote-envConfigure the default remote environment for teleport sessions
/rename [name]Rename the current session. Without a name, auto-generates one from conversation history
/resume [session]Resume a conversation by ID or name, or open the session picker. Alias: /continue
/reviewReview a pull request for code quality, correctness, security, and test coverage. Pass a PR number, or omit to list open PRs. Requires the gh CLI
/rewindRewind the conversation and/or code to a previous point, or summarize from a selected message. See checkpointing. Alias: /checkpoint
/sandboxToggle sandbox mode. Available on supported platforms only
/security-reviewAnalyze pending changes on the current branch for security vulnerabilities. Reviews the git diff and identifies risks like injection, auth issues, and data exposure
/skillsList available skills
/statsVisualize daily usage, session history, streaks, and model preferences
/statusOpen the Settings interface (Status tab) showing version, model, account, and connectivity
/statuslineConfigure Claude Code’s status line. Describe what you want, or run without arguments to auto-configure from your shell prompt
/stickersOrder Claude Code stickers
/tasksList and manage background tasks
/terminal-setupConfigure terminal keybindings for Shift+Enter and other shortcuts. Only visible in terminals that need it, like VS Code, Alacritty, or Warp
/themeChange the color theme. Includes light and dark variants, colorblind-accessible (daltonized) themes, and ANSI themes that use your terminal’s color palette
/upgradeOpen the upgrade page to switch to a higher plan tier
/usageShow plan usage limits and rate limit status
/vimToggle between Vim and Normal editing modes

MCP prompts

MCP servers can expose prompts that appear as commands. These use the format /mcp__<server>__<prompt> and are dynamically discovered from connected servers. See MCP prompts for details.

Vim editor mode

Enable vim-style editing with /vim command or configure permanently via /config.

Mode switching

CommandActionFrom mode
EscEnter NORMAL modeINSERT
iInsert before cursorNORMAL
IInsert at beginning of lineNORMAL
aInsert after cursorNORMAL
AInsert at end of lineNORMAL
oOpen line belowNORMAL
OOpen line aboveNORMAL
CommandAction
h/j/k/lMove left/down/up/right
wNext word
eEnd of word
bPrevious word
0Beginning of line
$End of line
^First non-blank character
ggBeginning of input
GEnd of input
f{char}Jump to next occurrence of character
F{char}Jump to previous occurrence of character
t{char}Jump to just before next occurrence of character
T{char}Jump to just after previous occurrence of character
;Repeat last f/F/t/T motion
,Repeat last f/F/t/T motion in reverse

Editing (NORMAL mode)

CommandAction
xDelete character
ddDelete line
DDelete to end of line
dw/de/dbDelete word/to end/back
ccChange line
CChange to end of line
cw/ce/cbChange word/to end/back
yy/YYank (copy) line
yw/ye/ybYank word/to end/back
pPaste after cursor
PPaste before cursor
>>Indent line
<<Dedent line
JJoin lines
.Repeat last change

Text objects (NORMAL mode)

Text objects work with operators like d, c, and y:

CommandAction
iw/awInner/around word
iW/aWInner/around WORD (whitespace-delimited)
i"/a"Inner/around double quotes
i'/a'Inner/around single quotes
i(/a(Inner/around parentheses
i[/a[Inner/around brackets
i{/a{Inner/around braces

Command history

Claude Code maintains command history for the current session:

Reverse search with Ctrl+R

Press Ctrl+R to interactively search through your command history:

  1. Start search: press Ctrl+R to activate reverse history search
  2. Type query: enter text to search for in previous commands. The search term is highlighted in matching results
  3. Navigate matches: press Ctrl+R again to cycle through older matches
  4. Accept match:
    • Press Tab or Esc to accept the current match and continue editing
    • Press Enter to accept and execute the command immediately
  5. Cancel search:
    • Press Ctrl+C to cancel and restore your original input
    • Press Backspace on empty search to cancel

The search displays matching commands with the search term highlighted, so you can find and reuse previous inputs.

Background bash commands

Claude Code supports running bash commands in the background, allowing you to continue working while long-running processes execute.

How backgrounding works

When Claude Code runs a command in the background, it runs the command asynchronously and immediately returns a background task ID. Claude Code can respond to new prompts while the command continues executing in the background. To run commands in the background, you can either:

Key features:

To disable all background task functionality, set the CLAUDE_CODE_DISABLE_BACKGROUND_TASKS environment variable to 1. See Environment variables for details. Common backgrounded commands:

Bash mode with ! prefix

Run bash commands directly without going through Claude by prefixing your input with !:

! npm test
! git status
! ls -la

Bash mode:

This is useful for quick shell operations while maintaining conversation context.

Prompt suggestions

When you first open a session, a grayed-out example command appears in the prompt input to help you get started. Claude Code picks this from your project’s git history, so it reflects files you’ve been working on recently. After Claude responds, suggestions continue to appear based on your conversation history, such as a follow-up step from a multi-part request or a natural continuation of your workflow.

The suggestion runs as a background request that reuses the parent conversation’s prompt cache, so the additional cost is minimal. Claude Code skips suggestion generation when the cache is cold to avoid unnecessary cost. Suggestions are automatically skipped after the first turn of a conversation, in non-interactive mode, and in plan mode. To disable prompt suggestions entirely, set the environment variable or toggle the setting in /config:

export CLAUDE_CODE_ENABLE_PROMPT_SUGGESTION=false

Task list

When working on complex, multi-step work, Claude creates a task list to track progress. Tasks appear in the status area of your terminal with indicators showing what’s pending, in progress, or complete.

PR review status

When working on a branch with an open pull request, Claude Code displays a clickable PR link in the footer (for example, “PR #446”). The link has a colored underline indicating the review state:

Cmd+click (Mac) or Ctrl+click (Windows/Linux) the link to open the pull request in your browser. The status updates automatically every 60 seconds.

See also