# Claude Code commands cheat sheet: flags, slash, keys

URL: https://agentvera.dev/en/blog/claude-code-commands-cheat-sheet/ · Published: 2026-10-23

Every Claude Code command worth knowing on one page: CLI flags, slash commands, keyboard shortcuts, @ mentions, ! shell mode, memory files and custom skills.

**In short:**

- /clear starts a new conversation with empty context, while /compact replaces the history with a summary and accepts instructions on what to keep.
- Custom slash commands are now skills: a folder with a SKILL.md in .claude/skills/ or ~/.claude/skills/, and the folder name becomes the command.
- Sessions are stored per folder, so claude -c only finds your last conversation when you run it from the same project directory.

The Claude Code commands you will use most are `claude` to start a session, `claude -p "..."` for a one-shot answer, `claude -c` to continue, `/clear` and `/compact` to manage context, `/model` to switch models, `Shift+Tab` to change permission mode and `Esc` to stop Claude mid-turn. On top of that, `@` mentions a file, `!` runs a shell command, and your own skills become `/name` commands. The tables below group everything by job, and every entry was checked against the official Claude Code docs.

Keep this page open in a second tab. If you are new to the tool, start with [how to use Claude Code](/en/blog/how-to-use-claude-code/ "How to use Claude Code") and come back here when you want the shortcuts.

## Start and resume sessions

These run in your shell, before Claude Code starts.

| Command | What it does |
| --- | --- |
| `claude` | Start an interactive session in the current folder |
| `claude "explain this repo"` | Start a session with a first prompt |
| `claude -p "query"` | Print mode: answer once and exit, good for scripts |
| `cat log.txt \| claude -p "why does this fail?"` | Pipe content into a one-shot query |
| `claude -c` | Continue the most recent conversation in this folder |
| `claude -c -p "query"` | Continue it non-interactively |
| `claude -r "<session>" "query"` | Resume a session by ID or name |
| `claude update` | Update to the latest version |
| `claude doctor` | Check your install and settings for problems |
| `claude mcp` | Configure MCP servers |
| `claude auth login` / `claude auth logout` | Sign in or out (`claude auth status` shows the current account) |

Sessions are stored per folder. `claude -c` in a different directory will not find the conversation you had in your project.

## CLI flags worth memorizing

The [CLI reference](https://code.claude.com/docs/en/cli-reference "Claude Code CLI reference") lists dozens of flags, and notes that `claude --help` does not show all of them. These are the ones people reach for.

### Session and output

| Flag | What it does |
| --- | --- |
| `--print`, `-p` | Non-interactive mode |
| `--continue`, `-c` | Load the latest conversation in this folder |
| `--resume`, `-r` | Resume a specific session, or pick one |
| `--fork-session` | When resuming, start a new session ID instead of reusing the old one |
| `--name`, `-n` | Give the session a display name |
| `--output-format` | `text`, `json` or `stream-json` in print mode |
| `--max-turns` | Limit the number of agent turns in print mode |
| `--max-budget-usd` | Stop a print-mode run after a dollar amount |
| `--verbose` | Show full turn-by-turn output |
| `--version`, `-v` | Print the version |

### Model and effort

| Flag | What it does |
| --- | --- |
| `--model sonnet` | Pick a model by alias (`sonnet`, `opus`, `haiku`) or full name |
| `--fallback-model` | Model to fall back to when the main one is overloaded (print mode) |
| `--effort` | Set the effort level, such as `low`, `medium`, `high` or `max` |

### Permissions and tools

| Flag | What it does |
| --- | --- |
| `--permission-mode plan` | Start in a mode: `default`, `acceptEdits`, `plan`, `auto`, `dontAsk`, `bypassPermissions` |
| `--allowedTools "Bash(npm test)"` | Let these tools run without a prompt |
| `--disallowedTools "Bash(git push *)"` | Remove these tools from the model's reach |
| `--dangerously-skip-permissions` | Same as `bypassPermissions`. Only in isolated environments |
| `--add-dir ../shared` | Give Claude access to another folder |

The last one is a blunt instrument. Our post on [skipping permissions safely](/en/blog/claude-code-skip-permissions/ "Claude Code skip permissions, done safely") covers the safer alternatives.

### Configuration and context

| Flag | What it does |
| --- | --- |
| `--append-system-prompt "..."` | Add text to the default system prompt |
| `--system-prompt "..."` | Replace the system prompt entirely |
| `--mcp-config ./mcp.json` | Load MCP servers from a file |
| `--settings ./settings.json` | Load extra settings from a file or JSON string |
| `--agents '{...}'` | Define subagents inline as JSON |
| `--worktree`, `-w` | Start in an isolated git worktree |
| `--ide` | Connect to your IDE on startup if exactly one is available |
| `--debug` | Turn on debug output |

## Built-in slash commands

Type `/` at the start of a message to open the menu. A command is only recognized at the very start of the message. Some entries are skills that ship with Claude Code, but you call them the same way. The full list lives in the [commands reference](https://code.claude.com/docs/en/commands "Claude Code commands").

### Context and conversation

| Command | What it does |
| --- | --- |
| `/clear` | Start a new conversation with empty context |
| `/compact [instructions]` | Summarize the conversation to free context |
| `/context` | Show what is filling the context window |
| `/resume` | Pick a past session to resume |
| `/rename` | Rename the current session |
| `/branch [name]` | Branch the conversation from here |
| `/rewind` | Go back to an earlier point in code, conversation or both (also `/checkpoint`, `/undo`) |
| `/btw [question]` | Ask a side question without adding it to the main thread |
| `/export [filename]` | Export the conversation as plain text |
| `/copy` | Copy Claude's last response |

### Model, cost and limits

| Command | What it does |
| --- | --- |
| `/model [model]` | Switch model |
| `/effort` | Change effort level |
| `/fast` | Toggle fast mode |
| `/usage` | Show usage and plan limits (`/cost` and `/stats` are aliases) |
| `/status` | Version, model, account and connection status |

If your limits run out too quickly, see [why Claude Code uses so many tokens](/en/blog/claude-code-token-usage/ "Claude Code token usage").

### Project setup

| Command | What it does |
| --- | --- |
| `/init` | Generate a starter `CLAUDE.md` for the project |
| `/memory` | Open and edit your memory files |
| `/add-dir <path>` | Add a working directory |
| `/config` | Open settings (theme, editor mode, and more) |
| `/permissions` | View and edit allow, ask and deny rules |
| `/hooks` | Manage hooks |
| `/mcp` | Manage MCP servers and their sign-ins |
| `/plugin` | Browse and install plugins |
| `/skills` | List available skills |
| `/statusline` | Set up the status line |
| `/terminal-setup` | Install the Shift+Enter key binding in terminals that need it |
| `/keybindings` | Open your key bindings file |

### Code review and planning

| Command | What it does |
| --- | --- |
| `/plan [description]` | Switch to plan mode, optionally with a task |
| `/diff` | Review the changes in your working tree, including Claude's edits |
| `/code-review` | Review the current changes (`/review` is an alias) |
| `/security-review` | Check the changes on your branch for security issues |
| `/simplify` | Clean up recently changed code |

### Help and housekeeping

| Command | What it does |
| --- | --- |
| `/help` | Show help |
| `/doctor` | Diagnose the install |
| `/ide` | Manage IDE integrations and show status |
| `/tasks` | List background tasks |
| `/login` / `/logout` | Switch or sign out of accounts |
| `/release-notes` | See what changed |
| `/feedback` | Send feedback (also `/bug`) |
| `/exit` | Quit (also `/quit`) |

`/vim` was removed. Vim keys now live under `/config` → Editor mode.

## Keyboard shortcuts

From the [interactive mode docs](https://code.claude.com/docs/en/interactive-mode "Claude Code interactive mode"). On macOS, the `Option` shortcuts need your terminal to send Option as Meta.

### Control the session

| Shortcut | What it does |
| --- | --- |
| `Esc` | Stop Claude mid-turn |
| `Esc` `Esc` | Clear the draft, or open rewind when the input is empty |
| `Ctrl+C` | Interrupt or clear input |
| `Ctrl+D` | Exit the session (press twice) |
| `Shift+Tab` | Cycle permission modes (normal, auto-accept edits, plan, and so on) |
| `Option+P` / `Alt+P` | Switch model |
| `Option+T` / `Alt+T` | Toggle extended thinking |
| `Ctrl+O` | Open the transcript viewer |
| `Ctrl+B` | Move a running command or agent to the background |
| `Ctrl+T` | Show the task checklist |
| `Ctrl+L` | Redraw the screen |

### Write prompts

| Shortcut | What it does |
| --- | --- |
| `Ctrl+R` | Search prompt history |
| `Ctrl+G` | Open the prompt in your external editor |
| `Ctrl+V` | Paste an image (`Alt+V` on Windows) |
| `Ctrl+S` | Stash the prompt; press again on an empty prompt to restore it |
| `\` then `Enter` | New line (works everywhere) |
| `Shift+Enter` | New line in iTerm2, WezTerm, Ghostty, Kitty, Warp, Apple Terminal and Windows Terminal |
| `Ctrl+J` | New line |
| `Ctrl+A` / `Ctrl+E` | Jump to start / end of line |
| `Ctrl+U` / `Ctrl+K` | Delete to start / end of line |
| `Ctrl+W` | Delete the previous word |

If `Shift+Enter` sends your prompt instead of adding a line, run `/terminal-setup`.

## Input prefixes: @, ! and ?

| Prefix | Where | What it does |
| --- | --- | --- |
| `/` | Start of message | Run a command or skill |
| `!` | Start of message | Shell mode: run the command directly |
| `@` | Anywhere | Mention a file or folder path, with autocomplete |
| `?` | Empty input | Show the shortcut help |

A few details that save time:

- `@src/auth.ts` puts the file into the conversation. `@src/` lists the folder.
- `! npm test` runs the command, adds the command and its output to the context, and Claude responds to it. Shell mode runs outside the sandbox, and `Tab` completes from your earlier `!` commands.
- If you remember a `#` shortcut for adding memories, it is not in the current docs. Use `/memory`, or simply tell Claude to remember something.

## Memory files

| File | Scope |
| --- | --- |
| `~/.claude/CLAUDE.md` | You, in every project |
| `./CLAUDE.md` | The project, shared through git |
| `./CLAUDE.local.md` | You, in this project only (keep it out of git) |

Inside a memory file, `@path/to/file` imports another file. Imports can nest up to four levels. The [memory docs](https://code.claude.com/docs/en/memory "Claude Code memory") recommend keeping each file under about 200 lines. Recent versions also read `AGENTS.md`. For what to put in these files, see [CLAUDE.md and AGENTS.md](/en/blog/claude-md-agents-md/ "CLAUDE.md and AGENTS.md").

## Custom slash commands with skills

Custom commands are now skills. Each skill is a folder with a `SKILL.md`, and the folder name becomes the command. Read more in the [skills docs](https://code.claude.com/docs/en/skills "Claude Code skills").

| Location | Command | Who gets it |
| --- | --- | --- |
| `~/.claude/skills/review-pr/SKILL.md` | `/review-pr` | You, everywhere |
| `.claude/skills/deploy/SKILL.md` | `/deploy` | Everyone on the repo |
| `.claude/commands/deploy.md` | `/deploy` | Older format, still works |
| A plugin's skill | `/plugin-name:skill-name` | Whoever installed the plugin |

A minimal skill that takes an argument:

```markdown
---
name: fix-issue
description: Fix a GitHub issue
disable-model-invocation: true
---

Fix GitHub issue $ARGUMENTS following our coding standards.
Read the issue, write a failing test, fix it, run the tests.
```

Now `/fix-issue 482` passes `482` as `$ARGUMENTS`. Use `$0`, `$1` (or `$ARGUMENTS[0]`) for positional arguments. `disable-model-invocation: true` means only you can call it. Without it, Claude can also decide to use the skill when the description fits. Other useful frontmatter fields are `argument-hint`, `allowed-tools` and `model`.

## Five habits that use these commands well

1. **Plan first on anything non-trivial.** `Shift+Tab` into plan mode, or `/plan add rate limiting`. Read the plan before any file changes.
2. **Clear between tasks.** `/clear` when you switch topics. Old context costs tokens and confuses the model.
3. **Compact with instructions.** `/compact keep the schema decisions and the failing test names` keeps what matters.
4. **Turn repeated prompts into skills.** If you paste the same paragraph twice a week, it should be `/something`.
5. **Rewind instead of arguing.** `Esc` `Esc` or `/rewind` is faster than asking Claude to undo its own mistake.

## When one terminal is not enough

These commands work on one session at a time. Once you run three or four Claude Code agents on different tasks, the hard part is keeping track of which one is waiting for you. [AgentVera](/en/agents/claude-code/ "Claude Code in AgentVera") is a desktop app that runs each agent in its own pane in a per-project grid. Claude Code still runs as the real CLI, so every flag, slash command and skill on this page works the same way.

A few things it adds around those commands:

- **A workspace with its own shortcuts.** The [workspace](/en/features/workspace/ "Workspace") has a ⌘K command palette that searches actions, agents and projects, ⌘1–9 to jump between panes, and shortcuts you can remap.
- **Skills in one list.** The [skill gallery](/en/features/skill-gallery/ "Skill gallery") lists the Claude Code skills in `.claude/skills` and `~/.claude/skills`, lets you turn one off without deleting it, and installs gallery skills after a security scan.
- **Checkpoints per turn.** [Checkpoints](/en/features/checkpoints-and-replay/ "Checkpoints and replay") snapshot the folder at the start of every turn, in addition to Claude Code's own `/rewind`.
- **Send output to an agent.** [Send to agent](/en/features/send-to-agent/ "Send to agent") passes a terminal selection, a diff or a log to the agent you pick with ⌘⇧L.

It does not replace learning the commands above. It helps when there are many sessions to drive.

To try AgentVera, start at the [home page](/en/ "AgentVera").

## Frequently asked questions

**How do I see all Claude Code commands?** Type / in an interactive session to open the command menu, which lists built-in commands and your skills. Run /help for help, press ? on an empty prompt for the shortcut list, and run claude --help in a shell for the main CLI flags.

**What is the difference between /clear and /compact?** /clear starts a fresh conversation with an empty context. /compact keeps the conversation but replaces the history with a summary, and you can pass instructions such as /compact keep the API decisions to steer what the summary keeps.

**How do I create a custom slash command in Claude Code?** Create a skill: a folder with a SKILL.md file in .claude/skills/ for the project or ~/.claude/skills/ for yourself. The folder name becomes the command, so .claude/skills/deploy/SKILL.md gives you /deploy. Old .claude/commands/*.md files still work.

**Does the # shortcut still add memories in Claude Code?** The current interactive mode docs list only /, ! and @ as input prefixes, plus ? for help. To edit memory, run /memory to open your CLAUDE.md files, or ask Claude to remember something and it writes it down.

**How do I resume a previous Claude Code session?** Run claude -c to continue the most recent conversation in the current folder, or claude -r to pick one from a list. Inside a session, /resume opens the same picker. Sessions are per folder, so run the command from the project you worked in.

---

**About AgentVera.** AgentVera is a desktop app for macOS, Windows and Linux, built by Solviera Teknoloji. It runs 18 AI coding agents (Claude Code, Codex, Gemini CLI, Copilot, Cursor, Antigravity, opencode, Hermes, Qwen Code, Kimi Code, Kiro, Amp, Droid, Goose, Vibe, Crush, Aider, Cline) side by side, per project, in real terminals with the user's own CLI installs and logins. The free plan has unlimited agents. Download: https://agentvera.dev/en/download/ · Pricing: https://agentvera.dev/en/pricing/
