[FEATURE] Add --output-style flag for non-interactive mode
Resolved 💬 5 comments Opened Sep 10, 2025 by 0x4rm4nd Closed Sep 11, 2025
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
Currently, output styles work perfectly in interactive mode via /output-style <CUSTOM_STYLE>, but there's no equivalent for non-interactive/programmatic usage with --print mode. This creates a gap for automation workflows that need consistent, structured responses.
Verbose and error-prone
claude --print --append-system-prompt "CRITICAL: Output pure JSON without explanations..." "Analyze strength & weakness of architecture"
Proposed Solution
# Clean and intuitive
claude --print --output-style architecture-json "Analyze strength & weakness of architecture"
Alternative Solutions
_No response_
Priority
High - Significant impact on productivity
Feature Category
CLI commands and flags
Use Case Example
- CI/CD Integration: Automated analysis reports with consistent JSON structure
- Docker/Container Workflows: Microservices orchestration requiring predictable output
formats
- API Integration: Programmatic consumption of Claude responses
- Batch Processing: Large-scale analysis with standardized output schemas
Additional Context
Implementation Details
The feature should:
- Load output styles from ~/.claude/output-styles/*.md
- Apply the style's system prompt when --print and --output-style are used together
- Provide clear error messages for invalid style names
Benefits
- Consistency: Eliminates manual system prompt management
- Maintainability: Centralized style definitions in .md files
- Developer Experience: Matches the intuitive /output-style command from interactive mode
- Automation-Friendly: Essential for programmatic Claude Code usage
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗