From self-care
Validates OTEL (JSON) or Claude Code (JSONL) trace files, extracts metadata (trace ID, spans, system prompt), reports pass/fail, and offers optional AI-assisted flexible validation.
How this command is triggered — by the user, by Claude, or both
Slash command
/self-care:validateThis command is limited to the following tools:
The summary Claude sees in its command listing — used to decide when to auto-load this command
# Validate Trace Validate the provided trace file and report its metadata. Supports both OTEL (JSON) and Claude Code (JSONL) formats. ## Instructions Run the deterministic trace validator: Parse the JSON output. The result contains: - `valid`: boolean — whether the trace passed validation - `format`: "otel" | "claude-code" | "unknown" - `errors`: array of critical failure messages - `warnings`: array of non-critical issues - `metadata`: object with format-specific fields **If `valid` is true**, display the validation results: For OTEL: For Claude Code: **If `valid` is false**, c...
Validate the provided trace file and report its metadata. Supports both OTEL (JSON) and Claude Code (JSONL) formats.
Run the deterministic trace validator:
node "${CLAUDE_PLUGIN_ROOT}/agents/tools/validate-trace.mjs" $ARGUMENTS
Parse the JSON output. The result contains:
valid: boolean — whether the trace passed validationformat: "otel" | "claude-code" | "unknown"errors: array of critical failure messageswarnings: array of non-critical issuesmetadata: object with format-specific fieldsIf valid is true, display the validation results:
For OTEL:
Trace Validation: PASSED
Format: OTEL
Trace ID: <metadata.traceId>
Service Name: <metadata.serviceName>
Span Count: <metadata.spanCount>
System Prompt: <metadata.systemPromptDetected ? "FOUND (via " + metadata.systemPromptMethod + ")" : "NOT FOUND">
For Claude Code:
Trace Validation: PASSED
Format: Claude Code
Session ID: <metadata.sessionId>
Event Types: <metadata.eventTypes joined with ", ">
System Prompt: <metadata.systemPromptDetected ? "FOUND (via " + metadata.systemPromptMethod + ")" : "NOT FOUND">
If valid is false, check whether the errors are recoverable (eligible for flexible validation):
Recoverable errors (any of these present → offer fallback):
Unrecoverable errors (if ANY of these are present → do NOT offer fallback):
If any unrecoverable error is present, display the errors and stop:
Trace Validation: FAILED
Errors:
- <each error on its own line>
If at least one error is recoverable, offer flexible validation via AskUserQuestion:
Deterministic validation failed:
─────────────────────────────────────────────────────────
<each error on its own line, prefixed with •>
─────────────────────────────────────────────────────────
Would you like to try flexible (AI-assisted) validation?
This uses an LLM to assess whether the trace is still
structurally usable despite not passing strict format checks.
{ "label": "Try flexible validation", "description": "Use AI to assess trace structure" }{ "label": "Stop", "description": "Accept the validation failure" }If the user selects "Stop", display the errors and stop:
Trace Validation: FAILED
Errors:
- <each error on its own line>
If the user selects "Try flexible validation", invoke the flexible-validator agent via Task with:
$ARGUMENTSParse the agent's JSON output.
If the flexible validator returns valid: true:
For OTEL:
Trace Validation: PASSED (flexible)
Format: OTEL
Trace ID: <metadata.traceId>
Service Name: <metadata.serviceName>
Span Count: <metadata.spanCount>
System Prompt: <metadata.systemPromptDetected ? "FOUND (via " + metadata.systemPromptMethod + ")" : "NOT FOUND">
Note: <flexibleNotes>
For Claude Code:
Trace Validation: PASSED (flexible)
Format: Claude Code
Session ID: <metadata.sessionId>
Event Types: <metadata.eventTypes joined with ", ">
System Prompt: <metadata.systemPromptDetected ? "FOUND (via " + metadata.systemPromptMethod + ")" : "NOT FOUND">
Note: <flexibleNotes>
If the flexible validator returns valid: false:
Trace Validation: FAILED (deterministic + flexible)
Errors:
- <each error from the flexible validator on its own line>
Note: <flexibleNotes>
npx claudepluginhub not-diamond/self-care --plugin self-care/debugInvestigates errors in files or production issues using Logfire traces: finds recent exceptions, runs SQL queries on OpenTelemetry data, suggests code fixes, shares trace links.
/instrumentAdds Opik observability to LLM applications by auto-detecting frameworks from dependencies, tracing execution flows, and inserting correct integrations.
/ng-traceCaptures an agent run's tool calls, decisions, inputs, outputs, token use, and approval steps as a repeatable trace record linked to verification claims.
/trajectoryAnalyzes RLM trajectory file at path (default: last), producing summary stats, event distribution, slow events, and errors.
/traceTraces execution path of a request or operation through codebase, documenting functions, inputs, side effects, errors, async flows, and generating sequence diagram with failure points and bottlenecks.
/validateValidates CLI harness for software at given path or GitHub repo against HARNESS.md standards: directory structure, files, Click CLI, core modules, tests, and docs.