Setup Claude Foundations

Essential CLI Flags

The most useful Claude Code command-line options for daily work

4 of 66

Session management

# Resume last conversation
claude --resume

# Continue most recent session
claude --continue

# Start with a specific model
claude --model claude-sonnet-4-20250514

One-shot commands

Run Claude without entering interactive mode:

# Pipe input
claude -p "explain this error" < error.log

# Output as plain text (for scripts)
claude -p "list TODOs in this repo" --output-format text

# Read-only mode (no file edits)
claude -p "review this code" --allowedTools ""

Debugging

# See tool calls and token counts
claude --verbose

# Use a system prompt
claude --system-prompt "You are a Python expert"

Quick reference

FlagWhat it does
--resumeResume last conversation
--continueContinue most recent session
-p "..."One-shot command (non-interactive)
--verboseShow tool calls and token counts
--modelUse a specific model
--output-format textPlain text output
--allowedTools ""Read-only mode

Tip

Combine -p with pipes for scripted workflows:

git diff | claude -p "review these changes" --output-format text

Working out which model to run this on? See The Codex. Packaging it as a reusable skill? See The Armory.