Skip to content
Development
Skill

/opik-diagnose

Surface the Opik traces worth a developer's attention, ranked by signal — Diagnostics issues first, then errors, failed tool calls, latency, regressions, and low online-eval scores. With the Opik MCP connected it lists the project's agent_insights_issue entities, offers to turn

From plugin
opik
2510 skills1 agent2 commands8 hooks

Claude Code

$ npx -y skills add comet-ml/opik-claude-code-plugin --skill opik-diagnose --agent claude-code

SKILL.md

opik-diagnose.SKILL.md
name: opik-diagnose
description: Surface the Opik traces worth a developer's attention, ranked by signal — Diagnostics issues first, then errors, failed tool calls, latency, regressions, and low online-eval scores. With the Opik MCP connected it lists the project's agent_insights_issue entities, offers to turn Diagnostics on when the project has it switched off, then fills the gaps with list (filters, sort, a time window); without the MCP it reads the same via the SDK (agent_insights and search_traces), so it works with no MCP. Returns a ranked shortlist, each item ready to hand to the explain skill. Use for "what is broken in production", "which traces need attention", "find failing or slow traces", "which tool calls are failing", "triage my agent". Not for offline experiment results (use evaluate or compare) and not for root-causing one trace (use explain).
compatibility: Tested with Claude Code; works with any Agent Skills-compatible host (Cursor, VS Code Copilot, Codex). Requires a Python or TypeScript project with Opik configured and a project that has traces. Install the `opik` skill alongside this one — it holds the shared SDK and observability references; without it, this skill falls back to the public docs.
allowed-tools:
  - Read
  - Grep
  - Glob
  - Bash
metadata:
  last_updated: "2026-09-09"
  source_commit: "2.0.0"
  argument-hint: "[optional: project name, or what to look for]"

Diagnose — Surface the Traces Worth Attention

**Definition of done:** a **ranked shortlist** of the online/production traces (and Diagnostics issues) worth attention, each carrying the **signal that flagged it** and its **trace id**, scoped to a project and a recent window, and ready to hand to `/opik-explain`. "Worth attention" means errored, slow, regressed, or low online-eval score — not a dump of every trace, and never offline experiment results. If the project can't be read, stop at the first genuine blocker and return one next step.

Operate: **rank by real signal over live data, surface the few things worth a look, hand the top one to `/opik-explain` — and change no code.** This skill is read-only by design.

Inputs

The entry point is `/opik-diagnose` (the current project), `/opik-diagnose <project>`, or `/opik-diagnose <what to look for>` (e.g. "slow traces", "errors today"). Infer the rest; treat these as **optional overrides**:

  • project (default: inferred from config/repo) · window (default: recent) · signal focus (default: all — errors, latency, regressions, low scores) · shortlist size (default: a handful).

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

Activation — the only in-scope work

1. Resolve scope

Project (from config/repo) + a recent window. Confirm Opik is reachable: if `~/.opik.config` exists or `OPIK_API_KEY` is set, use it. Otherwise → **Blocker** ("run `opik configure`, then rerun").

2. Read the project once, for the shape of the week

**With the Opik MCP connected**, `read('project', <name or id>)` costs one call and answers three things the rest of this skill would otherwise guess: whether anything is wrong at all (error rate and latency against the previous 7 days — a flat week is worth saying so and stopping), which score names the project actually records (the ones worth filtering on later; guessing a name returns an empty result that reads like good news), and what the project contains.

A rate reported as `null` means no traces in the window, not a healthy zero. If the window is quiet, widen it with `since="30d"` before concluding anything.

3. Start from Diagnostics issues

Opik's Diagnostics already groups a project's recurring failures into ranked issues, each with a severity, occurrence counts, a cause, a suggested fix and example traces. Read that list first — it is the answer to "what is broken" the UI already computed, so do not rebuild it from raw traces.

**With the Opik MCP connected**, the `agent_insights_issue` entity is the primary path:

list('agent_insights_issue', project_name='<project>')        # open issues, ranked as the Diagnostics page ranks them
read('agent_insights_issue', '<issue id>', project_name='<project>')
#  → {issue: {name, cause, suggested_fix, severity, status, …}, example_trace_ids: [...], details: [...],
#     url: '<the issue's Diagnostics page>', trace_url_template: '<…/logs?trace={trace_id}>'}

Each open issue becomes one shortlist item with `signal=diagnostics`: `trace_id` comes from the first `example_trace_ids` entry (read the top few issues to get them) and `trace_url` from `trace_url_template` with that id filled in; mention the issue's `url` so the user can open the Diagnostics page itself. `why` carries the issue name, severity, `latest_count` and the cause. The link fields are absent when the server cannot name the UI base or workspace — fall back to the trace link template from the session instructions then (step 6). Keep the list's order — it is the Diagnostics page's ranking (most recently seen first, then most occurrences). Counts are all-time to match the UI; pass `since` (e.g. `"7d"`) to narrow to the window.

**An empty list is not an all-clear.** It says which case it is, and what to do about it. Act on the sentence you get:

| The list says | Do this | | --- | --- | | no open issues, last scan `<time>` | Diagnostics is working and found nothing. Continue to step 3. | | enabled but has not scanned yet, or last scan older than a day | `write('agent_insights_job.trigger', {"project_name": "<project>"})`, report the Diagnostics page link, continue to step 3. No need to ask: a scan changes no data. | | not enabled for this project, or turned off | Ask the user once, in one sentence: "Enable daily Diagnostics for `<project>`? First results take a few minutes." On yes: `enable`, then `trigger`, report the link, continue. On no: continue and say the shortlist was built without Diagnostics. | | not available on this deployment | Continue, and say once that

Read more
@comet-ml
Ships withopik

Log Claude Code sessions to Opik for LLM observability, plus skills and agents for building observable AI applications. Opik is the open-source LLM observability and evaluation platform, built by Comet.

2510 skills1 agent
Get the whole plugin

Stars on GitHub

Momentum

stars in total
25
Star history of comet-ml/opik-claude-code-plugin on GitHub, a chart by star-history.com

Other skills on opik.

opik-compare

opik-compare

Run a candidate against the baseline over an Opik test suite and read the numbers back — which cases broke, which got fixed, the…

@comet-ml@comet-mlInstall Skill
opik-evaluate

opik-evaluate

Build an LLM evaluation and run it against the app, returning an Opik experiment with scores and its link. Picks a test suite…

@comet-ml@comet-mlInstall Skill
opik-explain

opik-explain

Root-cause a specific Opik trace, or a pattern across traces, and return a grounded explanation. Uses the hosted Opik MCP when it…

@comet-ml@comet-mlInstall Skill
opik-instrument

opik-instrument

Add Opik tracing to an existing app and verify a real trace lands. Installs the Opik package, detects the language and LLM…

@comet-ml@comet-mlInstall Skill
opik-online-eval

opik-online-eval

Take a judge live on production traffic — create an Opik online evaluation rule (LLM-as-judge or Python metric) on a project with…

@comet-ml@comet-mlInstall Skill
opik-optimize

opik-optimize

Improve a prompt with the Opik Agent Optimizer — resolve the prompt, a dataset, and a metric, pick the algorithm, run a bounded…

@comet-ml@comet-mlInstall Skill

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills2w309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc2w293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react5d252k
@facebook@facebookInstall Skill

Questions about opik-diagnose.

Which coding agents can use opik-diagnose?
opik-diagnose installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.