Skip to main content

Claude Code Cheat Sheet — Most-Used Commands and Practical Workflows

Toolsbase Editorial Team
(Updated: )
Claude CodeAI CodingDeveloper ProductivityCheat SheetTerminal

Claude Code has a huge number of commands and shortcuts — memorizing all of them isn't realistic. This page is not a full dictionary; it's a quick reference for the handful of things that actually make you faster. Instead of an A-to-Z list, commands are grouped by what you want to do, each with a one-line note on when and why to use it.

When you need the exhaustive list, pair this with the Claude Code command reference (246 entries) and the Claude Code feature reference. This article reflects the spec as of v2.1.212.

TL;DR Quick Reference

Start with the big picture. When in doubt, come back to this table.

You want to… Action In a nutshell
Switch topics /clear Drop the previous task's context to keep accuracy
Shrink a long chat /compact Keep the essentials, reclaim context space
Undo going too far Esc Esc / /rewind Roll conversation and code back
Plan before acting Shift+Tab for Plan mode Agree on the approach before editing
Offload heavy research /agents Let subagents do it without polluting the main context
Run a shell command ! prefix Pull the output straight into the chat
Point to a file @ prefix Reference exact paths with completion
Hand over an image Ctrl+V Paste a screenshot or design
Continue last time claude -c Resume the previous conversation instantly
Teach project conventions CLAUDE.md (/init) Stop repeating the same instructions
Change model / effort /model /effort Match cost to the difficulty of the task
Check usage & cost /usage /cost /context Know what's left and what you've spent

1. Context Management — Accuracy Is Decided Here

The quality of Claude Code's answers depends heavily on what's loaded into the conversation. Dropping or compacting unneeded context is the single biggest win.

Action What it does When to use
/clear Clear the conversation history When moving to a different task. Prevents carryover from the previous one
/compact Compress the context window Same task, but the chat got long. Keeps the gist and reclaims space
/context Visualize context usage When it "feels heavy" — check the current state
/rewind (Esc Esc) Roll conversation/code back to an earlier state When the approach was wrong or edits went off the rails. Aliases: /undo, /checkpoint
/init Initialize the project with a CLAUDE file Once per repo. Records project assumptions
/memory Edit CLAUDE files Turn "remember this next time" into a permanent rule

Tip: When a task is done, don't keep going out of inertia — /clear. Mid-way through a long task, /compact. Just choosing between these two changes both speed and accuracy.


2. Plan, Then Delegate — Avoid "Just Start Coding"

The bigger the change, the more settling the approach before editing reduces rework.

Action What it does When to use
Shift+Tab Cycle permission modes (enter Plan mode) When you want a plan only, before implementation
/plan Jump straight into Plan mode Same, made explicit via a command
/agents Manage and configure subagents Split off research/review and run in parallel without polluting the main context
/goal Set a goal condition and keep working until it's met Delegate against a condition like "until tests pass"
/loop Run a prompt repeatedly When you need to iterate the same step

Why it works: Plan mode only reads and investigates — it doesn't edit files. You move to execution after agreeing on the approach, heading off misguided large rewrites.


3. Input Tricks — Master the Prompt Box

Symbols and keys that make typing much faster once you know them.

Action What it does When to use
/ Enter a command or skill Invoke slash commands
! Bash mode (run a command directly) Run npm test etc. yourself and pull output into the chat
@ Complete and reference a file path Tell it exactly "look at this file"
Ctrl+V Paste an image from the clipboard Hand over screenshots, designs, error screens
Shift+Enter / Option+Enter / Ctrl+J Insert a newline Write multi-line prompts (the working key varies by environment)
Esc Interrupt the current action / clear input Stop a runaway. Ctrl+C also interrupts
(Up Arrow) Go back through input history Reuse the previous prompt (when the input is empty)
Ctrl+R Reverse-search command history Find a prompt you typed before
Ctrl+X Ctrl+E Edit the prompt in an external editor Write long prompts in your editor of choice

Tip: If multi-line input keeps getting sent, try Shift+Enter first; if that fails, use Option+Enter (the macOS default) or Ctrl+J.


4. Resuming & Parallel Work — Kill the Wait

Continue without throwing away the conversation, and run multiple tasks at once.

Action What it does When to use
claude -c Continue the previous conversation Resume "where we left off" instantly
claude -r / /resume Resume a session by ID or name Return to a specific past session
claude --worktree Create an isolated environment with a Git worktree Try side work without dirtying your branch
/background (/bg) Detach the session to the background Free the terminal while work continues
Ctrl+B Move a running task to the background Don't wait on long jobs — move on
claude --from-pr Resume the session tied to a GitHub PR Continue from a PR review's context

5. Review & Quality — Delegate the Finishing Touches

Hand off the "just-in-case checks" after implementation to dedicated commands.

Action What it does When to use
/review / /code-review Review changes and fix if needed Self-review before commit/PR
/security-review Analyze security vulnerabilities Changes handling external input, before going public
/simplify Cleanup-only review of your changes Tidy up leftovers (does not hunt for bugs)
/verify Build and run to confirm the change works When tests and type checks alone aren't enough
/run Launch the app to verify it actually works The "tests pass, but does it really run?" check

6. Model & Cost — Match Cost to Difficulty

Don't use a heavy model for an easy task, and don't cut corners on a hard one. Cost optimization is part of efficiency.

Action What it does When to use
/model Switch the model and effort level Pick a model to match task difficulty
/effort Set reasoning effort (low/medium/high/xhigh/max, etc.) Raise it for hard problems, lower it for simple work
/fast (Option+O) Toggle Fast mode Speed up output on the same Opus model
/cost Show token usage and cost Check this session's spend
/usage Show plan usage and limits Know what's left and pace yourself
/context Visualize context usage Decide whether to compact or /clear

7. Customization — Fit It to Your Setup

Turning repeated work into commands and automation is the biggest time saver.

Action What it does When to use
Add files under .claude/commands/ Define custom slash commands Reuse boilerplate prompts as /your-command
/hooks Configure and manage hooks Run automation before/after tool calls
/mcp Configure and manage MCP servers Connect external tools and data sources
/config (settings.json) Manage settings Permanently set permissions, model, etc. /config key=value edits directly
/agents Define subagents Reuse role-specialized agents

Tip: If you notice you're typing the same instruction every time, that's a sign to turn it into a custom command under .claude/commands/ or a rule in CLAUDE.md.


8. Keyboard Shortcut Quick Reference

Key Action
Esc Interrupt / clear input
Esc Esc Rewind conversation or code
Shift+Tab Cycle permission modes
Ctrl+C Interrupt the current action
Ctrl+D Exit the session
Ctrl+L Clear input and redraw the screen
Ctrl+R Reverse-search command history
Ctrl+O Toggle verbose output
Ctrl+T Toggle the task list
Ctrl+B Move a running task to the background
Ctrl+V Paste an image from the clipboard
Ctrl+G Open in the default editor
Ctrl+X Ctrl+E Edit the prompt in an external editor
Shift+Enter / Option+Enter / Ctrl+J Insert a newline
Option+T Toggle extended thinking
Option+O Toggle Fast mode
Option+P Switch model
Go back through input history

FAQ

When do I use /clear vs /compact?

Use /clear when moving to a different task (drop the old context entirely). Use /compact when you want to continue the same task but the chat got long (keep the gist, compress). If accuracy seems to be slipping, check /context first.

I want a plan made first

Cycle into Plan mode with Shift+Tab, or jump in with /plan. Plan mode proposes an approach without editing files, so you can agree before execution begins.

My multi-line prompt keeps getting sent early

The working newline key varies by environment. Try Shift+EnterOption+Enter (macOS default) → Ctrl+J in that order. Running /terminal-setup to fix terminal integration also helps.

Typing the same instruction every time is tedious

Put project-specific rules in CLAUDE.md (generate a template with /init, edit with /memory), and collect boilerplate prompts as custom slash commands under .claude/commands/.

How do I keep costs down?

Track spend with /usage and /cost, and match the model and reasoning effort to the task with /model and /effort. Just not using max effort for trivial work already cuts waste.

Wrapping Up

Claude Code ships new features almost weekly, but the flow stays the same: set up the context → plan → delegate → verify the result. Bookmark this cheat sheet, and as you get comfortable, expand your repertoire from the command reference to fit how you work.