run-optimizer

run-optimizer is a skill for Claude Code, Codex from skillberry-ai/cap-evolve. It costs 122 tokens per session (1,590 once invoked), scanned A, original, Apache-2.0.

A runner that starts a command-line coding agent selected from a registry and lets it edit a working copy of a project. It is designed for cap-evolve runs, where an agent proposes changes to improve a capability.

In plain words
What is it for?
Use it to run Claude Code, Codex, Gemini CLI, Cursor, or another shell command as the editor in an automated improvement loop.
Why use it?
It lets one workflow use different coding agents through the same interface, with each agent defined by one registry entry.

Skill for Claude CodeCodex

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/run-optimizer
Any agent
npx skills add skillberry-ai/cap-evolve --skill run-optimizer
Clone the repo
git clone --depth 1 https://github.com/skillberry-ai/cap-evolve

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 run-optimizer

README.md
[![agentmods](https://agentmods.dev/badge/skills/skillberry-ai/cap-evolve/run-optimizer.svg)](https://agentmods.dev/skills/skillberry-ai/cap-evolve/run-optimizer)
Your own site
<a href="https://agentmods.dev/skills/skillberry-ai/cap-evolve/run-optimizer"><img src="https://agentmods.dev/badge/skills/skillberry-ai/cap-evolve/run-optimizer.svg" alt="Measured on agentmods" height="20"></a>
Per session 122 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,590 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 $0.00122 $0.01590
Opus 5 $0.00061 $0.00795
Sonnet 5 $0.00024 $0.00318
Haiku 4.5 $0.00012 $0.00159

Measured 4d ago against content hash 9545f46b0f73, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

run-optimizer 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 4d ago.

The scan reads SKILL.md. This mod also ships 5 executable files (scripts/_bootstrap.py, scripts/_mock_apply.py, scripts/abstract.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/optimizers/run-optimizer/SKILL.md · 114 lines

How it starts

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

run-optimizer — one runner, a registry of agents

An optimizer is the agent that reads the current capability + the failure diagnosis and proposes an edit. Every such agent follows the same contract: given a working directory (a copy of the parent candidate) and an INSTRUCTIONS.md, edit the files in place. Because the contract is identical, one runner serves them all — the only thing that varies per agent is the shell command, which lives as a row in optimizers/registry.yaml. Adding an optimizer is one YAML row, not a new skill directory.

How it works

  1. The loop calls run.py --name <optimizer> --workdir <copy> --prompt INSTRUCTIONS.md.
  2. The runner reads the registry, resolves the row, and expands its command_template (placeholders below) into argv.
  3. It runs that command with cwd = workdir, so the agent edits the candidate files directly. Output is summarized as JSON (returncode, auth_present, stdout_tail).
  4. Streams: stdout is exactly one JSON object; the agent CLI's stderr is relayed to the runner's stderr on success as well as failure, so a CLI that prints a diagnostic and exits 0 is not silently successful.
  5. --prompt must name an existing file — the caller resolves the path. A missing one is an error (exit 2), never an empty prompt: the {prompt_text} rows would otherwise bill a real agent CLI to run with no instructions at all.

Template placeholders

placeholder expands to
{workdir} the candidate working copy (also the cwd)
{prompt} path to INSTRUCTIONS.md
{prompt_text} the contents of INSTRUCTIONS.md (for CLIs that take the prompt inline)
{model} the resolved model id; an empty {model} drops itself and a preceding -m/--model
{self_dir} the runner's own scripts dir (used by the mock row)
${VAR} environment expansion (the generic/openclaw/antigravity escape hatches read their command from env)

Choosing an optimizer (--name / optimizer_skill)

Read the full file on GitHub · 114 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. 4d ago First seen · 114 lines · 122 tokens per session scan A 9545f46b0f73

Subscribe to this mod's changes

run-optimizer is a skill published in the GitHub repository skillberry-ai/cap-evolve (50 stars, last pushed today), licensed Apache-2.0. It adds 122 tokens to every session and 1,590 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.