Keyboard Shortcuts & Commands Cheat Sheet
Every slash command, keyboard shortcut, and hidden trick in Claude Code. The stuff power users know and everyone else doesn't.
You're Using 10% of Claude Code
Most people type prompts and hit Enter. That's it. They don't know about slash commands. They don't know you can switch models mid-conversation. They don't know Escape cancels a running operation without killing the session.
Here's everything in one place.
Slash Commands
These work by typing them directly into the Claude Code prompt.
Session Management
| Command | What it does |
|---|---|
/help | Show all available commands |
/clear | Clear conversation history and start fresh |
/compact | Compress context to free up token space |
/cost | Show current session token usage and cost |
/quit or /exit | End the session |
Configuration
| Command | What it does |
|---|---|
/model | Switch the active model (opus, sonnet, haiku) |
/permissions | View and manage tool permissions |
/init | Generate a CLAUDE.md file for your project |
Workflow
| Command | What it does |
|---|---|
/review | Review recent changes for issues |
/pr-comments | Show unresolved PR comments |
Keyboard Shortcuts
These work while you're in the Claude Code terminal interface.
The Essentials
| Shortcut | What it does |
|---|---|
| Enter | Send your message |
| Escape | Cancel current operation (safe — doesn't lose context) |
| Ctrl+C | Hard cancel / exit if pressed twice |
| Ctrl+L | Clear the screen (keeps conversation) |
| Up arrow | Cycle through previous prompts |
The Power Moves
| Shortcut | What it does |
|---|---|
| Shift+Tab | Toggle plan mode on/off |
| Option+T (Mac) / Alt+T | Toggle extended thinking |
| Tab | Accept autocomplete suggestion |
| Ctrl+R | Search through prompt history |
The Commands People Sleep On
/compact is a lifesaver. Long session getting slow? Context window filling up? /compact compresses your conversation while keeping the important context. Use it before Claude Code starts forgetting things, not after.
/model for cost control. Start complex tasks with Opus or Sonnet, then switch to Haiku for simple follow-ups. "Fix the typo I just introduced" doesn't need the most expensive model.
/cost for awareness. Check it every 30 minutes during long sessions. If you're burning through tokens faster than expected, it's usually because the context window is bloated — time for /compact.
Escape is not Ctrl+C. Escape gracefully stops the current operation. Claude Code keeps your conversation and any partial work. Ctrl+C is the hard kill — use it only when things are truly stuck.
CLI Flags Worth Knowing
These go on the claude command itself, before you enter the interactive session:
claude -p "prompt" # Non-interactive pipe mode (for CI/scripts)
claude --model haiku # Start with a specific model
claude --resume # Resume your last conversation
claude --continue # Continue the most recent session
claude --verbose # Show tool calls and internal reasoningThe --resume flag is underrated. Closed your terminal by accident? claude --resume picks up exactly where you left off. No lost context.
Quick Reference Card
Session: /help /clear /compact /cost /quit
Config: /init /model /permissions
Keys: Escape (cancel) Shift+Tab (plan) Option+T (think)
Up (history) Ctrl+R (search) Tab (complete)
CLI: -p (pipe) --resume --continue --verbosePrint this. Tape it to your monitor. You'll use it more than you think.
Stay in the loop
New guides, templates, and tips. No spam. Unsubscribe anytime.
How to Prompt Claude Code (It's Not What You Think)
The biggest mistake? Treating Claude Code like ChatGPT. Good prompts are specific, bounded, and lean on CLAUDE.md — not clever wording.
Cost Optimization
Is Claude Code worth $200/month? Here's the real math, when to upgrade, and how to stop wasting tokens without even knowing it.