Tips, tricks, and lessons from building software.
Tips, tricks, and lessons from building software — a personal dev blog by Tommy.
Interactive vs Headless: claude vs claude -p
Learn when to use the interactive claude session and when to reach for the headless claude -p print-and-exit mode.
Piping Data into Claude Code
Feed files, command output, and logs straight into Claude Code by piping them into claude -p.
Continuing and Resuming Sessions from the CLI
Pick up where you left off with claude -c to continue the latest session or claude -r to resume a specific one.
Choosing Output Formats: text, json, stream-json
Control how claude -p prints results with --output-format text, json, or stream-json for scripts and pipelines.
Adding Extra Directories with --add-dir
Give Claude Code access to folders outside your current project using the --add-dir flag.
Starting in a Permission Mode with --permission-mode
Launch Claude Code straight into default, acceptEdits, plan, or bypassPermissions with the --permission-mode flag.