Claude Code + Prompt Cheat Sheet
150+ commands, 44 prompt prefixes, keyboard shortcuts, CLI flags, and environment variables
📁 Project Setup & Memory
/init | Generate CLAUDE.md with project info |
/memory | Open CLAUDE.md for in-session editing |
/add-dir | Add additional working directories |
# text | Append one-liner to CLAUDE.md |
🔄 Context & Session Lifecycle
/compact | Summarize history to free context window |
/clear | Wipe conversation for clean task switch |
/context | Show context window usage as percentage |
/resume | Load and continue a previous session |
/rewind | Rewind conversation or code changes |
/fork | Create a branch for risk-free exploration |
/rename | Set a session name for easy lookup |
/color | Set prompt bar color for parallel sessions |
🔍 Code Review & Quality
/diff | Shows git diff of all session changes |
/simplify | Check quality, security, test coverage |
/review | Review a specific PR (needs gh CLI) |
/security-review | Security audit on uncommitted changes |
/pr-comments | Show PR comments for current branch |
/debug | Systematic debugging workflows |
▶️ CLI Flags (Terminal Launch)
claude | Start interactive session |
claude "prompt" | Start with an initial prompt |
--print / -p | Execute query, print result, exit |
-c / --continue | Continue most recent session |
--resume | Resume specific session by name/ID |
--from-pr | Resume session linked to a PR |
--append-system-prompt | Layer custom instructions (safe) |
--system-prompt | Fully override default instructions |
--dangerously-skip-permissions | Skip permission checks (containers only) |
--agents | Define sub-agents via JSON |
--output-format json | JSON output for scripting/CI |
--effort | Set thinking depth (low/medium/high/max) |
--worktree | Run in isolated git worktree |
--remote-control | Allow control via claude.ai |
--debug | Enable debug logging |
--version | Print Claude Code version |
📊 Monitoring & Reporting
/cost | Token consumption and cost for session |
/export | Export conversation as searchable docs |
/usage | Usage report: sessions, tokens, top commands |
/stats | Daily usage, streaks, model preferences |
/help | List all available commands |
⚙️ System, Config & Diagnostics
/config | Interactive settings interface |
/permissions | Configure operation approvals |
/hooks | Manage hook configurations |
/ide | Manage VS Code / JetBrains connections |
/plugin | Install and manage third-party plugins |
/doctor | Diagnose installation issues |
/feedback | Send bug report to Anthropic |
/keybindings | Open keybindings config |
/terminal-setup | Install keybindings for WSL/Windows |
/desktop | Manage desktop app integration |
/upgrade | Manage subscription (Pro/Max) |
/privacy-settings | Manage data and privacy |
🧠 Model & Thinking Controls
/model | Swap between Sonnet, Opus, Haiku |
/effort | Set effort: low, medium, high, max |
/fast | Toggle speed-optimized API settings |
/plan | Propose changes as a plan (read-only) |
/output-style | Set response style (Concise, etc.) |
➡️ Inline Prefixes
@path | Autocomplete and inject file context |
!command | Run bash command, output feeds in |
#text | Append a note to CLAUDE.md |
/btw | Side question without polluting context |
⌨️ Keyboard Shortcuts
Shift+Tab | Cycle: Normal > Auto-Accept > Plan |
Esc Esc | Selective undo for conversation/code |
Ctrl+C | Cancel current response |
Ctrl+R | Search through command history |
Ctrl+T | Show/hide persistent task list |
Ctrl+G | Open prompt in system editor |
Ctrl+B | Send current query to background |
Tab | Show/hide thinking process |
Alt+T / Option+T | Toggle extended thinking mode |
Alt+P / Option+P | Quick model switch |
Alt+M | Same as Shift+Tab |
Alt+B / Alt+F | Back/forward in conversation |
Shift+Enter | New line without sending |
Ctrl+L | Cosmetic clear (keeps history) |
Ctrl+D | Close Claude Code |
🤖 Multi-Agent & Automation
/agents | Create and manage specialized agents |
/batch | Repetitive changes across multiple files |
/loop | Schedule a task on a time interval |
/bashes | List and manage background processes |
/voice | Push-to-talk voice input |
/vim | Toggle vim editing mode |
/remote-control | Control session from claude.ai |
Everything above is free. The Prompt Prefix Codex below requires access.View plans