Claude Code CLI commands. The flags worth knowing and the keyboard shortcuts
A cheat sheet of Claude Code commands for the terminal. claude, -p, -c, -r, --model, --permission-mode, claude update and claude doctor, plus the interactive keyboard shortcuts.
Part of the guideClaude Code, the complete guide. From installation to your own skills and plugins
In this article
In short
Day to day, Claude Code needs about a dozen commands and flags and a handful of keyboard shortcuts. We put them in tables with examples and explain which ones actually save time.
The Claude Code documentation has one sentence that says a lot. claude --help does not list every flag, so a flag missing from the help does not mean it is unavailable. The full list runs to dozens of entries, mostly for scripts and administrators. This cheat sheet covers the Claude Code CLI commands you use every day. Everything was checked against the CLI reference and the interactive mode docs as of 10 November 2026.
Commands you type inside a session after a slash are covered separately in Claude Code slash commands. The whole series lives in the Claude Code guide.
Claude Code commands in the terminal
You type these in a normal terminal, before a session starts.
| Command | What it does |
|---|---|
claude | Starts a session in the current folder |
claude "explain this project" | Starts a session with a first prompt |
claude -p "explain this function" | Answers once and exits |
claude -c | Continues the most recent conversation in this folder |
claude -r "name" | Resumes a session by name or ID, without one it opens a picker |
claude update | Installs the newest version right away |
claude install stable | Installs the stable channel or a given version number |
claude doctor | Checks the install and settings without starting a session |
claude auth login | Logs in, with --console for a Console account |
claude auth status | Shows login status |
claude mcp | Configures MCP servers |
claude plugin | Manages plugins |
You can also pipe a file into -p mode, for example cat logs.txt | claude -p "what is wrong here". claude -c skips sessions started with claude -p, so a scripted run will not jump in front of your last normal conversation. If you mistype a subcommand, such as claude udpate, Claude Code suggests the right one and does not start a session. MCP servers get their own article, Claude Code and MCP.
Flags worth knowing
Flags go after claude and only apply to that one session.
| Flag | What it does | Example |
|---|---|---|
--model | Picks a model by alias or full name | claude --model opus |
--permission-mode | Sets the starting permission mode | claude --permission-mode plan |
--effort | Sets how hard the model thinks | claude --effort high |
-n, --name | Names the session | claude -n "csv-export" |
--add-dir | Gives access to another folder | claude --add-dir ../api |
-w, --worktree | Starts in a separate git worktree | claude -w login-fix |
--allowedTools | Tools that run without asking | "Bash(git diff *)" "Read" |
--disallowedTools | Tools that are blocked | "Bash(rm *)" |
--output-format | Output format in -p mode | --output-format json |
--max-turns | Step limit in -p mode | claude -p --max-turns 3 "…" |
--verbose | Shows the full turn by turn output | claude --verbose |
-v, --version | Prints the version | claude -v |
--permission-mode accepts default, acceptEdits, plan, auto, dontAsk and bypassPermissions, and you can type manual instead of default. --dangerously-skip-permissions is the same as bypassPermissions. Anthropic says plainly to use it only in a container or virtual machine. The rules themselves are in Claude Code permissions.
A session name from -n is more useful than it looks. The next day you type claude -r csv-export and you are back in that conversation instead of hunting through a list. -p mode with --output-format and --max-turns is the basis for scripts and CI, covered in Claude Code headless and CI.
Keyboard shortcuts in a session
These are the shortcuts you reach for most inside a session.
| Shortcut | What it does |
|---|---|
Esc | Stops Claude mid-turn, the work so far stays |
Esc Esc | Clears your draft, on an empty prompt opens rewind |
Shift+Tab | Cycles permission modes |
Ctrl+C | Interrupts, a second press on an empty prompt exits |
Ctrl+D twice | Exits the session |
Ctrl+O | Shows tool call details |
Ctrl+R | Searches command history |
Ctrl+G | Opens your prompt in a text editor |
Ctrl+B | Sends a running command to the background |
Ctrl+T | Shows Claude's task list |
Ctrl+L | Redraws the screen when it gets garbled |
Ctrl+V, on Windows Alt+V | Pastes an image from the clipboard |
Option+P or Alt+P | Switches model without clearing the prompt |
For a new line in your prompt, \ followed by Enter works in any terminal, and so does Ctrl+J. Shift+Enter works out of the box in iTerm2, WezTerm, Ghostty, Kitty, Warp, Apple Terminal and Windows Terminal. On a Mac, shortcuts with Option need Option set as the Meta key, which /terminal-setup does for you.
Four characters at the start of the prompt change what your input means. / opens the list of commands and skills. ! runs a shell command without going through Claude, and the output lands in the conversation, for example ! npm test. @ autocompletes file paths. ? on an empty prompt shows the shortcut help.
The commands that actually save time
In our daily work in Claude Code, three things pay off most. First, named sessions and claude -r, because getting back into a thread after a break takes seconds. Second, Esc instead of waiting. When you see Claude heading the wrong way, you stop it and redirect, and the work so far stays. Third, ! for short commands. Test output lands in the conversation and Claude comments on it straight away.
If you are just starting, read about first run and login first.
To begin with, remember claude -c, claude -r, Esc and Shift+Tab, and come back to these tables for the rest when you need it. If you are wondering where AI could help your business beyond programming, our free AI audit is a good place to start.
What would you like to change in your business?
Leave your number. We will talk about your process and see whether we can help. The first call is free.
The service this text is about
Automation and AI / OCRAutomation of document re-typing, OCR and checking rules, and your data stays with you.