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)
| Command | What it does |
|---|---|
claude | Start 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 -c | Continue the most recent conversation |
claude -r | Resume — pick a previous session to continue |
claude --model <name> | Start using a specific Claude model |
claude mcp | Manage MCP servers (add, list, remove) |
claude update | Update Claude Code to the latest version |
Slash commands (inside a session)
| Command | What it does |
|---|---|
/help | List all available commands |
/init | Generate a starter CLAUDE.md for the project |
/clear | Clear the conversation and start a fresh task |
/compact | Summarise the session to free up context |
/model | Switch the Claude model |
/review | Review code or a pull request |
/mcp | View connected MCP servers and their tools |
/agents | Manage subagents |
/config | View and change settings |
/cost | Show token usage for the session |
/login, /logout | Switch or sign out of your account |
Keyboard shortcuts & inline tips
| Shortcut | What it does |
|---|---|
@ + filename | Reference a file or folder in your message |
# + note | Save a note to CLAUDE.md memory |
! | Run a shell command directly (bash mode) |
| Shift+Tab | Cycle modes (normal → auto-accept → plan mode) |
| Esc | Interrupt 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.