Claude Code commands cheat sheet: flags, slash, keys

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

Solviera Teknoloji 12 min read

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.

CommandWhat it does
claudeStart 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 -cContinue 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 updateUpdate to the latest version
claude doctorCheck your install and settings for problems
claude mcpConfigure MCP servers
claude auth login / claude auth logoutSign 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

FlagWhat it does
--print, -pNon-interactive mode
--continue, -cLoad the latest conversation in this folder
--resume, -rResume a specific session, or pick one
--fork-sessionWhen resuming, start a new session ID instead of reusing the old one
--name, -nGive the session a display name
--output-formattext, json or stream-json in print mode
--max-turnsLimit the number of agent turns in print mode
--max-budget-usdStop a print-mode run after a dollar amount
--verboseShow full turn-by-turn output
--version, -vPrint the version

Model and effort

FlagWhat it does
--model sonnetPick a model by alias (sonnet, opus, haiku) or full name
--fallback-modelModel to fall back to when the main one is overloaded (print mode)
--effortSet the effort level, such as low, medium, high or max

Permissions and tools

FlagWhat it does
--permission-mode planStart 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-permissionsSame as bypassPermissions. Only in isolated environments
--add-dir ../sharedGive 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

FlagWhat it does
--append-system-prompt "..."Add text to the default system prompt
--system-prompt "..."Replace the system prompt entirely
--mcp-config ./mcp.jsonLoad MCP servers from a file
--settings ./settings.jsonLoad extra settings from a file or JSON string
--agents '{...}'Define subagents inline as JSON
--worktree, -wStart in an isolated git worktree
--ideConnect to your IDE on startup if exactly one is available
--debugTurn 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

CommandWhat it does
/clearStart a new conversation with empty context
/compact [instructions]Summarize the conversation to free context
/contextShow what is filling the context window
/resumePick a past session to resume
/renameRename the current session
/branch [name]Branch the conversation from here
/rewindGo 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
/copyCopy Claude’s last response

Model, cost and limits

CommandWhat it does
/model [model]Switch model
/effortChange effort level
/fastToggle fast mode
/usageShow usage and plan limits (/cost and /stats are aliases)
/statusVersion, model, account and connection status

If your limits run out too quickly, see why Claude Code uses so many tokens.

Project setup

CommandWhat it does
/initGenerate a starter CLAUDE.md for the project
/memoryOpen and edit your memory files
/add-dir <path>Add a working directory
/configOpen settings (theme, editor mode, and more)
/permissionsView and edit allow, ask and deny rules
/hooksManage hooks
/mcpManage MCP servers and their sign-ins
/pluginBrowse and install plugins
/skillsList available skills
/statuslineSet up the status line
/terminal-setupInstall the Shift+Enter key binding in terminals that need it
/keybindingsOpen your key bindings file

Code review and planning

CommandWhat it does
/plan [description]Switch to plan mode, optionally with a task
/diffReview the changes in your working tree, including Claude’s edits
/code-reviewReview the current changes (/review is an alias)
/security-reviewCheck the changes on your branch for security issues
/simplifyClean up recently changed code

Help and housekeeping

CommandWhat it does
/helpShow help
/doctorDiagnose the install
/ideManage IDE integrations and show status
/tasksList background tasks
/login / /logoutSwitch or sign out of accounts
/release-notesSee what changed
/feedbackSend feedback (also /bug)
/exitQuit (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

ShortcutWhat it does
EscStop Claude mid-turn
Esc EscClear the draft, or open rewind when the input is empty
Ctrl+CInterrupt or clear input
Ctrl+DExit the session (press twice)
Shift+TabCycle permission modes (normal, auto-accept edits, plan, and so on)
Option+P / Alt+PSwitch model
Option+T / Alt+TToggle extended thinking
Ctrl+OOpen the transcript viewer
Ctrl+BMove a running command or agent to the background
Ctrl+TShow the task checklist
Ctrl+LRedraw the screen

Write prompts

ShortcutWhat it does
Ctrl+RSearch prompt history
Ctrl+GOpen the prompt in your external editor
Ctrl+VPaste an image (Alt+V on Windows)
Ctrl+SStash the prompt; press again on an empty prompt to restore it
\ then EnterNew line (works everywhere)
Shift+EnterNew line in iTerm2, WezTerm, Ghostty, Kitty, Warp, Apple Terminal and Windows Terminal
Ctrl+JNew line
Ctrl+A / Ctrl+EJump to start / end of line
Ctrl+U / Ctrl+KDelete to start / end of line
Ctrl+WDelete the previous word

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

Input prefixes: @, ! and ?

PrefixWhereWhat it does
/Start of messageRun a command or skill
!Start of messageShell mode: run the command directly
@AnywhereMention a file or folder path, with autocomplete
?Empty inputShow 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

FileScope
~/.claude/CLAUDE.mdYou, in every project
./CLAUDE.mdThe project, shared through git
./CLAUDE.local.mdYou, 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.

LocationCommandWho gets it
~/.claude/skills/review-pr/SKILL.md/review-prYou, everywhere
.claude/skills/deploy/SKILL.md/deployEveryone on the repo
.claude/commands/deploy.md/deployOlder format, still works
A plugin’s skill/plugin-name:skill-nameWhoever 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

  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 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/skills and ~/.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.

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.

Bring your agents to one desk.

Download AgentVera for free; your installed CLIs are ready to go.

More posts