Skip to content

CLI Commands Reference

Basic Commands

CommandDescription
claudeStart interactive mode
claude --versionShow version
claude --helpShow help

Execution Modes

CommandMode
claudeInteractive REPL
claude "prompt"Interactive with prompt
claude -p "prompt"Print mode
claude < file.txtFile input

Session Commands

CommandDescription
claude --continueContinue last session
claude --resume IDResume specific session

Configuration

CommandDescription
claude configOpen settings
claude config set KEY VALUESet option
claude config get KEYGet option

Slash Commands (In-Session)

  • /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

VariablePurpose
ANTHROPIC_API_KEYAPI authentication
CLAUDE_CODE_USE_BEDROCKUse AWS Bedrock
CLAUDE_CODE_USE_VERTEXUse Google Vertex
CLAUDE_CODE_DEBUGEnable debug

Based on Official Claude Code Documentation