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 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 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 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.
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.
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. 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.tsputs the file into the conversation.@src/lists the folder.! npm testruns the command, adds the command and its output to the context, and Claude responds to it. Shell mode runs outside the sandbox, andTabcompletes 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 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.
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.
| 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:
---
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
- Plan first on anything non-trivial.
Shift+Tabinto plan mode, or/plan add rate limiting. Read the plan before any file changes. - Clear between tasks.
/clearwhen you switch topics. Old context costs tokens and confuses the model. - Compact with instructions.
/compact keep the schema decisions and the failing test nameskeeps what matters. - Turn repeated prompts into skills. If you paste the same paragraph twice a week, it should be
/something. - Rewind instead of arguing.
EscEscor/rewindis 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 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 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 lists the Claude Code skills in
.claude/skillsand~/.claude/skills, lets you turn one off without deleting it, and installs gallery skills after a security scan. - Checkpoints per turn. Checkpoints 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 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.