opik-optimize

opik-optimize is a skill for Claude Code from comet-ml/opik-mcp. It costs 143 tokens per session (2,445 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: shipped in a Claude Code plugin. Also seen: mentions Claude Code; mentions Codex.

Part of the opik plugin — 11 skills, 1 MCP server shipped together

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.

Or install opik, the plugin that ships this one along with the rest of its 11 skills, 1 MCP server.

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,445 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.02445
Opus 5.5 $0.00057 $0.00978
Sonnet 5.5 $0.00029 $0.00489
Haiku 4.5 $0.00014 $0.00245

Measured 5d ago against content hash 7235bca14e3a, 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 5d 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

Copies of this mod

2 near-identical copies found in the catalogue:

plugins/opik/skills/opik-optimize/SKILL.md · 95 lines

How it starts

The opening of the file, as written. The whole thing — 95 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 · 95 lines

Files

What ships with it

3 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. 5d ago Changed · -6 lines 7235bca14e3a
  2. 2mo ago Changed · -51 lines 7ccac054c38d
  3. 2mo ago Changed · +9 lines 6c2dc7409480
  4. 2mo ago Changed 008305d6028f
  5. 2mo 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 (227 stars, last pushed 4d ago), licensed Apache-2.0. It adds 143 tokens to every session and 2,445 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

opik-optimize compared with skills from other repositories

opik-optimize next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
opik-optimizecomet-ml/opik-mcpSkill2274d agoApache-2.0A143Claude Code
local-delegationZahiriNatZuke/local-delegateSkill8todayMITA138Claude Code, Codex
add-promptcyanheads/pubmed-mcp-serverSkill1726d agoApache-2.0A37Claude Code
add-promptcyanheads/ntfy-mcp-serverSkill272d agoApache-2.0A37Claude Code
openclaw-prompt-enhanceryedanyagamiai-cmd/openclaw-mcp-serversSkill48mo agoMITA137Claude Code, Codex
opik-optimizecomet-ml/opik-skillsSkill9yesterdayApache-2.0A143Claude Code
add-promptcyanheads/openalex-mcp-serverSkill1812d agoApache-2.0A37Claude Code