Skip to content New: the Claude Skills catalog — what each skill does and how to install it →
CS-02 · Cheat sheet · rev. 10/2026

Claude Code commands cheat sheet

The Claude Code commands, shortcuts and config files you use every day, copied from Anthropic's documentation as of October 2026. Command names are exact; type / in a session to see what your version offers.

FormatPrintable reference
ForClaude Code CLI
Sourcecode.claude.com docs
CheckedOct 2026

Claude Code is Anthropic's coding agent for the terminal. It ships new commands often, so this sheet of Claude Code commands, flags and shortcuts sticks to what Anthropic's documentation lists as of October 2026 and quotes names exactly. Anthropic notes that not every command appears for every user: availability depends on platform, plan and environment. Type / in a session to see your own list.

Start, resume and script

CommandWhat it does
claudeStart an interactive session
claude "query"Start a session with a first prompt
claude -p "query"Answer once, print, exit (print mode)
cat file | claude -p "query"Process piped content
claude -cContinue the most recent conversation in this directory
claude -r "<session>" "query"Resume a session by ID or name
claude updateUpdate to the latest version
claude doctorInstallation and settings diagnostics without starting a session
claude mcpConfigure MCP servers

Flags worth knowing

FlagEffect
--modelModel for this session, by alias (sonnet, opus, haiku, fable) or full name
--permission-modeStart in default, acceptEdits, plan, auto, dontAsk or bypassPermissions
--effortEffort level: low, medium, high, xhigh, max or ultracode, depending on the model
--add-dirGive Claude access to another working directory
--allowedToolsTools that run without a permission prompt
--append-system-promptAdd text to the end of the default system prompt
--system-promptReplace the whole system prompt
--output-formatPrint-mode output: text, json or stream-json
--max-turnsCap agentic turns in print mode
--dangerously-skip-permissionsSame as --permission-mode bypassPermissions. Anthropic's docs reserve it for isolated containers and VMs

Slash commands

A command is recognized only at the start of a message; text after it becomes its arguments. <arg> is required, [arg] optional.

CommandWhat it does
/initGenerate a starter CLAUDE.md for the project
/memoryEdit CLAUDE.md files and manage auto memory
/clear [name]New conversation with empty context
/compact [instructions]Summarize the conversation to free context
/contextShow context usage as a grid
/model [model]Switch model and save it as default
/effortSet the effort level
/plan [description]Enter plan mode
/permissionsManage allow, ask and deny rules
/hooksView hook configurations
/mcpManage MCP connections and OAuth
/skillsList available skills
/agentsPrint a reminder on how to create and manage subagents
/resume [session]Resume a conversation or open the picker
/rewindRoll code and conversation back to a checkpoint (aliases /checkpoint, /undo)
/diffReview changes in the working tree
/code-reviewReview the current diff for bugs (alias /review)
/security-reviewCheck branch changes for vulnerabilities
/btw [question]Side question that stays out of the conversation
/usageSession cost, plan limits, stats (aliases /cost, /stats)
/configOpen settings
/doctorSetup checkup that can fix issues
/export [filename]Export the conversation as text
/helpShow help and commands
/exitExit (alias /quit)

Ready-made prompts for coding sessions are in Claude Code prompts.

Keyboard shortcuts and input prefixes

KeyAction
EscStop Claude mid-turn; work so far is kept
Esc + EscClear the draft, or open rewind when input is empty
Shift+TabCycle permission modes
Ctrl+CInterrupt, or clear input; press again to exit
Ctrl+RSearch command history
Ctrl+OToggle the transcript viewer
Ctrl+BSend running tasks to the background
Ctrl+TShow or hide Claude's task checklist
Ctrl+GEdit the prompt in your text editor
Option+P / Alt+PSwitch model
\ + Enter or Ctrl+JNew line in the prompt
! at startShell mode: run a command and add its output
@File path autocomplete
? on empty inputShortcut help panel

Permission modes

ModeRuns without askingUse for
default (Manual)Reads onlySensitive work
acceptEditsReads, file edits, common filesystem commandsIterating on code you review
planReads, plus classifier-approved commands where auto mode is availableExploring before changing
autoEverything, with a background classifier checkLong tasks
dontAskPre-approved tools; anything else is deniedCI and scripts
bypassPermissionsEverythingIsolated containers and VMs only

Deny rules block in every mode. Rules use patterns such as Bash(npm run *) or Read(./.env) and live under permissions in settings.json, or are managed with /permissions.

CLAUDE.md

CLAUDE.md holds instructions Claude reads at the start of every session. Anthropic treats it as context that Claude follows. To block an action outright, use a hook.

ScopeLocation
User, all projects~/.claude/CLAUDE.md
Project, shared via git./CLAUDE.md or ./.claude/CLAUDE.md
Local, personal./CLAUDE.local.md (add to .gitignore)
Path-scoped rules.claude/rules/*.md
  • Import other files with @path/to/file, up to four hops deep.
  • Anthropic suggests keeping each CLAUDE.md under 200 lines.
  • Claude Code can also read a repository's AGENTS.md.
Try it
# Project: [name]
## Commands
- Build: [build command]
- Test: [test command, and how to run one test]
- Lint: [lint command]
## Conventions
- [language version, style rule, naming rule]
- [where new files go]
## Never
- [action Claude must not take, and why]

CLAUDE.md is the project-level cousin of a system prompt; the system prompts guide compares them, and context engineering covers what belongs in each.

Hooks, skills and MCP

Hooks

Shell commands that run on events, set under hooks in a settings file and listed with /hooks. A hook that exits with code 2 blocks the action.

EventFires
SessionStartSession begins or resumes
UserPromptSubmitBefore Claude processes a prompt
PreToolUseBefore a tool call; can block it
PostToolUseAfter a tool call succeeds
NotificationClaude Code sends a notification
StopClaude finishes responding

Skills

A skill is a SKILL.md file in ~/.claude/skills/<name>/ (personal) or .claude/skills/<name>/ (project). It becomes /name, and Claude can also load it when relevant. Custom commands in .claude/commands/ still work and have been merged into skills. Key front-matter fields: description, disable-model-invocation, allowed-tools. More in Claude Skills explained and the Claude Skills library.

MCP

CommandWhat it does
claude mcp add --transport http <name> <url>Add a remote server
claude mcp add <name> -- <command>Add a local stdio server
claude mcp listList servers
claude mcp get <name>Check one server's status
--scope projectShare via .mcp.json in the repo (default scope is local)

If you are weighing Claude Code against other coding agents, see Claude Code vs Cursor and Claude Code vs Codex.

FAQ

How do I see every Claude Code command?

Type / in a session, or run /help. Anthropic's commands reference lists all of them, marking which are bundled skills.

How do I switch permission modes?

Press Shift+Tab in the CLI, or start with --permission-mode.

Where does CLAUDE.md go?

Project instructions go in ./CLAUDE.md or ./.claude/CLAUDE.md; personal ones for all projects go in ~/.claude/CLAUDE.md. /init writes a starter file.

Do custom slash commands still work?

Yes. Files in .claude/commands/ keep working, and a skill at .claude/skills/<name>/SKILL.md creates the same /name command.

Sources

  1. CLI reference — Claude Code Docs, accessed October 2026
  2. Commands — Claude Code Docs, accessed October 2026
  3. Interactive mode — Claude Code Docs, accessed October 2026
  4. Choose a permission mode — Claude Code Docs, accessed October 2026
  5. Configure permissions — Claude Code Docs, accessed October 2026
  6. How Claude remembers your project — Claude Code Docs, accessed October 2026
  7. Automate actions with hooks — Claude Code Docs, accessed October 2026
  8. Extend Claude with skills — Claude Code Docs, accessed October 2026
  9. Connect Claude Code to tools via MCP — Claude Code Docs, accessed October 2026
Weekly

New prompts in your inbox

One email a week: the best new prompts and one short guide. Unsubscribe any time.