Use claude -p to send a prompt without entering interactive mode.

Where -p Fits in Scripting and Automation Workflows

Perfect for piping files, chaining with other CLI tools, or using in shell scripts.

Capturing Claude’s Output for Redirection

Outputs to stdout so you can redirect results.