opik-explain

opik-explain is a skill for Claude Code from comet-ml/opik-claude-code-plugin. It costs 113 tokens per session (2,411 once invoked), scanned A, a copy of opik-explain, Apache-2.0.

A read-only investigation tool for finding the likely cause of one Opik trace or a pattern across traces. Opik is a service that records what an AI application did, including its individual steps, called spans.

In plain words
What is it for?
Use it to investigate why an AI request failed, behaved oddly, or produced a recurring problem, using trace evidence and the repository.
Why use it?
It replaces a raw trace dump with a cause tied to the failing step and the code or data behind it. It also shows the supporting spans and one next step without changing code.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: mentions Claude Code; mentions Codex.

Part of the opik plugin — 10 skills, 2 commands, 1 agent, 8 hooks shipped together

Good fit Use it to investigate why an AI request failed, behaved oddly, or produced a recurring problem, using trace evidence and the repository.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/comet-ml/opik-claude-code-plugin/opik-explain
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add comet-ml/opik-claude-code-plugin --skill opik-explain
Clone the repo
git clone --depth 1 https://github.com/comet-ml/opik-claude-code-plugin

Made for: Claude Code.

Or install opik, the plugin that ships this one along with the rest of its 10 skills, 2 commands, 1 agent, 8 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for opik-explain

README.md
[![agentmods](https://agentmods.dev/badge/skills/comet-ml/opik-claude-code-plugin/opik-explain/github.svg)](https://agentmods.dev/skills/comet-ml/opik-claude-code-plugin/opik-explain)
Your own site
<a href="https://agentmods.dev/skills/comet-ml/opik-claude-code-plugin/opik-explain"><img src="https://agentmods.dev/badge/skills/comet-ml/opik-claude-code-plugin/opik-explain/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for opik-explain

Your own site · 80×15
<a href="https://agentmods.dev/skills/comet-ml/opik-claude-code-plugin/opik-explain"><img src="https://agentmods.dev/badge/skills/comet-ml/opik-claude-code-plugin/opik-explain.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 113 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,411 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 94% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00113 $0.02411
Opus 5.5 $0.00045 $0.00964
Sonnet 5.5 $0.00023 $0.00482
Haiku 4.5 $0.00011 $0.00241

Measured 1mo ago against content hash e149d79d07f5, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

opik-explain scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

94% identical to opik-explain — 9 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

skills/opik-explain/SKILL.md · 123 lines

How it starts

The opening of the file, as written. The whole thing — 123 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Explain — Root-Cause an Opik Trace and Ground It in the Code

Definition of done: a grounded root cause for the requested trace (or pattern), tied to specific evidence spans and paired with exactly one suggested next step. "Grounded" means the explanation names the failing/anomalous span and connects it to the code or data that produced it — not a restatement of the trace. If the target can't be fetched or read, stop at the first genuine blocker and return one concrete next step. A trace dump is not an explanation.

Operate: investigate over the real trace data, reason against the repo, commit to a single most-likely root cause with its evidence — and change no code. This skill is read-only by design.

Inputs

The entry point is /opik-explain <trace-id> (one trace) or /opik-explain <describe the behavior> (a pattern to find and explain). Infer the rest; treat these as optional overrides:

  • project name (default: inferred from config/repo) · time window for a pattern (default: recent) · a known-good trace to compare against.

Ask only at a genuine, non-inferable blocker (see Blockers).

Activation — the only in-scope work

1. Resolve the target

  • A trace id (uuid-shaped): explain that one trace.
  • A behavior/pattern ("hallucinations since the prompt change", "slow responses"): search for the matching set (below), then explain the shared cause.
  • Confirm Opik is reachable: if ~/.opik.config exists or OPIK_API_KEY is set, use it. Otherwise → Blocker ("run opik configure, then rerun").

2. Fetch the trace and spans — MCP first, SDK fallback

Check whether the hosted Opik MCP is connected and prefer it; fall back to SDK scripting when it isn't.

  • MCP connected: use the MCP to read the trace and list/read its spans.
  • No MCP: fall back to the SDK.

Either way, read every span's input/output/error/duration.

import opik
client = opik.Opik()

tid = "<trace_id>"
trace = client.get_trace_content(tid)       # TracePublic: exposes project_id, input, output, error info — NOT project_name (accessing .project_name raises)
project = client.rest_client.projects.get_project_by_id(trace.project_id).name
spans = client.search_spans(project_name=project, trace_id=tid)   # spans come from a SEPARATE call, not from the trace object
# ALWAYS pass project_name: without it the SDK searches the configured default project, which
# returns an empty list (or a 404 if that project doesn't exist) even for a valid trace id.
# Reconstruct the tree via each span's parent_span_id (the root span has none).
# Your anchor is the first span that errored, returned wrong output, or dominates the duration.

Read the full file on GitHub · 123 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 123 lines · 113 tokens per session scan A e149d79d07f5

Subscribe to this mod's changes

opik-explain is a skill published in the GitHub repository comet-ml/opik-claude-code-plugin (23 stars, last pushed today), licensed Apache-2.0. It adds 113 tokens to every session and 2,411 once invoked, about $0.0005 per session on Opus 5.5. A static security scan graded it A with 0 findings. It is 94% identical to opik-explain, differing in 9 lines, and is treated as a copy.

Related

Other skills, from other repositories

troubleshooting-assistant

Diagnoses and resolves MCP server registration failures, GPU detection, BigQuery authentication, index build failures, import errors, search quality issues, and performance problems.

RobThePCGuy/Claude-Patent-Creator · 37 tokens

doctor

Health probe across the worker, embedder, summarizer, queue, vector index, schema, cross-AI wiring and plugin install (cache and live versions). Use when the user types /captain-memo:doctor or when something seems wrong.

kalinbogatzevski/captain-memo · 52 tokens

log-structured

USE WHEN auditing logging in a legacy codebase, after adopting the JSON-lines spec, or when user asks to clean up logging. Finds print/console.log/interpolated logger calls and suggests spec- compliant replacements per AGENTS.md. Read-only — never auto-rewrites. Templates per language in templates/logging/.

Filip-Podstavec/claude-leverage · 69 tokens

log-correlation

Correlates and troubleshoots logs across OS (Linux/macOS), AWS (CloudWatch, CloudTrail, ALB, Lambda), application (JSON, logfmt), and web servers (Nginx, Apache).

RealDougEubanks/ClaudeMarketplace · 49 tokens

claude-bridge

Use when orchestrating multiple Claude Code chats, reading other chats' history, sending messages between chats, or searching across chat sessions. Triggers on phrases like "peer chat", "sister chat", "other chat", "cross-chat", "what is the other agent doing", "find in chats", "manager agent", "worker agent"…

michalekz/claude-bridge · 87 tokens

tools-unity-sentry

Sentry Unity SDK integration patterns for error tracking, performance monitoring, transactions, spans, and custom instrumentation.

IdoCohen560/claude-unity-game-studio · 27 tokens