Skip to main content
Claude Code has two categories of commands:
  • CLI flags — options you pass when starting Claude from your terminal (e.g. claude --model sonnet). They configure the session before it starts.
  • Slash commands — text commands you type inside an active session (e.g. /help). They control Claude’s behavior while the session is running.

Getting help

# Show all CLI flags
claude --help

# Inside a session, list slash commands
/help
/help lists every slash command available in the current session, including commands added by plugins and skills.

Two types of commands

TypeWhen to useExample
CLI flagsConfigure a session at launch — set the model, output format, permission modeclaude --permission-mode acceptEdits "fix the tests"
Slash commandsInteract with a running session — manage memory, switch models, commit code/commit
CLI flags are consumed once and cannot be changed mid-session (with the exception of /model and /permissions, which change the running configuration in place).

CLI flags

Pass flags directly after claude:
claude [flags] [prompt]
# Non-interactive: print response and exit
claude -p "summarize this file" < README.md

# Set model for the session
claude --model opus

# Accept all file edits automatically
claude --permission-mode acceptEdits
See CLI flags for the full list.

Slash commands

Type a slash command at the input prompt inside any session:
/command [arguments]
/init
/compact summarize only the last three tasks
/model claude-opus-4-5
See Slash commands for the full list.

Keyboard shortcuts

These shortcuts work inside any interactive Claude Code session:
KeyAction
Ctrl+CInterrupt the current response (Claude stops mid-turn)
Ctrl+DExit Claude Code
Ctrl+LClear the terminal display (does not clear conversation history)
Up / DownNavigate input history
TabAutocomplete slash command names
EscapeCancel an in-progress permission prompt
Ctrl+C interrupts the current response but keeps the conversation alive. Use Ctrl+D or /exit to end the session entirely.

Subcommands

In addition to the main claude command, a few subcommands are available in your terminal:
SubcommandDescription
claude mcpConfigure and manage MCP servers
claude mcp serveStart Claude Code as an MCP server
claude doctorDiagnose installation and configuration issues
claude updateUpdate Claude Code to the latest version
claude mcp --help
claude doctor