CLI Commands Reference
Basic Commands
| Command | Description |
|---|---|
| claude | Start interactive mode |
| claude --version | Show version |
| claude --help | Show help |
Execution Modes
| Command | Mode |
|---|---|
| claude | Interactive REPL |
| claude "prompt" | Interactive with prompt |
| claude -p "prompt" | Print mode |
| claude < file.txt | File input |
Session Commands
| Command | Description |
|---|---|
| claude --continue | Continue last session |
| claude --resume ID | Resume specific session |
Configuration
| Command | Description |
|---|---|
| claude config | Open settings |
| claude config set KEY VALUE | Set option |
| claude config get KEY | Get option |
Slash Commands (In-Session)
Navigation
- /help - Show help
- /quit - Exit
- /clear - Clear conversation
Context
- /compact - Compress context
- /memory - Manage memory
- /init - Initialize CLAUDE.md
Information
- /cost - Token usage
- /model - Current/switch model
- /mcp - MCP status
- /doctor - Diagnostics
Environment Variables
| Variable | Purpose |
|---|---|
| ANTHROPIC_API_KEY | API authentication |
| CLAUDE_CODE_USE_BEDROCK | Use AWS Bedrock |
| CLAUDE_CODE_USE_VERTEX | Use Google Vertex |
| CLAUDE_CODE_DEBUG | Enable debug |