Commands
claude -p
Command
claude -p "summarize the changes in the last commit"Non-interactive print mode. Outputs the response then exits.
When to use
Scripts, CI pipelines, piped workflows, or when you just want a quick one-shot answer.
Example
git diff HEAD~1 | claude -p "summarize these changes"Notes
- ·Output goes to stdout. Combine with pipes for powerful scripting.