1 / 6
GETTING STARTED
Core CLI Commands
| claude |
Launch interactive REPL session in the current directory |
| claude "fix the login bug" |
Start a session with an initial prompt already loaded |
| claude -p "query" |
Print mode: get one answer and exit (great for scripts and CI) |
| claude -c |
Continue your most recent session with full context preserved |
| claude -r "session-id" |
Resume a specific named session by its ID |
| claude -w feature-branch |
Work in an isolated git worktree (changes don't touch main) |
| claude update |
Update Claude Code to the latest version |
ESSENTIAL FLAGS
--model opus
Switch to a specific model
--max-turns 5
Limit conversation turns
--max-budget-usd 5
Cap spending per session
--output-format json
Structured output for scripts
--allowedTools
Permit specific tools only
--effort high
Set reasoning effort level
--verbose
Show detailed execution logs
--add-dir ./libs
Add extra working directories
!
First thing on any new project: Run /init to auto-generate a CLAUDE.md file. This saves tokens and dramatically improves consistency by giving Claude project context upfront.