Reference

Claude Code Commands

Every command, flag, shortcut, and configuration option in one place. 175 entries across 8 categories.

CLI Commands

22
interactive

Start Interactive Mode

claude

Launch Claude Code in interactive REPL mode.

one-shot

One-Shot Question

claude "your question"

Ask a question and get a response without entering interactive mode.

scripting

Pipe & Print

claude -p "your prompt"

Use in non-interactive mode for scripting and piping output.

scripting

Pipe Input

cat file.txt | claude -p "summarize this"

Pipe content from other commands into Claude for processing.

session

Continue Last Session

claude -c

Continue the most recent conversation session.

session

Resume Session

claude -r

Resume a previous session interactively from a list.

system

Update Claude Code

claude update

Update Claude Code to the latest version.

auth

Auth Login

claude auth login

Authenticate with your Anthropic account or API key.

auth

Auth Logout

claude auth logout

Sign out of your current session.

auth

Auth Status

claude auth status

Check current authentication status.

agents

Agents

claude agents

Manage and list available Claude Code agents.

system

Doctor

claude doctor

Run diagnostics to check Claude Code installation health.

system

Remote Control

claude remote-control

Start remote control mode for external tool integration.

mcp

MCP List

claude mcp list

List all configured MCP servers.

mcp

MCP Add

claude mcp add <name> <command> [args...]

Add a new MCP server with stdio transport.

mcp

MCP Add JSON

claude mcp add-json <name> '<json>'

Add a new MCP server from raw JSON configuration.

mcp

MCP Add from Desktop

claude mcp add-from-claude-desktop

Import MCP servers from Claude Desktop configuration.

mcp

MCP Remove

claude mcp remove <name>

Remove an MCP server by name.

mcp

MCP Serve

claude mcp serve

Start Claude Code as an MCP server itself.

config

Config List

claude config list

List all configuration settings and their values.

config

Config Get

claude config get <key>

Get the value of a specific configuration key.

config

Config Set

claude config set <key> <value>

Set a configuration value.

CLI Flags

49
model

Set the AI model to use for the session.

model

Fallback model if the primary model is unavailable.

output

Non-interactive mode — print response and exit.

session

Continue the most recent conversation.

session

Resume a specific session by ID or interactively.

session

Start a session from a pull request URL or number.

session

Fork an existing session into a new one.

session

Specify a session ID to resume or create.

session

Start Claude in a new git worktree.

context

Add additional directories to the session context.

limits

Limit the number of agentic turns in non-interactive mode.

limits

Set a maximum cost budget for the session.

prompt

Override the system prompt entirely.

prompt

Load system prompt from a file path.

prompt

Append additional instructions to the system prompt.

prompt

Append system prompt content from a file.

tools

Whitelist specific tools for the session.

tools

Blacklist specific tools from the session.

tools

Define a custom tool configuration.

permissions

Set permission level: default, plan, or bypassPermissions.

permissions

Skip all permission checks (requires acknowledgment).

permissions

Allow the skip-permissions flag to be used.

permissions

Use an MCP tool for permission prompts.

output

Set output format: text, json, or stream-json.

output

Set input format: text or stream-json.

output

Enforce a JSON schema on the output.

output

Include partial streaming messages in output.

session

Don't persist the session to disk.

agents

Specify an agent to use by name.

agents

List available agents.

mcp

Path to MCP server configuration file.

mcp

Only use MCP servers from the config file.

tools

Path to a directory of plugin files.

browser

Force enable Chrome browser integration.

browser

Disable Chrome browser integration.

system

Set IDE integration mode.

system

Enable debug logging.

system

Enable verbose output.

system

Initialize a CLAUDE.md file in the current directory.

system

Initialize CLAUDE.md and exit immediately.

system

Run maintenance tasks.

remote

Connect to a remote machine via SSH.

remote

Connect to a remote session via teleport.

system

Enable teammate mode for collaborative workflows.

system

Disable slash command processing.

system

Enable beta features by name.

config

Override settings from a JSON string.

config

Show where settings are loaded from.

system

Print the current Claude Code version.

Slash Commands

45
info

Show help and available commands.

session

Clear the conversation history.

session

Compact conversation to save context window.

info

Show current context window usage.

info

Show cost breakdown for the current session.

info

Show token usage statistics.

model

Switch to a different AI model.

model

Toggle fast mode (same model, faster output).

workflow

Enter plan mode for structured task planning.

editor

Toggle vim keybindings.

config

Create or update the CLAUDE.md file.

memory

View and manage auto-memory files.

config

Open configuration settings.

permissions

View and manage tool permissions.

system

Run diagnostic checks.

session

Resume a previous session.

session

Rename the current session.

session

Rewind to a previous point in the conversation.

output

Export the conversation to a file.

output

Copy the last response to clipboard.

workflow

Review code changes made in the session.

system

Report a bug in Claude Code.

workflow

View and manage background tasks.

agents

List and manage available agents.

info

Show session statistics.

info

Show usage insights and patterns.

config

View and manage lifecycle hooks.

mcp

Manage MCP server connections.

ui

Change the color theme.

ui

Set output verbosity style.

ui

Configure terminal integration.

ui

View and configure keyboard shortcuts.

ui

Configure the status line display.

remote

Connect to or manage teleport sessions.

config

Edit the shell rc file.

context

Add a directory to the session context.

auth

Authenticate with Anthropic.

session

Exit Claude Code.

system

Manage sandbox environments.

system

Install the Claude Code GitHub App.

workflow

View and manage the todo list.

workflow

Run batch operations across files.

workflow

Review and simplify recent code changes.

tools

Manage plugins.

info

Show session and connection status.

Keyboard Shortcuts

20
KeysAction
Enter
Send message / confirm action
Shift + Enter
Insert a new line
\ + Enter
Escape newline — send multi-line input
Esc
Cancel current input / close menu
Esc × 2
Force-cancel a running operation
Ctrl + C
Interrupt the current generation
Ctrl + G
Open fuzzy file search
Ctrl + R
Search through session history
Ctrl + T
Open tool selection
Ctrl + O
Open a file in the editor
Ctrl + S
Save current conversation
Ctrl + V
Paste from clipboard
Ctrl + L
Clear the terminal screen
Tab
Accept autocomplete suggestion
Shift + Tab
Cycle autocomplete backwards
Cmd/Alt + P
Toggle plan mode
Cmd/Alt + T
Toggle tool permissions
Up Arrow
Recall previous message
Shift + Drag
Select text in terminal
?
Show keyboard shortcut help

Prompt Special Characters

5
CharacterDescription
@filename
Reference a file and add it to context
@terminal:name
Reference output from a named terminal session
#content
Include content from a specific source
!command
Execute a shell command inline
& task
Run a task in the background

Environment Variables

12
VariableDescription
ANTHROPIC_API_KEY
Your Anthropic API key for authentication.
CLAUDE_CODE_EFFORT_LEVEL
Set reasoning effort: low, medium, or high.
CLAUDE_CODE_MAX_OUTPUT_TOKENS
Maximum tokens in a single response.
MAX_MCP_OUTPUT_TOKENS
Maximum tokens for MCP tool responses.
MAX_THINKING_TOKENS
Maximum tokens for extended thinking.
BASH_DEFAULT_TIMEOUT_MS
Default timeout for shell commands (ms).
BASH_MAX_TIMEOUT_MS
Maximum allowed timeout for shell commands (ms).
SLASH_COMMAND_TOOL_CHAR_BUDGET
Character budget for slash command tool output.
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS
Enable experimental agent teams feature.
CLAUDE_CODE_TASK_LIST_ID
Task list ID for todo integration.
CLAUDE_CODE_HOME
Override the Claude Code home directory path.
DEBUG
Enable debug logging output.

Configuration Files

9
PathDescription
CLAUDE.md
Project-level instructions loaded automatically into context.
.claude/settings.json
Project-scoped settings (tracked in git).
.claude/settings.local.json
Local project settings (git-ignored).
~/.claude/settings.json
Global user settings applied to all projects.
~/.claude/keybindings.json
Custom keyboard shortcut bindings.
~/.claude/commands/
User-defined global slash commands.
.claude/commands/
Project-specific slash commands.
~/.claude/skills/
Global skill files loaded automatically.
.claude/skills/
Project-specific skill files.

Hook Events

14
EventDescription
PreToolUse
Fires before a tool is executed. Can block or modify.
PostToolUse
Fires after a tool completes successfully.
PostToolUseFailure
Fires after a tool execution fails.
Stop
Fires when Claude finishes generating a response.
SessionStart
Fires when a new session begins.
SessionEnd
Fires when a session ends.
UserPromptSubmit
Fires when the user submits a message.
PermissionRequest
Fires when Claude requests a permission.
Notification
Fires when a notification is triggered.
SubagentStart
Fires when a subagent is launched.
SubagentStop
Fires when a subagent finishes.
TeammateIdle
Fires when a teammate agent becomes idle.
TaskCompleted
Fires when a background task completes.
PreCompact
Fires before conversation compaction.

Supercharge Your Claude Code Workflow

Browse 501 pre-built skills that turn Claude into a domain expert for any task.