Skip to main content
Output flags control how AI Runner displays results, handles streaming, and processes piped input.

Streaming Flags

flag
Stream output in real-time - Display AI responses as they’re generated
What it does:
  • Enables real-time streaming output
  • Shows AI response as it’s being generated (word by word)
  • Status messages go to stderr, clean output to stdout
  • Automatically adds --output-format stream-json --verbose
Requirements:
  • jq must be installed: brew install jq
Use for:
  • Long-running scripts where you want progress
  • Scripts that generate reports (output to file, narration to console)
  • Debugging and monitoring
Example:
Shebang:
flag
Suppress status messages - Clean output only (perfect for CI/CD)
Short form: -qWhat it does:
  • Disables --live status narration
  • Suppresses “Using: …” and “Model: …” messages
  • Only shows AI response (clean stdout)
  • Perfect for piping and file redirection
Use for:
  • CI/CD pipelines
  • Script output that feeds into other tools
  • File generation without noise
Examples:

Input Positioning

flag
Control where piped content goes - Prepend or append stdin to file content
Values:
  • prepend (default) - Piped content comes before file content
  • append - Piped content comes after file content
Default behavior (prepend):
Append behavior:
Use prepend for:
  • Data-first workflows (“here’s the data, now analyze it”)
  • Piping logs/metrics to analysis scripts
Use append for:
  • Context-first workflows (“here’s the task, here’s the data”)
  • Scripts where instructions come first

Output Format

flag
Claude Code native: Control output format
Values:
  • text (default) - Plain text output
  • json - Complete JSON response at end
  • stream-json - Streaming JSON (used by --live)
Note: --live automatically sets stream-jsonExamples:
flag
Claude Code native: Show detailed execution information
What it does:
  • Shows detailed internal operations
  • Displays API requests/responses
  • Useful for debugging issues
Automatically enabled by:
  • --live flag
  • --output-format stream-json

Examples

Real-Time Streaming

Shebang for streaming:

CI/CD Clean Output

GitHub Actions:

Unix Pipelines

Debugging

Report Generation

Dual Output Streams

Live Streaming Details

When you use --live:
  1. Status messages → stderr (your console)
  2. Clean output → stdout (files, pipes)
  3. Real-time display → word-by-word as generated
  4. Requires jq → install with brew install jq
Example output:

Combining Flags

Stream Processing

Extract JSON Fields

Parse Streaming Output

Split Streams

Troubleshooting

Install jq for JSON streaming:
Status messages go to stdout by default. Use --quiet or redirect stderr:
Make sure you’re using the AI Runner wrapper, not calling Claude Code directly:
Use --stdin-position to control placement:

Permission Flags

Control file access and execution

Scripting Guide

Full automation guide with examples