Here is the English translation of the Markdown document:
Source: Official Documentation
npm install -g @anthropic-ai/claude-code
Requires an Anthropic API Key or Claude Pro/Max subscription:
export ANTHROPIC_API_KEY="YOUR_API_KEY"
| Command | Description | Example |
|---|---|---|
claude |
Starts an interactive REPL | claude |
claude "query" |
Starts with an initial prompt | claude "explain this" |
claude -p "query" |
Print mode, exits after execution | claude -p "review code" |
claude -c |
Continues the most recent conversation | claude -c |
claude -c -p "query" |
Continues conversation (Print mode) | claude -c -p "run tests" |
claude -r "id" "query" |
Resumes a specified session | claude -r "abc123" "continue" |
claude update |
Updates to the latest version | claude update |
claude mcp |
Configures the MCP server | claude mcp add server |
| Parameter | Description | Example |
|---|---|---|
--model |
Specifies the model | --model claude-sonnet-4 |
--output-format |
Output format: text/json/stream-json |
--output-format json |
--max-turns |
Limits the number of conversation turns | --max-turns 3 |
--dangerously-skip-permissions |
Skips all permission confirmations (YOLO) | See below |
--allowedTools |
List of allowed tools | --allowedTools "Write" "Bash(git *)" |
--disallowedTools |
List of disallowed tools | --disallowedTools "Bash(rm *)" |
--add-dir |
Adds additional working directories | --add-dir ./apps ./lib |
--verbose |
Enables detailed logs | --verbose |
--continue |
Continues the recent conversation | --continue |
--resume |
Resumes a specified session | --resume abc123 |
claude-sonnet-4 - Balanced model (default)claude-opus-4 - Most powerful modelclaude-opus-4.5 - Latest and most powerful# Print mode (non-interactive, exits after execution)
claude -p "review this code" --output-format text
# Piped input
cat input.txt | claude -p "explain these errors"
# YOLO mode (skips all permission confirmations)
claude --dangerously-skip-permissions "Your prompt"
# Alias setup
alias cc='claude --dangerously-skip-permissions'
# Continue conversation + Print mode (suitable for scripts)
claude -c -p "show progress"
| Command | Description |
|---|---|
/help |
Displays all commands |
/config |
Configures settings |
/allowed-tools |
Configures tool permissions |
/mcp |
Manages MCP servers |
/vim |
Enables vim editing mode |
~/.claude/settings.json.claude/settings.jsonLocal settings: .claude/settings.local.json
{
"model": "claude-sonnet-4",
"permissions": {
"allowedTools": ["Read", "Write", "Bash(git *)"],
"deny": ["Read(./.env)", "Bash(rm *)"]
}
}
~/.claude/CLAUDE.md./CLAUDE.mdIncreasing intensity:
think - Basic thinkingthink hard - Deep thinkingthink harder - Deeper thinkingultrathink - Deepest thinking--dangerously-skip-permissions/compact or /clear/rewind