ax-gepa

ax-gepa is a skill for Claude Code, Codex from ax-llm/ax. It costs 71 tokens per session (2,526 once invoked), scanned A, original, Apache-2.0.

A guide to GEPA optimization in the @ax-llm/ax library. GEPA is a method for improving AI prompts or program steps by testing them against examples and comparing their results.

In plain words
What is it for?
Running prompt optimization, multi-objective scoring, holdout validation, and saving or restoring optimized programs.
Why use it?
It helps tune generators, workflows, and agent trees against measured results while limiting evaluation cost.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Not installable: its command points at a path on the author’s own machine, so it runs nowhere else. The line is /Users/vr/src/ax/src/examples/optimize.ts.

Good fit Running prompt optimization, multi-objective scoring, holdout validation, and saving or restoring optimized programs.

Compare 6 skills from other repositories ↓
About the project

Ax is a TypeScript-first programming framework for building applications with large language models through typed generation, agents, workflows, and optimization tools. It is intended for developers who want one model for LLM programs across TypeScript, Python, Java, C++, Go, Rust, and other runtimes.

ax-llm/ax · 2,894 stars · on GitHub · axllm.dev

Install

Getting it into your agent

There is no command for this one: it runs only inside a plugin, and the catalogue could not identify which plugin ships it. The source is linked below.

Made for: Claude Code, Codex.

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 ax-gepa

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/ax-llm/ax/ax-gepa"><img src="https://agentmods.dev/badge/skills/ax-llm/ax/ax-gepa.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 71 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,526 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.00071 $0.02526
Opus 5 $0.00036 $0.01263
Sonnet 5 $0.00014 $0.00505
Haiku 4.5 $0.00007 $0.00253

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

Security

Grade A, and why

ax-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 3d 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

1 near-identical copy found in the catalogue:

  • ax-gepa — 95% identical, 2 lines differ
website/static/typescript/.well-known/agent-skills/ax-gepa/SKILL.md · 265 lines

How it starts

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

GEPA Optimization Codegen Rules (@ax-llm/ax)

Use this skill to generate GEPA optimization code. Prefer the top-level optimize(...) helper for normal code, and use direct AxGEPA / AxBootstrapFewShot only when the user needs low-level optimizer control.

Use These Defaults

  • Use optimize(program, train, metric, { studentAI, teacherAI, ... }) for normal generator and flow tuning.
  • Prefer ai(), ax(), and flow() for new code.
  • Use a strong teacherAI and a cheaper studentAI.
  • Pass validationExamples when you have a holdout set.
  • Set maxMetricCalls to bound optimizer cost; optimize(...) defaults it to 100.
  • Use scalar metrics for one objective and object metrics for Pareto optimization.
  • Apply results with program.applyOptimization(result.optimizedProgram!).
  • For tree-wide runs, expect optimizedProgram.componentMap.
  • Persist artifacts with axSerializeOptimizedProgram(...) and restore them with axDeserializeOptimizedProgram(...) so the same flow works in browsers and Node.
  • optimize(...) runs AxBootstrapFewShot -> AxGEPA for small starter sets by default, preserving the demos in result.optimizedProgram.demos.

Critical Rules

  • optimize(...) and AxGEPA.compile() work for a single generator and for tree-aware roots such as flows or agents with registered optimizable descendants.
  • There is no separate flow-only GEPA optimizer. Use AxGEPA for flows too.
  • The metric may return either number or Record<string, number>.
  • Keep metrics deterministic and cheap by default.
  • Avoid extra LLM calls inside the metric unless the user explicitly wants judge-based evaluation.
  • If the user needs LLM-as-judge scoring for a non-agent GEPA run, prefer a plain typed AxGen evaluator instead of writing a custom judge abstraction.
  • maxMetricCalls must be large enough to cover the initial validation pass over validationExamples.
  • GEPA optimizes generic string components exposed by getOptimizableComponents(). If a tree exposes no components, optimization will fail.
  • Use held-out validation examples for selection. Do not reuse the training set as validationExamples.
  • result.optimizedProgram is the easy-to-apply best candidate. result.paretoFront is the full trade-off set for multi-objective runs.
  • Direct AxGEPA still has its own bootstrap option, but top-level optimize(...) composes the existing AxBootstrapFewShot optimizer before GEPA instead.

Read the full file on GitHub · 265 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. 3d ago Changed 51dba55208cb
  2. 6d ago First seen · 265 lines · 71 tokens per session scan A 3918cd644aa4

Subscribe to this mod's changes

ax-gepa is a skill published in the GitHub repository ax-llm/ax (2,894 stars, last pushed yesterday), licensed Apache-2.0. It adds 71 tokens to every session and 2,526 once invoked, about $0.0004 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-09-03.

Related

Other skills, from other repositories