Use claude -p to send a prompt without entering interactive mode. Perfect for piping files, chaining with other CLI tools, or using in shell scripts. Outputs to stdout so you can redirect results.
Use claude -p for one-shot scripting
Skip interactive mode and send a prompt directly from the command line using the -p flag.
claude -p "explain this error" < error.log