opik-optimize

opik-optimize is a skill for Claude Code from comet-ml/opik-mcp. It costs 143 tokens per session (2,478 once invoked), scanned A, original, Apache-2.0.

A prompt-optimization tool for Opik, a platform for evaluating AI applications. It tests a prompt against a dataset and metric, searches for an improved version within a stated budget, and checks the result on held-out data that was not used for tuning.

In plain words
What is it for?
It measures a baseline, runs bounded prompt optimization, evaluates the winner on held-out data, reports the cost and run link, and saves a new prompt version when the prompt is in Opik's library.
Why use it?
It helps distinguish a prompt that genuinely improves from one that only memorizes its training examples. It also records the winning version and the optimization run for later review.

Skill for Claude Code

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

Good fit It measures a baseline, runs bounded prompt optimization, evaluates the winner on held-out data, reports the cost and run link, and saves a new prompt version when the prompt is in Opik's library.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/comet-ml/opik-mcp/opik-optimize
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-mcp --skill opik-optimize
Clone the repo
git clone --depth 1 https://github.com/comet-ml/opik-mcp

Made for: Claude Code.

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-optimize

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/comet-ml/opik-mcp/opik-optimize"><img src="https://agentmods.dev/badge/skills/comet-ml/opik-mcp/opik-optimize.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 143 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,478 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 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.00143 $0.02478
Opus 5.5 $0.00057 $0.00991
Sonnet 5.5 $0.00029 $0.00496
Haiku 4.5 $0.00014 $0.00248

Measured 14d ago against content hash 7ccac054c38d, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

opik-optimize 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 14d ago.

The scan reads SKILL.md. This mod also ships 4 executable files (evals/fixtures/format/seed.py, evals/grader.py, evals/metrics.py, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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

Copies of this mod

2 near-identical copies found in the catalogue:

src/opik_mcp/skills/opik-optimize/SKILL.md · 101 lines

How it starts

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

Optimize — Improve a Prompt Against Data

Definition of done: an optimized prompt whose score on the metric beats the baseline on data it was not tuned on, the optimization run link in Opik, the cost of getting there, and the winner saved as a new prompt version (when the prompt lives in the library) — with the swap into code left as the next step. If the optimization can't run within a stated budget, stop at the first genuine blocker and return exactly one next step. A prompt that scores higher only on its own training items is not an improvement.

Operate: measure the baseline first, state the budget before spending it, hold data out, pick the algorithm for the failure you see, save the winner where it can be versioned — and change no application code. The only file this skill writes is a runner outside the repo; the prompt is saved to Opik, not into the codebase.

Inputs

The entry point is /opik-optimize <prompt-name> (a prompt-library prompt), /opik-optimize <path or function> (a prompt in code), or /opik-optimize (find the system prompt in this repo). Infer the rest; treat these as optional overrides:

  • dataset (default: existing dataset for the project → export the regression suite → build from traces) · metric (default: heuristic on expected_output if present, else one binary judge) · algorithm (default: MetaPromptOptimizer) · budget (default: n_samples=50, max_trials=10) · model · validation split (default: hold out 20%).

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

Activation — the only in-scope work

1. Resolve the prompt

  • Library: client.get_chat_prompt(name) (or get_prompt for a text prompt). Note the current version — that is the baseline.
  • Code: grep for the system prompt / messages=[...]; read it verbatim. Note where it lives; you will not edit it.
  • Trace: the llm span's input.messages on a representative trace.

The optimizer's opik_optimizer.ChatPrompt is a different class from the library's opik.ChatPrompt — build it from the raw messages yourself: references/sdk-snippets.md (Resolve the prompt).

Read the full file on GitHub · 101 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. 14d ago Changed · -51 lines 7ccac054c38d
  2. 19d ago Changed · +9 lines 6c2dc7409480
  3. 22d ago Changed 008305d6028f
  4. 26d ago First seen · 143 lines · 143 tokens per session scan A c5f7241f75fe

Subscribe to this mod's changes

opik-optimize is a skill published in the GitHub repository comet-ml/opik-mcp (222 stars, last pushed 6d ago), licensed Apache-2.0. It adds 143 tokens to every session and 2,478 once invoked, about $0.0006 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-09-18.

Related

Other skills, from other repositories

local-delegation

Regla y catálogo para delegar pasos mecánicos (resumir, clasificar, extraer, boilerplate, mensaje de commit desde un diff, traducir texto o archivo, resumir salida de lint/tests/CI, explicar código, describir una imagen, verificar si el backend local está disponible) a modelos locales vía las tools local del MCP…

ZahiriNatZuke/local-delegate · 138 tokens

add-prompt

Scaffold a new MCP prompt template. Use when the user asks to add a prompt, create a reusable message template, or define a prompt for LLM interactions.

cyanheads/pubmed-mcp-server · 37 tokens

openclaw-prompt-enhancer

Remote prompt engineering MCP server with 6 tools that turn weak prompts into powerful ones. Use when: (1) 'improve this prompt' or 'make my prompt better', (2) 'score this prompt' or 'rate prompt quality', (3) 'convert prompt to Claude format' or 'translate for Gemini', (4) 'generate system prompt' or 'create…

yedanyagamiai-cmd/openclaw-mcp-servers · 137 tokens

add-prompt

Scaffold a new MCP prompt template. Use when the user asks to add a prompt, create a reusable message template, or define a prompt for LLM interactions.

cyanheads/ntfy-mcp-server · 37 tokens

opik-optimize

Improve a prompt with the Opik Agent Optimizer — resolve the prompt, a dataset, and a metric, pick the algorithm, run a bounded optimization, check the gain on held-out data, and save the winner as a new prompt version with the optimization run link. Runs via the opik-optimizer package; reads prompts and datasets via…

comet-ml/opik-skills · 143 tokens

add-prompt

Scaffold a new MCP prompt template. Use when the user asks to add a prompt, create a reusable message template, or define a prompt for LLM interactions.

cyanheads/openalex-mcp-server · 37 tokens