recursive-improve

recursive-improve is a skill for Claude Code, Codex from kayba-ai/recursive-improve. It costs 89 tokens per session (6,426 once invoked), scanned A, original, Apache-2.0.

A staged process for improving an AI agent from execution traces. Execution traces are saved records of the agent's messages, tool calls, and outcomes.

In plain words
What is it for?
Use it to analyze traces, gather relevant domain context, define metrics, build a review rubric, propose improvements for approval, and implement the approved changes.
Why use it?
It turns past runs into documented lessons, measurements, review criteria, and a prioritized improvement plan. It also checks whether the required trace files and earlier analysis already exist before starting.

Skill for Claude CodeCodex

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

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is python eval/compute_baselines.py --traces-dir eval/traces --output eval/baseline_metrics.json.

Good fit Use it to analyze traces, gather relevant domain context, define metrics, build a review rubric, propose improvements for approval, and implement the approved changes.

Compare 6 skills 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/kayba-ai/recursive-improve
agentmods
npx agentmods add skills/kayba-ai/recursive-improve/data

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 recursive-improve

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/kayba-ai/recursive-improve/data"><img src="https://agentmods.dev/badge/skills/kayba-ai/recursive-improve/data.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 89 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 6,426 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.00089 $0.06426
Opus 5.5 $0.00036 $0.02570
Sonnet 5.5 $0.00018 $0.01285
Haiku 4.5 $0.00009 $0.00643

Measured 1mo ago against content hash 773d3322982a, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

recursive-improve 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 1mo ago.

The scan reads SKILL.md. This mod also ships 1 executable file (__init__.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.

recursive_improve/data/SKILL.md · 747 lines

How it starts

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

recursive-improve: Agent Improvement Pipeline

End-to-end pipeline: trace analysis → skill extraction → domain context → metrics → rubric → action plan → review → fixes.

Prerequisites

Traces must exist in eval/traces/. If they don't:

  • Ask the user for their traces directory
  • Copy .json, .md, and .toon files into eval/traces/

Skip condition: If eval/stage1_insights_summary.md already exists (from a prior run or from recursive-improve analyze), skip Stages 0 and 1 — go directly to Stage 2.


Stage 0: Trace Analysis

Analyze raw execution traces to extract learnings. This stage adapts ACE's recursive reflector methodology — a structured 6-phase strategy that moves from data discovery through verified deep-dives to synthesized, evidence-backed insights.

Inputs

  • eval/traces/ — raw trace files (.json, .md, .toon)

Phase 1: Discover

Map the data shape and inventory. Do NOT judge outcomes yet — just catalog what you have.

  1. Read 2-3 trace files. Identify:

    • Top-level keys and message schema (3 levels deep)
    • Message format: role, content, tool_calls, turn_idx, etc.
    • Total trace count and per-trace message counts
  2. Search for agent operating rules, policy, or instructions embedded in the traces — these are often in large strings (>500 chars). Check:

    • role: "system" messages
    • info.environment_info.policy or similar fields
    • Large embedded strings in any field
  3. Build an inventory table:

    File                  Messages  Has system prompt?  Has tool calls?
    trace_001.json        42        yes                 yes
    trace_002.json        18        yes                 no
    ...
    
  4. Record discovered rules/policy verbatim — understanding what the agent was supposed to do is essential for evaluating what it actually did.

Phase 2: Derive Evaluation Criteria

Based on your discovery (schema, rules, patterns), define specific evaluation criteria to apply to every trace during the survey phase.

Read the full file on GitHub · 747 lines

Files

What ships with it

4 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. 1mo ago First seen · 747 lines · 89 tokens per session scan A 773d3322982a

Subscribe to this mod's changes

recursive-improve is a skill published in the GitHub repository kayba-ai/recursive-improve (297 stars, last pushed 6mo ago), licensed Apache-2.0. It adds 89 tokens to every session and 6,426 once invoked, about $0.0004 per session on Opus 5.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

creator

Create, improve, and review AgentUse agent files. Use when authoring .agentuse agents, designing agent workflows, configuring frontmatter, adding MCP servers, subagents, schedules, approval gates, skills, or choosing project structure and automation patterns.

agentuse/agentuse · 52 tokens

deep-research

Orchestrate autonomous deep web research, parallel scraping, citation synthesis, fact checking, and persistent memory using the Deep Research MCP server. Use when asked to 'deep research', 'research this topic', 'fact check claim', 'compare sources', or perform comprehensive multi-source investigation with zero API…

SECRET4422/mcp-deep-research-server · 64 tokens

tester

Test and validate AgentUse agents without real side effects. Use when verifying a new or changed .agentuse file, dry-running an agent, testing approval-gate flows unattended, mocking tool outputs, or iterating on an agent in a closed loop before letting it run for real.

agentuse/agentuse · 58 tokens

automate

Turn a workflow described or just completed in a coding agent into one focused, validated AgentUse agent. Use for make-this-repeatable, scheduled-workflow, and first-automation handoffs from third-party coding agents.

agentuse/agentuse · 46 tokens

onboarding

Guide a new AgentUse user from a confirmed project to one validated first agent and its first CLI or Web UI run. Use for terminal setup and Create my first agent handoffs.

agentuse/agentuse · 39 tokens

runner

Run and manage AgentUse agents from the CLI. Use when you need to list agents, run an agent, inspect sessions, start or inspect the AgentUse server, work with schedules, or understand runtime command behavior.

agentuse/agentuse · 45 tokens