Adds Opik tracing to an existing Python or TypeScript app, runs a safe representative path, and verifies a real trace lands in Opik. Detects language and LLM framework automatically.
Ships in opik. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Definition of done: a representative, safely-executed path produces a trace that is confirmed in Opik and a direct trace link is returned. If verification can't be completed safely or autonomously, stop at the first genuine blocker and return exactly one concrete next step. Code edits alone are not success.
Operate: opinionated in execution, conservative in code changes, automatic in routine decisions, uncompromising about verifying value — but never by running something unsafe.
The entry point is just /opik-instrument (optionally /opik-instrument <path>). Infer everything else; treat these only as optional overrides the user may pass, never as required setup:
migrate_prompts (default: false).Never turn inference into a questionnaire. Ask only when you hit a genuine, non-inferable blocker (see Blockers).
~/.opik.config exists or OPIK_API_KEY is set, use it as-is.opik configure (Python) / npx opik-ts configure (TypeScript).opik healthcheck — it validates the config, the install, and backend/workspace reachability. If it fails, stop at that Blocker and fix config or connectivity before adding any tracing..env vars if the project already uses that pattern. Never introduce a second config mechanism; never copy secret values between mechanisms.Python (*.py, pyproject.toml) or TypeScript (*.ts, package.json). Identify the LLM framework from imports and pick its integration:
| Import | Integration |
|---|---|
openai / anthropic | track_openai / track_anthropic |
langchain / langgraph | OpikTracer callback |
crewai / dspy / google-genai / bedrock / llama_index / litellm | track_crewai / OpikCallback / track_genai / track_bedrock / LlamaIndexCallbackHandler / OpikLogger |
TS: opik-openai / opik-vercel / opik-langchain | trackOpenAI / OpikExporter / OpikCallbackHandler |
Full list: read ../opik/references/integrations.md (the opik skill, installed beside this one). If that file isn't there, read https://www.comet.com/docs/opik/integrations/overview — never settle for manual spans on a framework that has a native integration just because the reference was unreachable. If the project is already instrumented, audit and add only what's missing — do not re-instrument.
Decision policy, in order:
@opik.track spans only for orchestration/tools the integration doesn't cover (type="tool" / "llm" / "guardrail"). A bare @opik.track produces the default span type, general — the right choice for an entrypoint/orchestrator.@opik.track(type="llm") on top of track_openai).@app.route) is framework-dependent — verify per framework; do not assume a universal order.opik.flush_tracker() / await client.flush()). LiteLLM inside @opik.track: pass metadata={"opik": {"current_span_data": get_current_span_data()}} or traces orphan.Make the smallest change that lets one representative path emit a trace.
Add only the required Opik package(s) via the repo's detected package manager (pip / uv / poetry / npm / pnpm / yarn), through normal project conventions. Preserve the lockfile; do not run generic upgrades; do not install globally; treat unusual lifecycle scripts cautiously. Surface it as a change (e.g. "added opik to pyproject.toml"). If the environment blocks installation → Blocker with the one exact command.
Infer a safe command — prefer an existing test, example, or dev script, then a bounded single-request entrypoint. Never run anything that looks like production or does irreversible/expensive work (writes, emails, purchases, mass API calls). If no safe path is inferable → Blocker ("which dev command safely exercises this agent?"). Print the command, then run it.
If the run needs an LLM provider credential (e.g. OPENAI_API_KEY) and it's absent, that's a Blocker — the app can't produce a trace. Note some SDK clients raise at construction (module load), before any span runs, so there is no partial trace to wait on: return blocked with the one next step, don't wait on a flush that never happened.
Confirm a trace actually arrived — don't assume. Prefer the SDK for verification: it's already installed as part of instrumenting (zero extra moving parts), whereas the Opik MCP is optional and may not be connected.
The SDK read of one trace and its spans: references/verify-ingestion.md (SDK check).
To find the newest trace instead of using a known id, use the client's trace search (e.g. search_traces) scoped to the project. Optionally, if the Opik MCP is connected, list recent traces then read the newest.
Traces are asynchronous — allow a few seconds after the run and make sure the flush ran.
Verify coverage, not just arrival. A trace arriving is necessary but not sufficient — batching can silently drop or truncate spans, so a trace can land incomplete and still look fine. Before reporting verified:
len(spans) (the search_spans call in references/verify-ingestion.md, project_name included) against the call sites you instrumented on the path you ran (entrypoint + each traced tool/LLM). Fewer spans than expected means spans were dropped — do not report verified.name and type; LLM spans carry input/output (and usage where the integration provides it). A span returned with an empty name/type is the batching-race symptom in references/verify-ingestion.md, not a real span.With the Opik MCP connected, verify there instead. read(entity_type="trace", id=tid) returns {trace, spans, spansTruncated} with the span tree inlined (up to 200 spans), so both checks above run over that one call, no script needed: count the spans against the instrumented call sites, and confirm each has a name/type and the LLM spans carry input/output. If spansTruncated is true, count with the SDK instead. The SDK stays the default because it is already installed; the MCP is the shortcut when it is there.
If the trace is empty, partial, or has unnamed spans, check references/verify-ingestion.md (Common ingestion traps) before changing the instrumentation.
Return a short human result + the trace link (see Output), then make the single expansion offer.
When you genuinely can't proceed, stop at the earliest blocker and return exactly one next step — never a checklist — and still report the changes already made (blocked carries changes). An unsupported language or shape is unsupported and modifies nothing. Examples:
opik configure, then rerun /opik-instrument."uv sync, then rerun /opik-instrument."OPENAI_API_KEY (or the relevant provider key) and rerun."<id> arrived."Do not migrate prompts, add threading, or broaden spans during activation. After verification, make a single consolidated offer of what you found, e.g.:
Tracing is verified. I also found ways to deepen it: 3 Prompt Library candidates, missing conversation threading, and 2 untraced tools. Expand?
When you add threading and the app already knows its stage (e.g. an APP_ENV or NODE_ENV value), set environment on the traces too, or OPIK_ENVIRONMENT. A thread takes the environment of its first trace, so every turn must use the same value. Never encode the stage in tags or metadata.
User-facing: a short human message — what was instrumented, the trace link, and the one expansion offer (or, if blocked, the single next step plus what changed). Not raw JSON.
Underneath (for composition / evals), a small state model, with its invariants: references/output-shape.md.
Worked runs (no LLM framework, OpenAI, already instrumented): references/examples.md.
Double-wrapping (integration + manual span on the same call); orphaned LiteLLM traces (missing current_span_data); missing flush in scripts; overwriting or duplicating config; running an unsafe/production path just to force a trace; broad dependency upgrades when only opik is needed; migrating prompts during activation.
SDK detail lives in the opik skill, installed beside this one. Read the files directly — paths are relative to this file: ../opik/references/tracing-python.md, ../opik/references/tracing-typescript.md, ../opik/references/integrations.md, ../opik/references/observability.md. If your host lays skills out differently, locate the opik skill's references/ directory.
If the opik skill isn't installed, say so in the report and use https://www.comet.com/docs/opik/ rather than working from memory.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
2 plugins in one repository ship this exact skill · first indexed Oct 28, 2026
11 skills in this plugin
/opikReference for the Opik SDK — tracing, span types, framework integrations, threads, and the prompt library (Python, TypeScript, REST). Use for "what span types exist", "how do I flush", "track_openai", "add OpikTracer", "version a prompt". To instrument a repo end to end, use the `opik-instrument` skill./opik-annotateSet up human review in Opik — create an annotation queue for a project's traces or threads and give it a custom annotator view, an HTML page that shows annotators each item the way they need to judge it (the email beside the reply, the conversation as chat bubbles) instead of raw JSON. Writes through the Opik MCP when connected, the Opik SDK otherwise. Returns the queue, its link, and what annotators will see. Use for "build a custom annotator view", "set up an annotation queue", "make the review queue show the email and the reply side by side", "change what annotators see", "remove the custom view". Not for automatic scoring (use online-eval) or for finding which traces to review (use diagnose)./opik-compareRun a candidate against the baseline over an Opik test suite and read the numbers back — which cases broke, which got fixed, the per-metric deltas, worst rows, and whether the two runs are comparable — with the Opik compare-view link. Runs via the SDK; reads results via the MCP when connected. Does not issue a ship/no-ship verdict. Use for "did my fix work", "compare against the baseline", "run the regression suite", "why did quality drop", "which cases regressed", "compare these two experiments". Not for the ship/hold decision itself (use verify), live production triage (use diagnose), building an evaluation from scratch (use evaluate), or capturing a single case (use test)./comet-ml-opik-src-opik-mcp:opik-instrumentfrom opik
Generated from the plugin's indexed repository (comet-ml/opik-mcp) — no native marketplace selected
npx claudepluginhub p/comet-ml-opik-src-opik-mcpOther plugins' skills for the same job