prompt-evolve

prompt-evolve is a command for Claude Code from avelikiy/great_cto. It costs 45 tokens per session (1,605 once invoked), scanned A, original, MIT.

A closed process for improving an agent's prompt from lessons learned. It creates a candidate prompt, tests it on held-out evaluations, and promotes it only when it does not regress against the baseline.

In plain words
What is it for?
Use it to turn a lesson into a new prompt generation, compare it with the current version, and accept or reject the change.
Why use it?
It prevents prompt changes from being shipped based only on intuition or training examples.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: model in frontmatter; positional $N argument.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is GEN=$(( $(node scripts/prompt-evolve.mjs log --agent "$AGENT" 2>/dev/null | grep -c '^.*gen ') + 1 )).

Part of the great-cto plugin — 40 skills, 44 commands, 70 agents shipped together

Good fit Use it to turn a lesson into a new prompt generation, compare it with the current version, and accept or reject the change.

Compare 6 commands from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/avelikiy/great_cto
agentmods
npx agentmods add commands/avelikiy/great_cto/prompt-evolve

Made for: Claude Code.

Or install great-cto, the plugin that ships this one along with the rest of its 40 skills, 44 commands, 70 agents.

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 prompt-evolve

README.md
[![agentmods](https://agentmods.dev/badge/commands/avelikiy/great_cto/prompt-evolve/github.svg)](https://agentmods.dev/commands/avelikiy/great_cto/prompt-evolve)
Your own site
<a href="https://agentmods.dev/commands/avelikiy/great_cto/prompt-evolve"><img src="https://agentmods.dev/badge/commands/avelikiy/great_cto/prompt-evolve/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 prompt-evolve

Your own site · 80×15
<a href="https://agentmods.dev/commands/avelikiy/great_cto/prompt-evolve"><img src="https://agentmods.dev/badge/commands/avelikiy/great_cto/prompt-evolve.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 45 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,605 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.00045 $0.01605
Opus 5 $0.00023 $0.00803
Sonnet 5 $0.00009 $0.00321
Haiku 4.5 $0.00005 $0.00161

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

Security

Grade A, and why

prompt-evolve 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 5d 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.

commands/prompt-evolve.md · 137 lines

How it starts

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

You are the great_cto /prompt-evolve command — the closed self-improvement loop. Today continuous-learner writes a lesson and crystallize can rewrite a prompt, but nothing re-runs the evals to verify the change before it ships. This command closes that loop, porting SIA's run_generation cycle (hexo-ai/sia):

lesson → candidate prompt (gen N+1) → holdout evals → promotion gate → PROMOTE | REJECT

A candidate prompt may only ship if it does not regress on the held-out eval split.

Step 1 — Parse args & locate the agent

AGENT="${ARGUMENTS%% *}"
LESSON=$(echo "$ARGUMENTS" | sed -n 's/.*--lesson \(.*\)/\1/p' | sed 's/^"//; s/"$//')
[ -z "$AGENT" ] && echo "Usage: /prompt-evolve <agent-name> [--lesson \"text\"]" && exit 1
AGENT_FILE="agents/${AGENT}.md"
[ ! -f "$AGENT_FILE" ] && echo "ERROR: agent not found: $AGENT" && exit 1
GEN=$(( $(node scripts/prompt-evolve.mjs log --agent "$AGENT" 2>/dev/null | grep -c '^.*gen ') + 1 ))
echo "Evolving $AGENT → generation $GEN"

If no --lesson was given, read the most recent un-applied lesson for this agent from .great_cto/lessons.md (the continuous-learner output).

Step 2 — Baseline holdout run (current prompt)

export ANTHROPIC_API_KEY=...   # required for the live runner
node tests/eval/runner.mjs --split holdout
cp tests/eval/results.jsonl tests/eval/baseline.holdout.jsonl

If there are no holdout cases yet for this agent's EVAL files, first run /gen-evals <agent> (it now produces a ## Holdout cases section), then re-run Step 2.

Step 3 — Candidate prompt (delegate to ai-prompt-architect)

First, collect what actually failed. The lesson is one sentence of prose; the eval history holds, per case, the judge's reason and the agent's own words:

node scripts/lib/failure-digest.mjs "$AGENT" --split holdout --samples 3

Four answers, and only one of them is a reason to rewrite anything:

State What it means What to do
failures the cases, the judge's reason, the agent's response pass all of it to Step 3
clean measured, nothing failing stop — there is nothing to fix, and a rewrite with no failure to point at is a guess
unmeasured no run at this shape — not the same as passing run /gen-evals <agent>, then Step 2
unreadable the history could not be read fix that first; a digest built on "I could not look" is worse than none

Read the full file on GitHub · 137 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. 5d ago First seen · 137 lines · 45 tokens per session scan A 5e946781aadf

Subscribe to this mod's changes

prompt-evolve is a command published in the GitHub repository avelikiy/great_cto (89 stars, last pushed today), licensed MIT. It adds 45 tokens to every session and 1,605 once invoked, about $0.0002 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.