Guides

Claude Code Commands Cheat Sheet

A quick reference for the Claude Code commands you’ll use most — CLI commands to start and resume sessions, in-session slash commands, context controls, and keyboard shortcuts. New to the tool? Start with getting started. Inside any session, /help always lists the full, current command set.

CLI commands (in your terminal)

CommandWhat it does
claudeStart an interactive session in the current project
claude "fix the failing test"Start with an initial task
claude -p "..."Print mode — run a prompt non-interactively (great for scripts/CI)
claude -cContinue the most recent conversation
claude -rResume — pick a previous session to continue
claude --model <name>Start using a specific Claude model
claude mcpManage MCP servers (add, list, remove)
claude updateUpdate Claude Code to the latest version

Slash commands (inside a session)

CommandWhat it does
/helpList all available commands
/initGenerate a starter CLAUDE.md for the project
/clearClear the conversation and start a fresh task
/compactSummarise the session to free up context
/modelSwitch the Claude model
/reviewReview code or a pull request
/mcpView connected MCP servers and their tools
/agentsManage subagents
/configView and change settings
/costShow token usage for the session
/login, /logoutSwitch or sign out of your account

Keyboard shortcuts & inline tips

ShortcutWhat it does
@ + filenameReference a file or folder in your message
# + noteSave a note to CLAUDE.md memory
!Run a shell command directly (bash mode)
Shift+TabCycle modes (normal → auto-accept → plan mode)
EscInterrupt Claude mid-task; double-tap to edit a previous message
Browse previous prompts

Get more from these commands

Pair this reference with Claude Code best practices for workflows that use them well, and keep an eye on usage limits/compact and /clear are your friends for long sessions.

Frequently Asked Questions

How do I see all Claude Code commands?

Type /help inside any Claude Code session to list the full, current set of slash commands. The cheat sheet above covers the ones you’ll use most often.

What is the difference between /clear and /compact?

/clear wipes the conversation to start a brand-new task, while /compact summarises the current session to free up context but keeps the important details so you can continue.

How do I reference a file in Claude Code?

Type @ followed by the path or filename in your message, and Claude Code will include that file or folder as context.

How do I run a shell command in Claude Code?

Start your input with ! to run a shell command directly (bash mode), or simply ask Claude Code to run it for you and approve when prompted.

Explore the Claude Code guide