Milan Ghimire

Developer Tools

Claude Code Commands: The Complete Slash-Command Cheat Sheet (2026)

July 10, 2026

A simple, complete guide to Claude Code commands. Learn what every slash command does, the top commands to start with, and handy CLI commands and keyboard shortcuts — with one-click copy.

  • Claude Code
  • AI Tools
  • Developer Tools
  • Productivity
  • Anthropic

Claude Code slash-command cheat sheet on a terminal

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.

CommandWhat it does
/helpShow help and every available command.
/clearStart a new conversation with empty context.
/compactSummarize the chat to free up context space.
/modelSwitch the AI model and save it as your default.
/initCreate a CLAUDE.md guide for your project.
/contextSee how much context you are using, with tips.
/reviewReview your code changes for bugs and cleanups.
/resumeResume an earlier conversation by name or ID.
/rewindUndo code and chat back to an earlier point.
/costShow 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.

CommandWhat it does
/clearStart fresh with an empty context (alias: /new, /reset).
/resumeResume a past conversation (alias: /continue).
/renameRename the current session.
/branchBranch the conversation to try a new direction.
/rewindRewind code and chat to a checkpoint (alias: /undo).
/exportExport the current conversation as plain text.
/copyCopy the last response to your clipboard.
/exitExit 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.

CommandWhat it does
/contextVisualize context usage as a colored grid.
/compactSummarize the chat to reclaim context.
/memoryEdit your CLAUDE.md memory files.
/add-dirAdd another folder for Claude to read.
/initGenerate 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.

CommandWhat it does
/configOpen settings or set a value directly (alias: /settings).
/modelSwitch the AI model and save as default.
/permissionsManage allow, ask, and deny tool rules.
/statusSee version, model, account, and connectivity.
/mcpManage MCP server connections.
/hooksView hooks that run on tool events.
/statuslineCustomize the status line at the bottom.
/vimToggle 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.

CommandWhat it does
/code-reviewReview the current diff for bugs and cleanups.
/security-reviewScan pending changes for security issues.
/simplifyClean up and simplify the code you just changed.
/doctorDiagnose and fix your Claude Code setup.
/runLaunch your app to confirm a change works.
/deep-researchSearch the web and write a cited report.
/install-github-appSet 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.

Advertisement

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.

CommandWhat it does
claudeStart an interactive Claude Code session.
claude -p "..."Run one prompt non-interactively (great for scripts).
claude updateUpdate Claude Code to the latest version.
claude doctorPrint installation diagnostics without a session.
claude mcpManage MCP servers from the terminal.
claude configView 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 /help to list every command in your version.
  • Type /powerup for 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.

Related articles