Claude Code is Anthropic's AI coding tool that runs right in your terminal. You talk to it in plain English, and it reads your files, writes code, runs commands, and helps you ship faster. The fastest way to control it is with slash commands — short keywords you type after a / to do a specific job instantly.
This post is a simple, complete cheat sheet. You will learn the top commands to start with, what every command does, and the CLI commands and keyboard shortcuts that save the most time. Every command has a Copy button, so you can grab it in one click.
What is a slash command?
A slash command is a shortcut you type in the Claude Code prompt. Just type / and a menu appears with every command. Keep typing to filter the list, then press Enter to run it.
For example, type /help to see all commands, or /clear to start a clean conversation. You do not need to remember them all — the / menu shows them as you type.
Top 10 Claude Code commands to start with
If you are new, learn these first. They cover almost everything you do day to day.
| Command | What it does | |
|---|---|---|
/help | Show help and every available command. | |
/clear | Start a new conversation with empty context. | |
/compact | Summarize the chat to free up context space. | |
/model | Switch the AI model and save it as your default. | |
/init | Create a CLAUDE.md guide for your project. | |
/context | See how much context you are using, with tips. | |
/review | Review your code changes for bugs and cleanups. | |
/resume | Resume an earlier conversation by name or ID. | |
/rewind | Undo code and chat back to an earlier point. | |
/cost | Show your current API usage and cost. |
These ten alone will make you fast. /clear and /compact keep your session light, /model picks the right brain for the job, and /review checks your work before you commit.
Session commands
These commands manage your conversations — starting fresh, going back, or saving your work.
| Command | What it does | |
|---|---|---|
/clear | Start fresh with an empty context (alias: /new, /reset). | |
/resume | Resume a past conversation (alias: /continue). | |
/rename | Rename the current session. | |
/branch | Branch the conversation to try a new direction. | |
/rewind | Rewind code and chat to a checkpoint (alias: /undo). | |
/export | Export the current conversation as plain text. | |
/copy | Copy the last response to your clipboard. | |
/exit | Exit the CLI (alias: /quit). |
A tip: use /rewind when Claude takes a wrong turn. It rolls both the code and the chat back to an earlier point, like an undo button for your whole session.
Context commands
"Context" is everything Claude reads at the start of each turn. Less clutter means faster, sharper answers. These commands help you manage it.
| Command | What it does | |
|---|---|---|
/context | Visualize context usage as a colored grid. | |
/compact | Summarize the chat to reclaim context. | |
/memory | Edit your CLAUDE.md memory files. | |
/add-dir | Add another folder for Claude to read. | |
/init | Generate a CLAUDE.md project guide. |
Run /context to see a colored grid of what is using space, then /compact to clean it up when it gets full.
Settings and configuration commands
Use these to set up Claude Code the way you like — model, permissions, and connected tools.
| Command | What it does | |
|---|---|---|
/config | Open settings or set a value directly (alias: /settings). | |
/model | Switch the AI model and save as default. | |
/permissions | Manage allow, ask, and deny tool rules. | |
/status | See version, model, account, and connectivity. | |
/mcp | Manage MCP server connections. | |
/hooks | View hooks that run on tool events. | |
/statusline | Customize the status line at the bottom. | |
/vim | Toggle Vim keybindings in the prompt. |
/permissions is worth learning early. It lets you pre-approve safe commands so Claude stops asking you every time.
Built-in skills (power commands)
Skills are task-specific commands that do bigger jobs. These ship with Claude Code and are ready to use.
| Command | What it does | |
|---|---|---|
/code-review | Review the current diff for bugs and cleanups. | |
/security-review | Scan pending changes for security issues. | |
/simplify | Clean up and simplify the code you just changed. | |
/doctor | Diagnose and fix your Claude Code setup. | |
/run | Launch your app to confirm a change works. | |
/deep-research | Search the web and write a cited report. | |
/install-github-app | Set up Claude in your GitHub repo. |
/code-review and /security-review are great habits before every commit, and /doctor fixes most setup problems on its own.
CLI commands (from your terminal)
You can also run Claude Code straight from the terminal without opening a session. These are perfect for scripts and quick checks.
| Command | What it does | |
|---|---|---|
claude | Start an interactive Claude Code session. | |
claude -p "..." | Run one prompt non-interactively (great for scripts). | |
claude update | Update Claude Code to the latest version. | |
claude doctor | Print installation diagnostics without a session. | |
claude mcp | Manage MCP servers from the terminal. | |
claude config | View or change configuration. |
The claude -p "your prompt" form is a favorite for automation — it runs one prompt, prints the answer, and exits, so you can pipe it into other tools.
Handy keyboard shortcuts
| Shortcut | What it does |
| --- | --- |
| Esc | Stop Claude or close a menu |
| Esc Esc | Edit your previous message |
| Ctrl + C | Cancel the current response |
| Ctrl + L | Clear the screen |
| ↑ / ↓ | Browse your message history |
| Shift + Tab | Switch permission mode (plan, auto, and more) |
How to get more help
The best source is the official Anthropic documentation, and Claude Code can guide you from inside the terminal too:
- Type
/helpto list every command in your version. - Type
/powerupfor short, interactive lessons on hidden features. - Read the official docs at code.claude.com/docs for the newest details.
Because Claude Code updates often, always trust /help in your own terminal for the exact commands you have.
Frequently asked questions
How do I see all Claude Code commands?
Type / in the prompt to open the command menu, or type /help for the full list with descriptions.
How do I clear the conversation in Claude Code?
Use /clear to start a new conversation with empty context. Use /compact if you want to keep the chat but shrink it.
How do I change the AI model?
Type /model and pick the model you want. Claude Code saves it as your default for next time.
How do I update Claude Code?
Run claude update in your terminal to get the latest version.
Are slash commands and CLI commands the same?
No. Slash commands (like /help) run inside a Claude Code session. CLI commands (like claude update) run in your normal terminal.
Final thoughts
Slash commands are what make Claude Code feel fast. Start with the top ten, keep your context clean with /clear and /compact, and lean on skills like /code-review to raise your code quality. Once these become muscle memory, you will move through work much faster.
If you enjoyed this, you might also like my hands-on projects and my step-by-step learning notes on machine learning and Python. Have a favorite command I missed? Get in touch — I would love to hear it.