Reference

Cheat Sheet

Commands, shortcuts, CLI flags & configuration — all in one place.

Keyboard Shortcuts
General Controls
Ctrl+CCancel input or generation
Ctrl+DExit session
Ctrl+FKill all background agents (2x)
Ctrl+GOpen in text editor
Ctrl+LClear terminal screen
Ctrl+OToggle verbose output
Ctrl+RReverse search history
Ctrl+BBackground running tasks
Ctrl+TToggle task list
Esc EscRewind / summarize
Shift+TabCycle permission modes
Model & Thinking
Option+PSwitch model
Option+TToggle extended thinking
Option+MCycle permission modes (alt)
Multiline Input
\ + EnterQuick escape newline
Option+EnterNew line (macOS default)
Shift+EnterNew line (iTerm2/WezTerm/Ghostty/Kitty)
Ctrl+JNew line (control sequence)
Text Editing
Ctrl+KDelete to end of line
Ctrl+UDelete entire line
Ctrl+YPaste deleted text
Option+BMove cursor back one word
Option+FMove cursor forward one word
Clipboard & Images
Cmd+VPaste image from clipboard
Quick Prefixes
/Slash command or skill
!Run bash command directly
@File path mention (autocomplete)
Slash Commands
Session
/clearClear conversation (alias: /reset, /new)
/compactCompact conversation with optional focus
/resumeResume past session (alias: /continue)
/branchFork conversation (alias: /fork)
/renameRename current session
/rewindRewind to checkpoint (alias: /checkpoint)
/exportExport conversation as text
/exitExit CLI (alias: /quit)
Model & Config
/modelSelect or change AI model
/fastToggle fast mode
/effortSet effort level (low/med/high/max)
/configOpen settings (alias: /settings)
/permissionsView / update permissions
/themeChange color theme
/vimToggle Vim editing mode
/voiceToggle push-to-talk dictation
/colorSet prompt bar color
Information
/helpShow help
/costShow token usage & cost
/usageShow plan usage & rate limits
/statusVersion, model, account info
/contextVisualize context usage
/statsDaily usage, streaks, model prefs
/diffOpen interactive diff viewer
/copyCopy last response to clipboard
/release-notesView full changelog
Project & Tools
/initInitialize project with CLAUDE.md
/add-dirAdd working directory to session
/memoryEdit CLAUDE.md & auto-memory
/mcpManage MCP server connections
/hooksView hook configurations
/skillsList available skills
/tasksList & manage background tasks
/planEnter plan mode
/sandboxToggle sandbox mode
/scheduleCreate / manage scheduled tasks
Account & Setup
/loginSign in to Anthropic
/logoutSign out
/doctorDiagnose installation
/feedbackSubmit feedback (alias: /bug)
/upgradeSwitch plan tier
/terminal-setupConfigure terminal keybindings
/ideManage IDE integrations
/pluginManage plugins
/keybindingsOpen keybindings config file
Collaboration
/btwQuick side question
/pr-commentsFetch GitHub PR comments
/security-reviewAnalyze pending changes
/remote-controlRemote control from claude.ai
/desktopContinue in Desktop app
/install-github-appSet up GitHub Actions app
/install-slack-appInstall Slack app
CLI Flags
Session & Startup
-c, --continueLoad most recent conversation
-r, --resume IDResume specific session
--fork-sessionNew session ID when resuming
-n, --nameSet session display name
-p, --printOne-shot print mode (non-interactive)
--bareMinimal mode, skip auto-discovery
-w, --worktreeStart in isolated git worktree
--tmuxCreate tmux session for worktree
--from-pr 123Resume sessions linked to PR
--session-id UUIDUse specific session ID
Model & Effort
--model MODELSet model (or use sonnet/opus)
--effort LEVELlow / medium / high / max
--fallback-modelEnable fallback when overloaded
Permissions
--permission-modedefault / acceptEdits / plan / auto / bypassPermissions
--allowedToolsTools allowed without prompt
--disallowedToolsRemove tools from context
--dangerously-skip-permissionsSkip all prompts (caution!)
System Prompt
--system-promptReplace default system prompt
--append-system-promptAppend to default prompt
Output & Limits
--output-formattext / json / stream-json
--input-formattext / stream-json (with --print)
--json-schemaGet validated JSON output
--max-budget-usd NMax dollar amount (with --print)
--toolsRestrict available built-in tools
-v, --versionPrint version
MCP & Plugins
--mcp-config FILELoad MCP servers from JSON
--strict-mcp-configOnly use specified MCP config
--chrome / --no-chromeEnable / disable Chrome integration
--plugin-dir DIRLoad plugins from directory
--agent NAMESpecify agent for session
--agents JSONDefine custom subagents via JSON
--add-dir PATHAdd working directories
--settings FILELoad additional settings
-d, --debugEnable debug mode (optional filter)
--verboseEnable verbose logging
Auth Commands
claude auth loginSign in
claude auth logoutSign out
claude auth statusShow auth status
claude updateUpdate to latest version
claude mcpConfigure MCP servers
Permission Modes
Cycle with Shift+Tab
defaultRead files only, ask for everything else
acceptEditsRead + edit files without asking
planRead only, no edits allowed
autoAll actions (with background safety checks)
bypassPermissionsAll actions, no checks (VMs only!)
dontAskOnly pre-approved tools
Memory & Files
CLAUDE.md Locations
~/.claude/CLAUDE.mdGlobal instructions (all projects)
.claude/CLAUDE.mdProject-specific instructions
.claude/rules/Path-specific rules
Settings Locations
~/.claude/settings.jsonUser settings (all projects)
.claude/settings.jsonProject settings (committed)
.claude/settings.local.jsonProject settings (local only)
Auto Memory
~/.claude/projects/<path>/memory/Auto-memory files per project
MEMORY.mdMemory index file (auto-loaded)
Other Files
~/.claude/keybindings.jsonKeybinding overrides
~/.claude/mcp.jsonMCP server config (global)
.claude/mcp.jsonMCP server config (project)
~/.claude/hooks/Global hook scripts
Hook Events
Session Lifecycle
SessionStartSession begins or resumes
SessionEndSession terminates
StopClaude finishes responding
StopFailureTurn ends due to API error
User Input
UserPromptSubmitUser submits a prompt
NotificationClaude needs attention
Tool Execution
PreToolUseBefore tool call (can block)
PostToolUseAfter tool call succeeds
PostToolUseFailureAfter tool call fails
PermissionRequestPermission dialog appears
Agents & Tasks
SubagentStartSubagent spawned
SubagentStopSubagent finished
TeammateIdleTeam member goes idle
TaskCompletedTask marked completed
Context & Config
PreCompactBefore context compaction
PostCompactAfter context compaction
InstructionsLoadedCLAUDE.md / rules loaded
ConfigChangeConfig file changes
Worktree & MCP
WorktreeCreateWorktree created
WorktreeRemoveWorktree removed
ElicitationMCP requests user input
ElicitationResultUser responds to MCP input
Hook Types
commandShell command
httpPOST to URL
promptLLM prompt
agentSubagent invocation
Environment Variables
Authentication & API
ANTHROPIC_API_KEYAPI key (overrides subscription)
ANTHROPIC_BASE_URLOverride API endpoint
ANTHROPIC_MODELModel setting
Cloud Providers
CLAUDE_CODE_USE_BEDROCKUse AWS Bedrock
CLAUDE_CODE_USE_VERTEXUse Google Vertex AI
CLAUDE_CODE_USE_FOUNDRYUse Microsoft Foundry
Model Behavior
CLAUDE_CODE_EFFORT_LEVELEffort: low / medium / high / max
MAX_THINKING_TOKENSExtended thinking token budget
CLAUDE_CODE_MAX_OUTPUT_TOKENSMax output tokens
CLAUDE_CODE_AUTO_COMPACT_WINDOWAuto-compaction threshold
Feature Toggles
CLAUDE_CODE_DISABLE_AUTO_MEMORYDisable auto memory
CLAUDE_CODE_DISABLE_FAST_MODEDisable fast mode
CLAUDE_CODE_DISABLE_1M_CONTEXTDisable 1M context
CLAUDE_CODE_DISABLE_BACKGROUND_TASKSDisable background tasks
CLAUDE_CODE_DISABLE_CRONDisable scheduled tasks
Bash & Commands
BASH_DEFAULT_TIMEOUT_MSDefault command timeout
BASH_MAX_TIMEOUT_MSMax command timeout
BASH_MAX_OUTPUT_LENGTHMax output chars before truncation
CLAUDE_CODE_SHELLOverride shell detection
MCP
MCP_TIMEOUTMCP server startup timeout (ms)
MCP_TOOL_TIMEOUTMCP tool execution timeout
MAX_MCP_OUTPUT_TOKENSMax tokens in MCP responses
Network
HTTP_PROXYHTTP proxy server
HTTPS_PROXYHTTPS proxy server
CLAUDE_CONFIG_DIRCustom config directory
Telemetry (Disable)
DISABLE_TELEMETRYOpt out of telemetry
DISABLE_ERROR_REPORTINGOpt out of Sentry
DISABLE_AUTOUPDATERDisable auto updates
Terminal Shortcuts
macOS Terminal / iTerm2
⌘TNew tab
⌘NNew window
⌘WClose tab / pane
⌘DSplit pane vertically (iTerm2)
⌘⇧DSplit pane horizontally (iTerm2)
⌘[ / ⌘]Switch panes (iTerm2)
⌘KClear terminal buffer
⌘⇧Left/RightSwitch tabs
⌘FFind in terminal
⌘+ / ⌘-Zoom in / out
⌘,Open preferences
Shared (Bash / Zsh)
Ctrl+AMove cursor to start of line
Ctrl+EMove cursor to end of line
Ctrl+WDelete word before cursor
Ctrl+ZSuspend process (fg to resume)
TabAutocomplete path / command
Tab TabShow all completions
!!Repeat last command
!$Last argument of previous command
Keybinding Contexts
~/.claude/keybindings.json
GlobalApplies everywhere
ChatMain chat input area
AutocompleteAutocomplete menu open
SettingsSettings menu
ConfirmationPermission / confirmation dialogs
TabsTab navigation
HelpHelp menu visible
TranscriptTranscript viewer
HistorySearchHistory search mode (Ctrl+R)
TaskBackground task running
DiffDialogDiff viewer
ModelPickerModel picker
PluginPlugin dialog
SelectGeneric select / list
AttachmentsImage / attachment bar