# How should I choose a Claude Code operating mode and output format?

Exam: CCDV-F — Claude Certified Developer - Foundations
Knowledge domain: Claude Code
Updated: 2026-11-25T08:30:04.11129+00:00
HTML: https://learningpathx.com/faq/CCDV-F/ccdvf-run-claude-code-headless-output.html

## Also asked as

- When should I use Claude Code interactively or automate it with text, JSON, or streaming JSON?
- How do Claude Code headless output and auto mode affect an automated run?

Use Claude Code interactively when you expect clarification, inspection, or action-by-action review. For a script, use `claude -p` and pick the output format by what the caller needs. The default text format is readable, `--output-format json` returns a structured result, and `--output-format stream-json` produces newline-delimited JSON events. Choose permissions separately.

For text deltas as they are generated, the current CLI documents `--output-format stream-json --verbose --include-partial-messages`. Parse each complete line, route messages by `type`, and check the relevant `result` event. Background work can yield further events or turns after a result event. Check process termination, timeouts, and task-specific verification before recording success.

Set the working directory, tool scope, credential source, and failure policy explicitly. Auto mode uses a classifier for calls its decision flow sends to review. The current documentation lists auto mode on all plans with supported models and providers, subject to organization policy and the installed version. Starting defaults vary by client, invocation, and version. Verify the effective mode because an unavailable auto mode can start in Manual. Keep explicit application approval where the task requires it.

* [Run Claude Code programmatically](https://code.claude.com/docs/en/headless)
* [Claude Code permission modes](https://code.claude.com/docs/en/permission-modes)
* [Claude Code CLI reference](https://code.claude.com/docs/en/cli-reference)

Source: [Claude Code Operation, Configuration, and Extension Surfaces](https://learningpathx.com/news/claude-code-operation-configuration-and-extension-surfaces.html)
