-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or requestimpact: contractChanges stdin/stdout contract with Claude Code. High risk.Changes stdin/stdout contract with Claude Code. High risk.phase: 5-output-pipelinePhase 5: Output format (must preserve hook contract)Phase 5: Output format (must preserve hook contract)risk: criticalCritical risk — can silently disable the hookCritical risk — can silently disable the hooktopic: outputOutput format, JSON, suggested fixesOutput format, JSON, suggested fixes
Description
Summary
Add a JSON/JSONL output mode so trigger matches can be consumed programmatically by CI pipelines, dashboards, or other tools.
Current Behavior
The stop hook outputs human-readable text to stdout. This works for Claude Code's stop hook mechanism but is difficult to parse for automation.
Proposed Behavior
Support multiple output formats via config or environment variable:
text (default, current)
HALLUCINATION_DETECTED: speculation_language — "I think" at offset 12
json
{
"status": "fail",
"triggerCount": 3,
"triggers": [
{ "kind": "speculation_language", "evidence": "I think", "offset": 12, "confidence": 75 },
{ "kind": "causality_language", "evidence": "because", "offset": 45, "confidence": 82 }
],
"scannedLength": 1024,
"timestamp": "2026-02-28T03:50:00Z"
}jsonl
One JSON object per line — suitable for streaming and log aggregation.
Use Cases
- CI pipeline integration (fail build on hallucination triggers)
- Dashboard/metrics collection
- Integration with other tools that consume structured output
- Aggregating trigger statistics across sessions
Acceptance Criteria
- `outputFormat` setting in config (feat: config file handling — cascading settings from multiple sources #10) controls format
- `HALLUCINATION_DETECTOR_FORMAT` env var as override
- JSON schema documented
- Text format remains the default
- Tests cover all three output modes
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestimpact: contractChanges stdin/stdout contract with Claude Code. High risk.Changes stdin/stdout contract with Claude Code. High risk.phase: 5-output-pipelinePhase 5: Output format (must preserve hook contract)Phase 5: Output format (must preserve hook contract)risk: criticalCritical risk — can silently disable the hookCritical risk — can silently disable the hooktopic: outputOutput format, JSON, suggested fixesOutput format, JSON, suggested fixes