opik: Skill for Claude Code

.agents/skills/python-sdk/SKILL.md

python-sdk is a skill for Claude Code, Codex from comet-ml/opik. It costs 28 tokens per session (687 once invoked), scanned A, original, Apache-2.0.

A set of coding rules for the Opik Python SDK, the package that lets Python programs send data to Opik. It covers the public API, background message handling, HTTP communication, and integrations.

In plain words
What is it for?
Use it when changing Python SDK APIs, integrations, message processing, dataset or prompt operations, or trace and feedback logging.
Why use it?
It clarifies which operations run in the background, when data must be flushed before a program exits, and how optional integrations should be imported.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

This is comet-ml/opik's own configuration. It tells Claude Code and Codex how to work on opik itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything opik configures →

About the project

Opik is an open-source platform for tracing, evaluating, and monitoring applications that use large language models, retrieval systems, or AI agents. Teams use it to inspect agent activity, manage prompts, run evaluations, and monitor these applications in production.

comet-ml/opik · 22,998 stars · on GitHub · comet.com

Reuse

Borrowing it

Nothing to install: this file belongs to comet-ml/opik. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/comet-ml/opik/main/.agents/skills/python-sdk/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/comet-ml/opik

Made for: Claude Code, Codex.

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 python-sdk

README.md
[![agentmods](https://agentmods.dev/badge/skills/comet-ml/opik/python-sdk/github.svg)](https://agentmods.dev/skills/comet-ml/opik/python-sdk)
Your own site
<a href="https://agentmods.dev/skills/comet-ml/opik/python-sdk"><img src="https://agentmods.dev/badge/skills/comet-ml/opik/python-sdk/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 python-sdk

Your own site · 80×15
<a href="https://agentmods.dev/skills/comet-ml/opik/python-sdk"><img src="https://agentmods.dev/badge/skills/comet-ml/opik/python-sdk.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 28 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 687 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. Third-party audits
  • Snyk pass 7 Sept 2026
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found 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.00028 $0.00687
Opus 5.5 $0.00011 $0.00275
Sonnet 5.5 $0.00006 $0.00137
Haiku 4.5 $0.00003 $0.00069

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

Security

Grade A, and why

python-sdk 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 2mo 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.

.agents/skills/python-sdk/SKILL.md · 109 lines

How it starts

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

Python SDK

Three-Layer Architecture

Layer 1: Public API      (opik.Opik, @opik.track)
    ↓
Layer 2: Message Processing   (queue, batching, retry)
    ↓
Layer 3: REST Client     (OpikApi, HTTP)

Critical Gotchas

Flush Before Exit

# ✅ REQUIRED for async operations
client = opik.Opik()
# ... tracing operations ...
client.flush()  # Must call before exit!

Async vs Sync Operations

Async (via message queue) - fire-and-forget:

  • trace(), span()
  • log_traces_feedback_scores()
  • experiment.insert()

Sync (blocking, returns data):

  • create_dataset(), get_dataset()
  • create_prompt(), get_prompt()
  • search_traces(), search_spans()

Lazy Imports for Integrations

# ✅ GOOD - integration files assume dependency exists
import anthropic  # Only imported when user uses integration

# ❌ BAD - importing at package level
from opik.integrations import anthropic  # Would fail if not installed

Integration Patterns

Pattern Selection

Library has callbacks? → Pure Callback (LangChain, LlamaIndex)
No callbacks?         → Method Patching (OpenAI, Anthropic)
Callbacks unreliable? → Hybrid (ADK)

Method Patching (OpenAI, Anthropic)

from opik.integrations.anthropic import track_anthropic

client = anthropic.Anthropic()
tracked_client = track_anthropic(client)  # Wraps methods

Callback-Based (LangChain)

from opik.integrations.langchain import OpikTracer

tracer = OpikTracer()
chain.invoke(input, config={"callbacks": [tracer]})

Decorator-Based

@opik.track
def my_function(input: str) -> str:
    # Auto-creates span, captures input/output
    return process(input)

Dependency Policy

  • Avoid adding new dependencies
  • Use conditional imports for integrations
  • Keep version bounds flexible: >=2.0.0,<3.0.0

Batching System

Messages batch together for efficiency:

  • Flush triggers: time (1s), size (100), memory (50MB), manual
  • Reduces HTTP overhead significantly

Read the full file on GitHub · 109 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 2mo ago First seen · 109 lines · 28 tokens per session scan A dababc1e6171

Subscribe to this mod's changes

python-sdk is a skill published in the GitHub repository comet-ml/opik (22,998 stars, last pushed today), licensed Apache-2.0. It adds 28 tokens to every session and 687 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.