Invocation Modes
Interactive REPL (default)
Section titled “Interactive REPL (default)”Entering claude with no arguments or a custom prompt opens the default interactive REPL where you can run multiple turns, use slash commands, and interact with Claude.
claudeOne-shot prompt
Section titled “One-shot prompt”Passing a prompt as a positional argument runs Claude once and exits. Works in both interactive and print modes.
claude "Explain this code"claude --model opus "Analyze this architecture"Piped stdin
Section titled “Piped stdin”Pipe content directly into Claude for processing. Use -p (print mode) for non-interactive workflows.
cat logs.txt | claude -p "Find errors"echo "code snippet" | claude -p "Review for bugs"Session resume
Section titled “Session resume”Load and continue a recent conversation or resume by name/ID.
claude --continue # Load most recentclaude --resume my-project # Resume by custom nameclaude -r 550e8400-... # Resume by UUIDPrint mode (SDK / headless)
Section titled “Print mode (SDK / headless)”Run Claude once and output structured results without an interactive REPL. Essential for scripting, CI/CD, and programmatic access.
claude -p "query"claude -p --output-format json "query"claude -p --output-format stream-json "query"Git worktree
Section titled “Git worktree”Run Claude in an isolated worktree for parallel development.
claude -w feature-branchclaude -w feature-branch --tmuxRemote / web sessions
Section titled “Remote / web sessions”Create or resume sessions on claude.ai.
claude --remote "Fix login bug" # Create web sessionclaude --teleport session-id # Resume in terminalclaude --remote-control "My Project" # Enable Remote Control