Claude Code + Prompt Cheat Sheet

150+ commands, 44 prompt prefixes, keyboard shortcuts, CLI flags, and environment variables

Claude Code44 Prompt PrefixesExpanded Codex

📁 Project Setup & Memory

/initGenerate CLAUDE.md with project info
/memoryOpen CLAUDE.md for in-session editing
/add-dirAdd additional working directories
# textAppend one-liner to CLAUDE.md

🔄 Context & Session Lifecycle

/compactSummarize history to free context window
/clearWipe conversation for clean task switch
/contextShow context window usage as percentage
/resumeLoad and continue a previous session
/rewindRewind conversation or code changes
/forkCreate a branch for risk-free exploration
/renameSet a session name for easy lookup
/colorSet prompt bar color for parallel sessions

🔍 Code Review & Quality

/diffShows git diff of all session changes
/simplifyCheck quality, security, test coverage
/reviewReview a specific PR (needs gh CLI)
/security-reviewSecurity audit on uncommitted changes
/pr-commentsShow PR comments for current branch
/debugSystematic debugging workflows

▶️ CLI Flags (Terminal Launch)

claudeStart interactive session
claude "prompt"Start with an initial prompt
--print / -pExecute query, print result, exit
-c / --continueContinue most recent session
--resumeResume specific session by name/ID
--from-prResume session linked to a PR
--append-system-promptLayer custom instructions (safe)
--system-promptFully override default instructions
--dangerously-skip-permissionsSkip permission checks (containers only)
--agentsDefine sub-agents via JSON
--output-format jsonJSON output for scripting/CI
--effortSet thinking depth (low/medium/high/max)
--worktreeRun in isolated git worktree
--remote-controlAllow control via claude.ai
--debugEnable debug logging
--versionPrint Claude Code version

📊 Monitoring & Reporting

/costToken consumption and cost for session
/exportExport conversation as searchable docs
/usageUsage report: sessions, tokens, top commands
/statsDaily usage, streaks, model preferences
/helpList all available commands

⚙️ System, Config & Diagnostics

/configInteractive settings interface
/permissionsConfigure operation approvals
/hooksManage hook configurations
/ideManage VS Code / JetBrains connections
/pluginInstall and manage third-party plugins
/doctorDiagnose installation issues
/feedbackSend bug report to Anthropic
/keybindingsOpen keybindings config
/terminal-setupInstall keybindings for WSL/Windows
/desktopManage desktop app integration
/upgradeManage subscription (Pro/Max)
/privacy-settingsManage data and privacy

🧠 Model & Thinking Controls

/modelSwap between Sonnet, Opus, Haiku
/effortSet effort: low, medium, high, max
/fastToggle speed-optimized API settings
/planPropose changes as a plan (read-only)
/output-styleSet response style (Concise, etc.)

➡️ Inline Prefixes

@pathAutocomplete and inject file context
!commandRun bash command, output feeds in
#textAppend a note to CLAUDE.md
/btwSide question without polluting context

⌨️ Keyboard Shortcuts

Shift+TabCycle: Normal > Auto-Accept > Plan
Esc EscSelective undo for conversation/code
Ctrl+CCancel current response
Ctrl+RSearch through command history
Ctrl+TShow/hide persistent task list
Ctrl+GOpen prompt in system editor
Ctrl+BSend current query to background
TabShow/hide thinking process
Alt+T / Option+TToggle extended thinking mode
Alt+P / Option+PQuick model switch
Alt+MSame as Shift+Tab
Alt+B / Alt+FBack/forward in conversation
Shift+EnterNew line without sending
Ctrl+LCosmetic clear (keeps history)
Ctrl+DClose Claude Code

🤖 Multi-Agent & Automation

/agentsCreate and manage specialized agents
/batchRepetitive changes across multiple files
/loopSchedule a task on a time interval
/bashesList and manage background processes
/voicePush-to-talk voice input
/vimToggle vim editing mode
/remote-controlControl session from claude.ai
Everything above is free. The Prompt Prefix Codex below requires access.View plans