-
Notifications
You must be signed in to change notification settings - Fork 55
Open
Description
Feature Request
Add support for piping live output from claude -p --output-format stream-json directly into claude-code-log for real-time log processing.
Context
This is a follow-up to #43, which added text/markdown/chat output formats. During implementation, we discovered that the stream-json format from Claude Code's live output has a different schema than saved transcript files:
Stream-json format (from claude -p):
- Missing fields:
parentUuid,isSidechain,userType,cwd,version,timestamp - Different structure optimized for streaming
Saved transcript format (from ~/.claude/projects/):
- Complete metadata fields
- Full session information
- What claude-code-log currently supports
Proposed Solution
Add a --stream-json mode that:
- Accepts piped input from
claude -p --output-format stream-json - Handles the different schema (missing metadata fields)
- Outputs formatted text in real-time or buffers until completion
- Works with existing format options (text, markdown, chat)
Example Usage
# Real-time CI/CD log formatting
claude -p "Review this code" --output-format stream-json | claude-code-log --stream-json --format chat
# Or capture to file
claude -p "Build project" --output-format stream-json | claude-code-log --stream-json --format markdown > build-log.mdBenefits
- Enables CI/CD integration as originally requested in Plain text output? #43
- Real-time log visibility for long-running Claude operations
- Complements existing saved transcript processing
Related
- Plain text output? #43 - Plain text output (implemented)
Metadata
Metadata
Assignees
Labels
No labels