claudecodeguide.dev

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.

Commands you probably don't know about

Slash Commands

These work by typing them directly into the Claude Code prompt.

Session Management

CommandWhat it does
/helpShow all available commands
/clearClear conversation history and start fresh
/compactCompress context to free up token space
/costShow current session token usage and cost
/quit or /exitEnd the session

Configuration

CommandWhat it does
/modelSwitch the active model (opus, sonnet, haiku)
/permissionsView and manage tool permissions
/initGenerate a CLAUDE.md file for your project

Workflow

CommandWhat it does
/reviewReview recent changes for issues
/pr-commentsShow unresolved PR comments

Keyboard Shortcuts

These work while you're in the Claude Code terminal interface.

The Essentials

ShortcutWhat it does
EnterSend your message
EscapeCancel current operation (safe — doesn't lose context)
Ctrl+CHard cancel / exit if pressed twice
Ctrl+LClear the screen (keeps conversation)
Up arrowCycle through previous prompts

The Power Moves

ShortcutWhat it does
Shift+TabToggle plan mode on/off
Option+T (Mac) / Alt+TToggle extended thinking
TabAccept autocomplete suggestion
Ctrl+RSearch through prompt history
Keyboard shortcuts in practice

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 reasoning

The --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  --verbose

Print 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.

On this page