optimize

optimize is a skill for Claude Code from CyrusNuevoDia/gepa-research. It costs 52 tokens per session (1,518 once invoked), scanned A, original, Apache-2.0.

An automated search that repeatedly changes a target file and tests each version using the GEPA optimization method. Each attempt runs separately so failed changes do not affect the main project.

In plain words
What is it for?
Use it to optimize a file against a benchmark or evaluator, with checks enforced for every proposed version and the results saved for later review.
Why use it?
It removes the need to manually try many changes and compare results. The search stops when it reaches its evaluation budget or stops improving.

Skill for Claude Code

Written for Claude Code: argument-hint in frontmatter. Also seen: mentions subagents; mentions Codex; $skill-name invocation.

Part of the gepa-research plugin — 2 skills shipped together

Good fit Use it to optimize a file against a benchmark or evaluator, with checks enforced for every proposed version and the results saved for later review.

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

Made for: Claude Code.

Or install gepa-research, the plugin that ships this one along with the rest of its 2 skills.

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 optimize

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/cyrusnuevodia/gepa-research/optimize"><img src="https://agentmods.dev/badge/skills/cyrusnuevodia/gepa-research/optimize.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 52 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,518 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.00052 $0.01518
Opus 5 $0.00026 $0.00759
Sonnet 5 $0.00010 $0.00304
Haiku 4.5 $0.00005 $0.00152

Measured 11d ago against content hash 114c5ba12bbb, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

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 11d 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.

plugins/gepa-research/skills/optimize/SKILL.md · 133 lines

How it starts

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

Run the GEPA-backed optimization loop. The plugin calls gepa.optimize_anything under the hood; each candidate it proposes is applied in a fresh git worktree, the benchmark is run, gates are checked, and the result is backported into .gepa-research/<run>/graph.json so the dashboard continues to render the lineage DAG.

Host conventions

  • Slash commands shown in user-facing copy (e.g. /gepa-research:optimize) — translate to your host's mention syntax when speaking to the user (e.g. $gepa-research optimize on Codex — plugin namespace then skill name, separated by a space).

Configuration

All arguments are optional. Invoked as /optimize [max-metric-calls=N] [stall=N] [reflection-lm=MODEL].

  • max-metric-calls — GEPA evaluator-call budget for this run (default: 50).
  • stall — consecutive iterations without improvement before auto-stopping (default: 5).
  • reflection-lm — model string passed to ReflectionConfig.reflection_lm (default: gepa's default, currently openai/gpt-5.1). Use e.g. anthropic/claude-opus-4-7 for Claude.

The legacy subagents, budget, and per-subagent knobs are no longer accepted — GEPA owns the search strategy.

Prerequisites

  • Workspace must be initialized (gepa-research status should succeed).
  • A baseline experiment must be committed (run /discover first). GEPA's seed candidate is read from the current best committed node's target file.
  • The gepa library on the Python path (auto-installed as a transitive dependency when the CLI is installed from GitHub: uv tool install "git+https://github.com/CyrusNuevoDia/gepa-research#subdirectory=plugins/gepa-research").
  • A reflection LM API key in the environment (OpenAI/Anthropic/etc., depending on the reflection-lm value). Without this the first GEPA iteration will fail.

Architecture

Orchestrator (this skill):
  1. Reads current best committed node from .gepa-research/<run>/graph.json
  2. Extracts seed_candidate: {target_relpath: file_contents}
  3. Calls gepa.optimize_anything(seed, evaluator=adapter.evaluate,
                                  objective=config["optimization_objective"],
                                  config=GEPAConfig(stop_callbacks=...))
  4. Reports the final best candidate and updates the graph

GepaResearchAdapter.evaluate (called by gepa per candidate):
  a. allocate_experiment(parent_id=best_committed)
     -> creates .gepa-research/<run>/worktrees/exp_NNNN and a fresh branch
  b. write candidate dict contents into the worktree
  c. run config["benchmark"] as subprocess; parse_score from stdout
  d. run inherited gates (collect_gates_from_path)
     -> on failure, return (0.0, {"gate_failures": [...], "traces": ...})
  e. on score improvement + all gates pass: maybe_commit_worktree + mark "committed"
  f. return (score, side_info) so gepa can reflect on stdout/stderr/traces

Read the full file on GitHub · 133 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. 11d ago First seen · 133 lines · 52 tokens per session scan A 114c5ba12bbb

Subscribe to this mod's changes

optimize is a skill published in the GitHub repository CyrusNuevoDia/gepa-research (100 stars, last pushed 4mo ago), licensed Apache-2.0. It adds 52 tokens to every session and 1,518 once invoked, about $0.0003 per session on Opus 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.

Related

Other skills, from other repositories

autocontext-consumer

Use when an agent needs to USE knowledge Autocontext already produced - find which scenarios have knowledge, read the playbook and lessons for one, understand the on-disk file and folder layout, and move knowledge between checkouts. Host-agnostic; requires only the autoctx CLI and the filesystem.

greyhaven-ai/autocontext · 67 tokens

autocontext-creator

Use when an agent needs to CREATE knowledge with Autocontext - run a scenario or plain-language task through the improvement loop, judge or improve a single output, and inspect what the run produced. Host-agnostic; requires only the autoctx CLI.

greyhaven-ai/autocontext · 57 tokens

create-notes

Write a note to {shareddir}/notes/ that future agents can actually act on. Use after every coral eval, when a heartbeat (reflect / consolidate / pivot) asks for a note, or when you discover a grader / build / runtime issue that future agents will hit. Covers 4 note variants (experiment / infra / focus / synthesis)…

Human-Agent-Society/CORAL · 217 tokens

deep-research

Research the problem domain before coding. Web search for techniques, save raw sources, write structured findings, update the index.

Human-Agent-Society/CORAL · 28 tokens

skill-creator

Autonomously create, test, and optimize skills by detecting reusable patterns in your own work. Use when you notice repeated tool sequences, recurring code patterns across attempts, or insights that should be captured as a packaged skill. Also use to benchmark and iterate on existing skills.

Human-Agent-Society/CORAL · 58 tokens

arbor-agent-setup-intake

Setup, intake, preflight, and launch-contract phase for open-source Arbor runs. Use when confirming a target project, metric, baseline, dev/test split, config/plugin settings, branch guard, session directory, or when translating a user goal into the precise contract consumed by the coordinator.

RUC-NLPIR/Arbor · 65 tokens