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
| Flag | What it does |
|---|---|
--resume | Resume last conversation |
--continue | Continue most recent session |
-p "..." | One-shot command (non-interactive) |
--verbose | Show tool calls and token counts |
--model | Use a specific model |
--output-format text | Plain text output |
--allowedTools "" | Read-only mode |
Tip
Combine -p with pipes for scripted workflows:
git diff | claude -p "review these changes" --output-format text