Skip to content

Non-interactive Mode

Use non-interactive mode when you want Claude Code to run from a shell command instead of an interactive session.

Terminal window
claude -p "Explain what this project does"
Terminal window
claude -p "List all API endpoints" --output-format json
Terminal window
claude -p "Analyze this log file" --output-format stream-json --verbose
  • CI checks.
  • Pre-commit hooks.
  • Repo analysis scripts.
  • Batch summarization.
  • Structured extraction into another command.

Use --verbose while developing the automation. Turn it off once the workflow is stable unless you need detailed logs.