Session
/clear/reset | Wipe conversation, free context |
/compact | Compress context with focus instructions |
/resume/continue | Resume session by ID or name |
/branch/fork | Fork conversation |
/rewind | Undo to previous checkpoint |
/btw | Side question, no context pollution |
Tools & Config
/plan | Read-only exploration mode |
/diff | Interactive diff viewer |
/init | Initialize project with CLAUDE.md |
/config/settings | Open settings |
/memory | Edit CLAUDE.md, toggle auto memory |
/mcp | Manage MCP servers |
/permissions | View/update tool permissions |
/security-review | Scan changes for vulnerabilities |
Model & Output
/model | Switch model (sonnet, opus) |
/fast | Toggle fast mode |
/effort | Reasoning level (low to max) |
/context | Visualize context window |
/cost | Token usage and cost stats |
/copy | Copy last N responses to clipboard |
/export | Export conversation as text |
/doctor | Diagnose installation |
Control
Ctrl+C | Cancel current generation |
Ctrl+D | Exit Claude Code |
Ctrl+L | Clear terminal screen |
Ctrl+O | Toggle verbose transcript |
Ctrl+T | Toggle task list |
Ctrl+B | Background running task |
Ctrl+G | Open in external editor |
Mode & Model
Shift+Tab | Cycle permission modes |
Esc Esc | Rewind to checkpoint |
Option+P | Switch model |
Option+T | Toggle extended thinking |
Option+O | Toggle fast mode |
Hold Space | Push-to-talk voice input |
Multiline Input
\ + Enter | All terminals |
Option+Enter | macOS default |
Shift+Enter | iTerm2, WezTerm, Ghostty, Kitty |
Ctrl+J | Line feed character |
Asks for everything except reads
Auto-approves file edits, asks for commands
Read-only. No edits, no commands
AI classifier approves safe actions
Only pre-approved tools. For CI/CD
Approves everything. Isolated VMs only
Switch: Shift+Tab or --permission-mode
Session
-c | Resume most recent conversation |
-r ID | Resume session by ID or name |
-p | Print mode (non-interactive) |
-w NAME | Start in isolated git worktree |
-n NAME | Set display name for session |
--remote | Create web session on claude.ai |
--teleport | Resume web session locally |
Model & Limits
--model | Set model (sonnet, opus) |
--effort | Reasoning level (low to max) |
--max-turns N | Limit agentic turns |
--max-budget-usd N | Maximum spend limit |
--fallback-model | Fallback when overloaded |
Prompt & Output
--system-prompt | Replace system prompt |
--append-system-prompt | Add to system prompt |
--output-format | text, json, stream-json |
--json-schema | Validated JSON output |
Tools & Config
--tools LIST | Restrict available tools |
--allowedTools | Auto-approve specific tools |
--mcp-config PATH | Load MCP servers from file |
--agent NAME | Use custom agent definition |
--add-dir PATH | Add working directories |
--bare | Minimal mode, skip discovery |
--debug FILTER | Debug logging |
Settings
.claude/settings.local.json | Local only (gitignored) |
.claude/settings.json | Project (shared via git) |
~/.claude/settings.json | User (all projects) |
Instructions
CLAUDE.md | Project instructions (root or .claude/) |
~/.claude/CLAUDE.md | Personal instructions (global) |
.claude/rules/*.md | Topic rules with path: filters |
MCP & Keys
.claude/mcp.json | Project MCP servers (shared) |
.claude/mcp.local.json | Local MCP servers (gitignored) |
~/.claude/mcp.json | User MCP servers (global) |
~/.claude/keybindings.json | Custom keyboard bindings |
Tip: keep CLAUDE.md under 200 lines for best adherence
Events (can block marked with B)
PreToolUseB | Before tool runs |
PostToolUse | After tool succeeds |
UserPromptSubmitB | User sends message |
Notification | Claude needs attention |
StopB | Claude finishes response |
SessionStart | Session begins |
SubagentStart/Stop | Subagent lifecycle |
PreCompact/PostCompact | Context compaction |
Exit Codes
Hook Types
claude mcp add NAME URL | Add HTTP or SSE server |
--transport stdio NAME CMD | Add local stdio server |
--mcp-config ./mcp.json | Load from JSON config |
--strict-mcp-config | Only flag servers, ignore saved |
/mcp | Manage connections interactively |
Scopes
Permission pattern: mcp__SERVER__TOOL
VS Code
Cmd+Esc | Focus Claude Code input |
Cmd+N | New conversation |
Cmd+Shift+Esc | New tab |
Option+K | Insert @-mention for file |
JetBrains
Cmd+Esc | Open Claude Code panel |
Cmd+Option+K | Insert file reference |
Browser & Web
@browser | Reference Chrome browser |
claude --chrome | Enable Chrome integration |
claude --remote | Create web session |
claude --teleport | Resume web session locally |
/ | Open slash command menu |
! command | Run shell directly (bash mode) |
@ file | Reference file with autocomplete |
claude auth login | Sign in to account |
claude auth status | Auth status as JSON |
claude update | Update to latest version |
claude agents | List configured subagents |
CLAUDE_CODE_SIMPLE | Enable bare mode |
CLAUDE_CODE_DISABLE_AUTO_MEMORY | Disable auto memory |
CLAUDE_CODE_TASK_LIST_ID | Named task list |
CLAUDE_CODE_DISABLE_BACKGROUND_TASKS | Disable backgrounding |
CLAUDE_ENV_FILE | Path to env file (hooks) |
CLAUDE_PROJECT_DIR | Project root (in hooks) |
This Claude Code cheat sheet is a single-screen reference covering every command, shortcut, and configuration option for Anthropic's agentic coding CLI. Whether you are new to Claude Code or looking to master advanced features like hooks and MCP servers, everything is here in one view.
Our Claude Code reference covers slash commands (session management, tools, model switching), keyboard shortcuts (control, mode cycling, multiline input), all CLI flags (session, model, prompt, output, tools), six permission modes with safety ratings, the hooks system with all events and exit codes, MCP server configuration across four scopes, IDE integration for VS Code and JetBrains, environment variables, and pro tips from experienced users.
Unlike scattered documentation, this Claude Code cheatsheet is designed to fit your entire screen in one view. Every command, every shortcut, every flag visible at a glance for quick reference during your workflow.
A Claude Code cheat sheet is a quick-reference guide that lists every slash command, keyboard shortcut, CLI flag, permission mode, hook event, MCP configuration option, and IDE integration for Claude Code. This cheat sheet covers all 80+ commands and settings in one searchable view so you can find what you need at a glance.
Claude Code is Anthropic's official agentic coding tool that runs directly in your terminal. It can read, edit, and create files, run shell commands, search entire codebases, manage git workflows, and connect to external services through MCP servers. It works as a standalone CLI, VS Code extension, JetBrains plugin, desktop app, and web app.
There are 6 modes: 'default' asks for everything except reads, 'acceptEdits' auto-approves file edits, 'plan' is read-only exploration, 'auto' uses an AI classifier for safe actions, 'dontAsk' only runs pre-approved tools for CI/CD, and 'bypassPermissions' approves everything (only for isolated VMs). Switch with Shift+Tab or the --permission-mode flag.
CLAUDE.md is a markdown file in your project root (or ~/.claude/) that gives Claude Code persistent instructions about your project. Include coding standards, architecture notes, and workflow preferences. Keep it under 200 lines for best results. You can also use .claude/rules/*.md for topic-specific rules with path filters.
Hooks are automated actions (shell commands, HTTP requests, or agent prompts) that run in response to events like tool use, session start, or notifications. Common uses include auto-formatting after edits with Prettier, blocking dangerous operations, and sending notifications when Claude needs attention. Configure them in settings.json.
MCP (Model Context Protocol) lets Claude Code connect to external tools and services like databases, APIs, GitHub, Notion, and more. You can add servers with 'claude mcp add' or configure them in .claude/mcp.json. MCP servers can be scoped to user level (global), project level (shared via git), or local (gitignored).
Use '/context' to visualize your context window as a colored grid, '/compact' to compress it with optional focus instructions, and '/clear' to start fresh. Reference files with @ mentions instead of pasting content. Use .claude/rules/ to split instructions by topic. Set PostCompact hooks to re-inject critical context after compaction.
Practice coding interviews with an AI interviewer that gives real-time feedback on your code, complexity analysis, and approach.
Try Crackr freearrow_forwardEssential terminal commands for developers
Time & space complexity reference
Scalability, caching, databases, and more
12 models benchmarked on real tasks
The original 75 LeetCode problems
See DSA in action