gepa

gepa is a skill for Claude Code from skillberry-ai/cap-evolve. It costs 111 tokens per session (2,630 once invoked), scanned A, original, Apache-2.0.

An optimization method called GEPA that searches for better AI-agent instructions using feedback from evaluation runs; its paper is identified as arXiv:2507.19457.

In plain words
What is it for?
Running reflective search where proposals pass through a cheaper training check and then a validation gate, while retaining useful task-specific candidates.
Why use it?
It preserves candidates that perform well on different individual tasks instead of keeping only the one with the best average score.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

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.

agentmods
npx agentmods add skills/skillberry-ai/cap-evolve/gepa
Any agent
npx skills add skillberry-ai/cap-evolve --skill gepa
Clone the repo
git clone --depth 1 https://github.com/skillberry-ai/cap-evolve

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 gepa

README.md
[![agentmods](https://agentmods.dev/badge/skills/skillberry-ai/cap-evolve/gepa.svg)](https://agentmods.dev/skills/skillberry-ai/cap-evolve/gepa)
Your own site
<a href="https://agentmods.dev/skills/skillberry-ai/cap-evolve/gepa"><img src="https://agentmods.dev/badge/skills/skillberry-ai/cap-evolve/gepa.svg" alt="Measured on agentmods" height="20"></a>
Per session 111 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,630 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00111 $0.02630
Opus 5 $0.00056 $0.01315
Sonnet 5 $0.00022 $0.00526
Haiku 4.5 $0.00011 $0.00263

Measured 6d ago against content hash 962bd00bb617, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

gepa 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 6d ago.

The scan reads SKILL.md. This mod also ships 4 executable files (scripts/_bootstrap.py, scripts/abstract.py, scripts/check.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.

skills/algorithms/gepa/SKILL.md · 173 lines

How it starts

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

algorithms/hill-climb owns the mechanics every algorithm shares: parent → proposal → val gate → commit, specified once in algorithms/hill-climb/references/run-step.md. Read that first. This page states only what GEPA (Agrawal et al., 2025) does differently, and why those differences are the paper's actual contribution rather than decoration. A thin wrapper over cap_evolve.gepa.gepa_loop.

The two mechanisms, and why removing either turns GEPA back into hill-climb

1. The parent is sampled from per-instance winners, not from the global best. A mean is a lossy summary. A candidate that fixes one genuinely hard task while regressing three easy ones has a worse mean than the incumbent, so a best-parent rule discards it — and with it the only text in the pool that has ever solved that task. GEPA instead scores per val instance and samples frequency-weighted over candidates that (co-)win at least one, so specialists and stepping-stones stay reachable as parents while their mean is still behind. That is the quality-diversity argument (MAP-Elites): keep the set that covers the task distribution, not the single champion. Sampling is stochastic and seeded, so the exploration is reproducible.

2. A cheap train minibatch pre-gates the expensive val evaluation. Rollouts dominate cost and a full-val eval costs |val| · n_trials of them. Most proposals are bad; paying full price to find that out is what makes naive reflective search unaffordable, and GEPA's headline "~35× fewer rollouts" comes almost entirely from not paying it. So parent and child are evaluated on the same small train minibatch (2 · minibatch-size rollouts, eval-cached) and the child is dropped unless sum(child) > sum(parent). The minibatch never decides acceptance — it decides whether acceptance is worth measuring.

A side benefit of (2): reflection reads train traces, so the proposer never sees the split its gate is computed on.

Read the full file on GitHub · 173 lines

Files

What ships with it

6 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. 6d ago First seen · 173 lines · 111 tokens per session scan A 962bd00bb617

Subscribe to this mod's changes

gepa is a skill published in the GitHub repository skillberry-ai/cap-evolve (50 stars, last pushed yesterday), licensed Apache-2.0. It adds 111 tokens to every session and 2,630 once invoked, about $0.0006 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

prompt-writing

Create, refine, and optimize high-quality YAML prompts for AI assistants. Use when working with prompt templates, system prompts, agent prompts, or any prompt engineering tasks. Provides structure guidelines, template patterns, and quality standards for YAML-based prompts.

ModelEngine-Group/nexent · 51 tokens

ax-gen

This skill helps an LLM generate correct AxGen code using @ax-llm/ax. Use when the user asks about ax(), AxGen, generators, forward(), streamingForward(), validation, assertions, streaming assertions, field processors, step hooks, self-tuning, or structured outputs. For MCP clients, transports, prompts, resources…

ax-llm/ax · 86 tokens

ax-signature

This skill helps an LLM generate correct DSPy signature code using @ax-llm/ax. Use when the user asks about signatures, s(), f(), field types, string syntax, fluent builder API, validation constraints, or type-safe inputs/outputs.

ax-llm/ax · 57 tokens

ax-llm

This skill helps with using the @ax-llm/ax TypeScript library for building LLM applications. Use when the user asks about ax(), ai(), f(), s(), agent(), flow(), AxGen, AxAgent, AxFlow, signatures, streaming, or mentions @ax-llm/ax.

ax-llm/ax · 68 tokens

ax-playbook

This skill helps an LLM generate correct playbook code using @ax-llm/ax. Use when the user asks about playbook(), AxPlaybook, context playbooks, evolving context, ACE / Agentic Context Engineering, agent.playbook(), or growing/applying task knowledge offline and online with evolve() and update().

ax-llm/ax · 70 tokens

ax-refine

Use this skill when writing or reviewing Ax bestOfN/refine code, reward functions, thresholds, native sample selection, serial attempts, generated advice, and attempt diagnostics.

ax-llm/ax · 38 tokens