-p / --print Flag

Claude Code

Definition

Claude Code CLI flag for non-interactive (headless) execution. Processes the prompt, outputs to stdout, and exits immediately without entering an interactive session. Essential for CI/CD pipeline integration, scripting, and automation workflows.

Example Usage

claude -p 'Review this PR for security issues' --output-format json in a GitHub Actions workflow step.