1. Which Claude Code Commands Do You Use Most?
Claude Code ships more than a hundred commands. A dozen cover most days. A command only works at the start of your message, and anything after its name is passed as arguments. In the tables, [x] is optional and <x> is required.
| Command | What it does |
|---|---|
/init | Create a starter CLAUDE.md for the project |
/plan [description] | Enter plan mode: Claude researches and proposes a plan before it edits anything |
/model [model] | Switch model. With no argument it opens a picker |
/context | Show what is filling the context window |
/compact [instructions] | Summarize the conversation so far to free context. You can say what the summary should keep |
/clear [name] | Start a new conversation with empty context. Project memory stays |
/resume [session] | Reopen an earlier conversation by name or ID, or pick from a list |
/rewind | Roll the code, the conversation, or both back to an earlier point |
/diff | Review the changes in your working tree, including Claude's edits |
/code-review | Check the current diff for bugs. /review is an alias |
/permissions | Manage allow, ask and deny rules for tools |
/mcp | Manage MCP server connections and sign-ins |
2. Claude Code Slash Commands by Task
The official list is alphabetical. This one is grouped by when you reach for a command. Not every command shows for every user: some depend on your plan, platform or version.
Set up a project
| Command | What it does |
|---|---|
/init | Create a starter CLAUDE.md |
/memory | Edit CLAUDE.md files and view or switch off auto memory |
/permissions | Manage allow, ask and deny rules for tools |
/mcp | Manage MCP servers. /mcp reconnect all retries failed ones |
/add-dir <path> | Give Claude access to another directory |
/cd <path> | Move the session to another directory and keep the conversation |
/hooks | View your hook configuration |
/agents | Reminder of how to create and manage subagents |
/skills | List available skills |
/plugin | Open the plugin menu, or pass list, install, enable or disable |
/ide | Manage IDE integrations |
/terminal-setup | Install the Shift+Enter newline binding in VS Code, Cursor, Alacritty or Zed |
/statusline | Set up the status line |
/import [codex|gemini|cursor] | Bring configuration over from Codex, Gemini CLI or Cursor |
Manage context, model and cost
| Command | What it does |
|---|---|
/context | Show context usage as a grid, with suggestions |
/compact [instructions] | Summarize the conversation to free context |
/clear [name] | New conversation, empty context |
/model [model] | Switch model |
/effort [level] | Set reasoning effort: low to xhigh, max, or auto |
/fast [on|off] | Toggle fast mode |
/btw [question] | Ask a side question without adding it to the conversation |
/usage | Session cost, plan limits and activity. /cost and /stats are aliases |
/output-style [style] | List output styles or switch to one |
/clear and /compact are easy to mix up. /clear starts a new conversation. /compact keeps the same conversation and replaces its history with a summary. Use /clear when you change task and /compact when you are mid-task and running out of room.
Plan and run work
| Command | What it does |
|---|---|
/plan [description] | Plan mode: research and plan first, edit after you approve |
/goal [condition] | Keep Claude working across turns until a condition is met. /goal clear stops it |
/loop [interval] [prompt] | Repeat a prompt while the session is open, e.g. /loop 5m check if the deploy finished |
/tasks | List background work in this session, including finished subagents |
/subtask <task> | Start a background subagent that inherits the whole conversation |
/background [prompt] | Detach the session to run as a background agent. Alias: /bg |
/fork [prompt] | Copy the conversation into a new background session and keep working here |
/batch | Split a large change into independent units and run one subagent per unit |
/schedule [description] | Create or manage cloud scheduled tasks |
Review and ship
| Command | What it does |
|---|---|
/diff | Review working-tree changes |
/code-review [level] [--fix] | Check the diff, a PR number, a branch or a path for bugs. --fix applies the findings |
/security-review | Look for security problems in the changes on your branch |
/simplify [target] | Review changed code for cleanup and apply the fixes |
/verify | Build and run the app to confirm a change works |
/autofix-pr [prompt] | Start a cloud session that watches the branch's PR and pushes fixes |
/install-github-app | Install the Claude GitHub App for a repository |
Move between sessions
| Command | What it does |
|---|---|
/resume [session] | Resume by name or ID, or open the picker |
/rename [name] | Name the session so it is easy to find later |
/branch [name] | Branch the conversation here and try another direction |
/rewind | Roll back code, conversation or both. Aliases: /checkpoint, /undo |
/export [filename] | Export the conversation as plain text |
/copy [N] | Copy the last response, or the Nth-latest |
/recap | One-line summary of the session |
/teleport | Pull a cloud session into this terminal. Alias: /tp |
/remote-control | Control this session from claude.ai. Alias: /rc |
/exit | Exit. Alias: /quit |
Fix problems and change settings
| Command | What it does |
|---|---|
/doctor | Diagnose installation, settings and CLAUDE.md problems and propose fixes |
/debug [description] | Turn on debug logging and troubleshoot from the session log |
/status | Version, model, account and connectivity |
/config [key=value] | Open settings, or set one directly, e.g. /config theme=dark |
/keybindings | Open your keyboard shortcuts file |
/release-notes | Read the changelog |
/feedback [report] | Send feedback or report a bug. /bug opens the same dialog |
/help | Show help and available commands |
/login, /logout | Sign in or out of your Anthropic account |
Get the AI engineering newsletter
Practical, engineering-first breakdowns on AI agents, LLMs, and breaking into the field — plus the free roadmap PDF when you join. No spam.
By subscribing you agree to receive emails from AI Engineer Insights. Unsubscribe anytime. See our Privacy Policy.
3. Claude Code Keyboard Shortcuts
These are the defaults in the terminal. You can rebind them: /keybindings opens the file. On macOS, the Alt word-movement keys need Option set as Meta in your terminal.
General controls
| Shortcut | What it does |
|---|---|
Shift+Tab | Cycle permission modes |
Esc | Interrupt Claude mid-turn; it keeps the work done so far |
Esc Esc | With text in the prompt: clear the draft. With an empty prompt: open the rewind menu |
Ctrl+C | Interrupt. If nothing is running, first press clears the input and a second press exits |
Ctrl+D | Exit (press twice) |
Ctrl+R | Search your prompt history |
Ctrl+B | Send a running Bash command or agent to the background (twice in tmux) |
Ctrl+O | Toggle the transcript viewer, which shows tool calls in detail |
Ctrl+T | Show or hide Claude's task checklist |
Ctrl+G | Edit the prompt in your default text editor |
Ctrl+S | Stash the prompt; press again on an empty prompt to restore it |
Ctrl+L | Redraw the screen |
Ctrl+V | Paste an image from the clipboard (Cmd+V in iTerm2, Alt+V on Windows and WSL) |
Option+P / Alt+P | Switch model without clearing the prompt |
Option+O / Alt+O | Toggle fast mode |
Up / Down | Move through prompt history |
Tab | Accept an autocomplete suggestion |
? | On an empty prompt: toggle the shortcut help panel |
New line without sending
| Keys | Where it works |
|---|---|
\ then Enter | Works in every terminal |
Ctrl+J | Works in every terminal, no setup |
Shift+Enter | Native in iTerm2, WezTerm, Ghostty, Kitty, Warp and Windows Terminal 1.25+. Elsewhere run /terminal-setup |
Option+Enter | macOS, after enabling Option as Meta |
Editing the prompt
| Shortcut | What it does |
|---|---|
Ctrl+A / Ctrl+E | Start / end of line |
Alt+B / Alt+F | Back / forward one word |
Ctrl+K | Delete to end of line |
Ctrl+U | Delete from cursor to line start |
Ctrl+W | Delete back to the previous whitespace |
Ctrl+Y | Paste the text you last deleted |
Ctrl+_ | Undo the last input edit |
Prefixes
| Type | What it does |
|---|---|
/ | At the start of a message: run a command or skill |
! | At the start of a message: shell mode. Runs the command and adds its output to the session |
@ | Mention a file, with path autocomplete |
4. Claude Code CLI Commands and Flags
These run from your shell, not inside a session. claude -p (print mode) is the one to learn for scripts and CI: it takes a prompt, prints the answer and exits.
CLI commands
| Command | What it does |
|---|---|
claude | Start an interactive session |
claude "query" | Start an interactive session with a first prompt |
claude -p "query" | Print mode: answer, then exit. Use it in scripts and CI |
cat logs.txt | claude -p "explain" | Pipe content in |
claude -c | Continue the most recent conversation in this directory |
claude -r "<session>" "query" | Resume a session by ID or name |
claude update | Update to the latest version |
claude doctor | Print installation and settings diagnostics without starting a session |
claude mcp | Configure MCP servers |
claude plugin | Manage plugins |
claude agents | Open agent view to watch and dispatch background sessions |
claude auth login | Sign in. Also: auth logout, auth status |
Useful flags
| Flag | What it does |
|---|---|
--model <name> | Set the model for this session: sonnet, opus, haiku, fable, or a full model name |
--permission-mode <mode> | Start in a mode: default, acceptEdits, plan, auto, dontAsk or bypassPermissions |
--add-dir <path> | Add another working directory |
--worktree, -w <name> | Start in an isolated git worktree under .claude/worktrees/ |
--bg | Start as a background agent and return at once, e.g. claude --bg "investigate the flaky test" |
--name, -n <name> | Name the session; resume it later with claude --resume <name> |
--effort <level> | Set the effort level for this session |
--append-system-prompt <text> | Add text to the end of the default system prompt |
--allowedTools, --disallowedTools | Tools that run without a prompt, and tools that are denied |
--output-format <format> | Print mode output: text, json or stream-json |
--max-turns <n> | Limit agentic turns (print mode only) |
--mcp-config <file> | Load MCP servers from JSON files or strings |
--bare | Minimal mode: skip hooks, skills, plugins, MCP servers, auto memory and CLAUDE.md so scripted calls start faster |
--safe-mode | Start with all customizations disabled, to troubleshoot a broken setup |
--verbose | Full turn-by-turn output |
--dangerously-skip-permissions | Skip permission prompts. Same as --permission-mode bypassPermissions |
Three combinations worth saving:
# Review a diff in CI and get JSON back
git diff main | claude -p "review this diff for bugs" --output-format json
# Start in plan mode on a named session, in its own worktree
claude -w auth-refactor -n auth-refactor --permission-mode plan
# Pick up where you left off
claude -c5. Permission Modes (Shift+Tab)
Shift+Tab cycles through the permission modes. Which ones appear depends on your plan and settings. Start a session in a mode with --permission-mode.
| Mode | What Claude may do |
|---|---|
default | Shown as Manual in the mode indicator. Claude asks before it edits files or runs commands |
acceptEdits | File edits go through without a prompt |
plan | Claude researches and proposes a plan; it does not edit until you approve |
auto | Where available. A classifier decides which actions need your approval |
bypassPermissions | Where available. Skips permission prompts; only for sandboxes you can throw away |
6. How Do You Create a Custom Slash Command?
Custom commands are now skills. Make a folder, put a SKILL.md in it, and the folder name becomes the command. A project skill lives in .claude/skills/<name>/ and is shared through git; a personal one lives in ~/.claude/skills/<name>/ and works in all your projects.
# .claude/skills/fix-issue/SKILL.md -> /fix-issue 123
---
description: Fix a GitHub issue by number. Use when asked to fix an issue.
argument-hint: [issue-number]
disable-model-invocation: true
---
Read issue #$ARGUMENTS with the gh CLI, find the cause, fix it,
add a test, and summarize the change.- •
$ARGUMENTSis everything typed after the command.$0,$1pick one argument. - •
descriptiontells Claude when to use the skill on its own. - •
disable-model-invocation: truemeans only you can run it, by typing the command. - • Older
.claude/commands/*.mdfiles still work. If a skill and a command file share a name, the skill wins.
For the full walk-through, including community skills and how skills differ from MCP servers, see Claude Skills: how to add, use and create them.
7. Removed and Renamed Commands
Claude Code changes weekly, so older cheat sheets go stale fast. If a command from another list does nothing, check here first.
| Command or flag | Status |
|---|---|
/vim | Removed in v2.1.92. Use /config and change Editor mode |
/pr-comments | Removed in v2.1.91. Ask Claude to read the PR comments instead |
/ultraplan | Removed. Use plan mode |
/cost, /stats | Now aliases for /usage |
/review | Now an alias for /code-review |
/ultrareview | Still runs; the preferred form is /code-review ultra |
/agents | No longer opens a manager (v2.1.197 and earlier did). It prints a reminder; ask Claude to create subagents |
--enable-auto-mode | Removed in v2.1.111. Use --permission-mode auto |
--remote | Deprecated alias for --cloud |
.claude/commands/*.md | Still works, but custom commands are now skills |
Know the commands and want the setup around them? Read Claude Code best practices. Choosing a tool, not learning one? See Claude Code vs Cursor and the wider comparison of the best AI coding agents.
8. FAQ
How do I see all Claude Code commands?
Type / at the prompt to list every command available to you, then keep typing to filter. /help shows help and available commands, and typing ? on an empty prompt opens the keyboard shortcut panel. The list differs by plan, platform and version, so yours may not match a published one exactly.
What is the difference between /clear and /compact in Claude Code?
/clear starts a new conversation with empty context and keeps project memory such as CLAUDE.md. /compact stays in the same conversation and replaces its history with a summary to free space. Use /clear when you switch tasks and /compact when you are in the middle of one.
How do I undo a change in Claude Code?
Run /rewind, or press Esc twice on an empty prompt. Both open the rewind menu, where you can restore the code, the conversation, or both to an earlier point. /checkpoint and /undo are aliases for /rewind.
What is the shortcut for plan mode in Claude Code?
Press Shift+Tab to cycle permission modes until the indicator shows plan mode, or type /plan, optionally followed by the task. To start a session in plan mode, run claude --permission-mode plan.
How do I create a custom slash command in Claude Code?
Create a folder at .claude/skills/your-command/ with a SKILL.md file inside. The folder name becomes the command, so the skill in .claude/skills/deploy/ runs as /deploy. Use $ARGUMENTS in the file for whatever you type after the command. Older .claude/commands/ files still work.
Is there a Claude Code cheat sheet PDF?
Yes. The one-page printable PDF of this cheat sheet is free with the newsletter sign-up on this page. It has the same commands, shortcuts and CLI flags, laid out for A4.
9. Sources
- • Claude Code docs — Commands
- • Claude Code docs — Interactive mode (keyboard shortcuts)
- • Claude Code docs — CLI reference
- • Claude Code docs — Skills (custom commands)
- • Claude Code docs — Permission modes
Checked against Anthropic's Claude Code docs on November 18, 2026. Descriptions are shortened in our own words. Claude Code ships updates weekly, so run /help or /release-notes if something here does not match your version.