GEPA optimize_anything: auto-improve prompts and code by score
gepa-ai/gepa
Your assistant learns to run GEPA's optimize_anything for you. You give it a starting text (a prompt, a piece of code, a config) and a way to score it. An AI model then proposes better versions and keeps the best one. The skill teaches the assistant how to set the run up, how big a budget to give it and which mistakes to avoid.
Pack description by its author: “Your assistant learns to run GEPA's optimize_anything for you. You give it a starting text (a prompt, a piece of code, a config) and a way to score it. An AI model then proposes better versions and keeps the best one. The skill teaches the assistant how to set the run up, how big a budget to give it and which mistakes to avoid.”
Software engineeringKnowledge and rules for your assistantGives your assistant new abilities with scripts
1. Changes your files
Skills that write or edit files: gepa-optimize-anything.
github.com/gepa-ai/gepa/blob/ce5b0d6/2. Runs code on your machine
Install: A skill file, four reference files and one Python script. No hooks. Before a run (preflight.py): Checks that gepa imports, that a provider key is set in the environment, and that claude, jq and bwrap are on the PATH when needed. Reads environment variables only, writes nothing. With --test-lm it makes one short call to the AI model.
github.com/gepa-ai/gepa/blob/ce5b0d6/3. Sends data
Install only from github.com/gepa-ai/gepa. The skill tells the assistant to install Python and npm packages and, for two modes, to start Claude Code sessions that act on their own; keep the default sandbox on and set a dollar cap.
github.com/gepa-ai/gepa/blob/ce5b0d6/Checked against the pack's files at commit ce5b0d6, on Nov 17, 2026. Tap a verdict to see its source.How we checkedReport an error
Good for you if
- You want a prompt, code, config or agent instructions improved automatically against a score you can measure
- You can write a check that gives a number, or use an AI judge for quality, tone or style
- You want to compare several optimizers on the same task with the same scoring
Probably not for you if
- You cannot measure how good the result is: the whole method runs on a score
- You don't want to pay for AI model calls: every run calls a model with your own key
What you'll notice
- The assistant asks for a starting text, a scoring function and a budget before it launches anything
- It installs the gepa Python package and needs an AI provider key (OpenAI by default)
- It warns that the default budget of 100 scoring calls is often too small
- Results come back as the best version found, its score, and a run folder with every step
What you need
- Claude Code, Cursor, VS Code/Copilot, Codex, Gemini CLI
- Mixed, MIT license
- Two plugin commands in Claude Code, or open a clone of the repository
- An API key or account (see below)
- The free MIT library calls paid AI models with your own provider key; two optional modes also need the Claude Code command-line tool
Words on this page
- Skill
- A set of written instructions your AI assistant follows. Installing one is like giving it a playbook.
- Plugin
- A package your assistant installs that can bring skills, commands and hooks together.
- API
- A way for programs to talk to a service, usually with a key.
- CLI
- A program you run by typing commands in a terminal.
| Repository | gepa-ai/gepa · website |
|---|---|
| GitHub stars | 7,530 |
| Skills | 1 · 1 with scripts |
| Category | Software engineering |
| License | MIT |
| Last updated | Nov 21, 2026 · card checked Nov 17, 2026 at commit ce5b0d6 |
| Install counts | gepa-ai/gepa on skills.sh, Vercel's skills directory, which shows installs and security audits per skill |
gepa-ai/gepa popularity over time
What GEPA optimize_anything does
- Four pieces: the text to improve, a scoring function that returns a number plus written feedback, an optimizer, and a budget
- Three modes, picked by the data you pass: one hard problem, many related problems with one shared answer, or an answer that must work on unseen cases
- Optimizers you switch with one setting: gepa (the default, an AI reflects on feedback and rewrites), autoresearch and meta_harness (a Claude Code session does the research), and best_of_n as a simple baseline
- Budget rule: let the optimizer try about 15 to 20 versions, so size the scoring calls to the data set, and add a stop score or a dollar cap
- A checklist of traps: gaming a weak score, over-optimistic picks, noisy single samples, and a seed that is already perfect
- A preflight script that checks the package, keys and command-line tools before a long run
From the pack's SKILL.md files, summarised by AgentGid.
The skill, explained
gepa-optimize-anything
Sets up and runs an automatic improve-and-score loop on any text you can measure
You give
- A starting text (or none, with a description of the goal)
- A scoring function: text in, a number out, plus feedback
- Examples to train on and, optionally, held-out examples to pick the winner
- A goal and background rules
- A budget: number of scoring calls and/or a dollar cap, and a stop score if there is a ceiling
You get
- The best version found and its score
- A held-out test score for the seed and the final version, if you gave a test set
- A run folder with every step, plus per-call JSON, a progress log and a summary
See it in action
The skill defines what its answer looks like. Its own example:
The skill's own example (about 50 lines, in SKILL.md under "Minimal working example"): a seed prompt, an evaluate(candidate, example) function that returns a score and a feedback dict, and an optimize_anything call with dataset, valset, test_set, an objective, max_evals=300, stop_at_score=1.0 and a Claude Sonnet reflection model. It prints the best candidate, its score and the held-out test score.
When to reach for it
| You want | Use |
|---|---|
| Improve one prompt across many examples so it also works on new ones | Generalization mode: pass dataset and valset |
| Solve one hard problem such as one fast kernel or one layout | Single-task mode: no dataset |
| To see if an optimizer beats plain sampling | Run the same task with engine="best_of_n" as a baseline |
| To check keys and tools before a long run | python scripts/preflight.py (add --engine autoresearch for that mode) |
Skills in gepa-ai/gepa
| Skill | In plain words | Changes files? | What it does (author) |
|---|---|---|---|
| gepa-optimize-anything | Sets up and runs an automatic improve-and-score loop on any text you can measure | Yes | Automatically improve any text artifact that can be scored — prompts, programs/code, configs, specs, regex/SQL/schemas, agent scaffolds, or encoded search solutions — with optimize_anything, an LLM-driven optimization API: a search backend repeatedly proposes better versions from execution… has scriptsnpx skills add gepa-ai/gepa --skill gepa-optimize-anything |
The author's descriptions come from each skill's SKILL.md; the plain-words column is AgentGid's.
Good to know before you install
- It needs an AI provider key. The default proposer model is OpenAI's, so set that key or pass another model id.
- Runs cost money in model calls. The skill tells the assistant to set a dollar cap, a stop score and a timeout.
- The autoresearch and meta_harness modes start Claude Code sessions as separate processes; they are sandboxed by default, and turning the sandbox off gives the agent full access to your machine.
- The default budget is often too small: the run can stop after one proposal and still report a best candidate.
- If your starting text already passes every example, the default optimizer returns it unchanged.
Before you start
Works in
- Claude Code: plugin
- Cursor, VS Code/Copilot, Codex, Gemini CLI: skills folder (.claude/skills/ in a clone)
You will need
- Python with the gepa package: The skill drives gepa.optimize_anything
- An AI provider API key: The proposer model is called on every round
- Claude Code CLI, jq: Only for the autoresearch and meta_harness modes
- bubblewrap (Linux): The default sandbox for the agentic modes
Steps only you can do
- Get an API key from your model provider (OpenAI by default, or Anthropic or AWS Bedrock) and set it as an environment variable (Your model provider's account settings)
Then: The assistant runs preflight.py and launches the optimization - For autoresearch or meta_harness, install the Claude Code CLI and run claude once to sign in (.claude/skills/gepa-optimize-anything/SKILL.md (Install section))
Then: The agentic optimizers can start their Claude sessions
Mistakes to avoid
Keep the default max_evals of 100 with a large valset
Size max_evals to about 15 to 20 times the selection set, and check how many proposals actually ran
Otherwise the run stops after one proposal and still reports a best candidateScore only whether the output is "correct"
Gate the score on the real goal and return rich feedback, not just a number
Every optimizer games a weak proxySwitch engine= and keep the old engine_config block
Swap the engine_config block together with the engine
Unknown keys raise TypeError at constructionTrain only on examples the seed already gets right
Include real failures in the dataset
The gepa backend then rejects every proposal and returns the seed unchangedTurn on evaluation caching and rely on max_evals alone
Also set stop_at_score or max_token_cost
With caching, max_evals counts only cache misses
Which one to pick
| If you need | Pick |
|---|---|
| You need score-driven optimization of any text through a Python API, with several optimizers behind one call | This pack |
| You want Claude Code itself to iterate toward a goal in your repo without writing a Python evaluator | uditgoenka/autoresearch |
| You want a tool that finds what to measure in your codebase and runs the loop on its own | evo-hq/evo |
| You want to evolve your own skill files with an evaluate, improve, test, keep-or-roll-back loop | alchaincyf/darwin-skill |
Works well with
May I use it like this?
| Use | Answer | Condition |
|---|---|---|
| In a commercial app | Yes | MIT: keep the copyright and permission notice |
| Passing the files on | Yes | MIT: keep the notice in copies |
| Work for clients | Yes | MIT |
What leaves your machine
- Your candidate texts, the feedback from your scoring function and the task description → The AI provider of the proposer model (OpenAI by default), Every proposal round of a run. Opt out: Pass a self-hosted model function instead of a provider model id
- Run metrics → Weights & Biases or MLflow, Only when tracking is turned on. Opt out: Leave tracking off
Install GEPA optimize_anything
Official commands from the repository
/plugin marketplace add gepa-ai/gepa /plugin install gepa-optimize-anything@gepa
Send as two separate prompts. Then the gepa Python package is needed: pip install "gepa[full]".
Agents that read .claude/skills/ find the skill on their own when you work inside a clone of gepa-ai/gepa.
pip install "gepa[full]"
[full] adds cloudpickle, needed when the scoring function uses outside data in parallel runs.
Or with the open-source skills CLI: npx skills add gepa-ai/gepa. Skills are instructions your agent follows: read them before installing.
What it installs and runs on your machine
Read in the code at commit ce5b0d6, Nov 17, 2026
| When | What happens |
|---|---|
| Install | A skill file, four reference files and one Python script. No hooks. |
| Before a run (preflight.py) | Checks that gepa imports, that a provider key is set in the environment, and that claude, jq and bwrap are on the PATH when needed. Reads environment variables only, writes nothing. With --test-lm it makes one short call to the AI model. |
| Every optimization run | The gepa library calls the AI provider you chose for every proposed version; your scoring function runs on your machine and may call models too. |
| Every optimization run | Writes per-call JSON, progress_log.jsonl and summary.json to output_dir (default outputs/optimize_anything/...) and an optimizer workspace to run_dir. |
| autoresearch or meta_harness mode | Starts Claude Code (claude --print) as a separate process that posts candidates to a scoring server; sandboxed by default. |
| Optional tracking | Logs runs to Weights & Biases or MLflow when you turn it on. |
The author's numbers, as reported
AgentGid did not run these tests
Settings
OPENAI_API_KEY: Key for the default proposer modelANTHROPIC_API_KEY: Key when you pass an anthropic/ model idGEPA_REFLECTION_LM: Model id preflight.py checks instead of the defaultmax_evals: Cap on scoring calls (default 100)max_token_cost: USD cap on the optimizer's own model spendsandbox: True by default: jails the Claude Code subprocess in agentic modes
Quick answers
- Is it free?
- The library and skill are MIT-licensed. Runs call AI models with your own key, which costs money.
- Which AI model does it use?
- By default openai/gpt-5.1 proposes new versions; you can pass another model id, such as a Claude model, or your own model function.
- What can it improve?
- Any text you can score: prompts, code, configs, regex or SQL, agent instructions.
- Does my scoring function crashing stop the run?
- Yes, by default. Catch errors yourself and return a low score, or turn the setting off.
- How long does a run last?
- Until the scoring-call budget (default 100), the dollar cap or the stop score is reached; the skill also suggests a wall-clock timeout.
Checked by AgentGid on Nov 17, 2026 against commit ce5b0d6 of the pack's own files. agent.md for AI agents · Report a mistake
More software engineering skill packs
| # | Install | |||||
|---|---|---|---|---|---|---|
| 1 |
Gets a set of working habits for building software. It interviews you about a plan before it builds, turns the talk into a spec and small tickets, builds them test-first and reviews the result. |
330K | +32.5K | 39 | ||
| 2 |
Follows one fixed way of working. Before it builds anything, it asks what you really want and writes a short design for you to approve. Then it writes a step-by-step plan, builds it with tests first, has the work checked and asks how you want to finish. |
324K | +18.8K | 15 | ||
| 3 |
Gets four rules: think before coding, keep it simple, change only what you asked for, and set a clear goal it can check. It asks before guessing and writes less extra code. The rules come from the README's reading of a public post by Andrej Karpathy; the files do not say he made or reviewed them. |
235K | +14K | 1 | ||
| 4 |
DietrichGebert/ponytail
Checked
Stops overbuilding. It does what you asked in the simplest way that works, reuses what your project already has, and ends every answer by telling you what it left out. |
197K | +27.3K | 6 | ||
| 5 |
This repo is mostly a big collection of AI apps and tutorials. Its agent_skills folder holds seven separate skills you install one at a time. They help your assistant explain why old code exists, check a change or a package list, or find your abandoned side projects. Others test a draft on simulated readers, untangle a voice ramble, or split a big job across several AI models. |
145K | +3,089 | 10 | ||
| 6 |
Works like a careful senior engineer. It writes down what to build before coding, splits the work into small steps, proves each step with a test and reviews the result before launch. Nine slash commands cover the stages, and 25 skills switch on when a task matches. |
120K | +11K | 26 |
No pack matches.