Claude Code is more than an interactive chat — learn the flags that resume past work, pipe it into scripts, and point it at extra folders.
Why: you can drop into a conversation or fire a single request and exit — the second is what you script later. When: pass a quoted prompt to start with a task; add -p to print the answer and quit without the interactive UI. Where: -p (print) mode is the foundation of automation, covered in a later lesson.
claude # open an interactive session
claude "explain src/auth.ts" # open, with a first prompt already sent
claude -p "summarize the README in 3 bullets" # print result and exitWhy: conversations are saved, so you never lose context when you close the terminal. When: use -c to jump back into the most recent one, or -r to pick an older session from a list. Where: this is the same as the /resume command, but from your shell.
claude -c # continue the most recent conversation
claude -r # pick a past session to resume from a list
claude -r "<session-id>" # resume a specific session by idWhy: a handful of flags cover almost everything — extra directories, a specific model, and a starting permission mode. When: reach for --add-dir when your work spans more than one folder. Where: full list is in claude --help.
-c, --continue — Resume the most recent conversation in this directory.-r, --resume — Pick a past session to resume (or pass a session id).-p, --print — Non-interactive: run the prompt, print the result, exit. For scripting.--add-dir <path> — Give Claude access to an additional working directory beyond the current one.--model <name> — Set the model for this session (e.g. opus, sonnet, haiku).claude --add-dir ../shared-lib --model sonnet "wire the shared logger into this app"