recursive-improve

by kayba-aiโœ“ Verified

๐Ÿชž Make your agents recursively self-improve

250
Stars
25
Forks
Python
Language
8/23/2026
Added
View on GitHubDownload ZIP

โš ๏ธ Third-Party Software Notice

This skill is third-party open-source software developed and hosted independently on GitHub. SkillTip is an informational directory and does not control or maintain the underlying repository. Any security checks displayed are automated and limited in scope. Review the source code before installing.

Read the Terms of Service

Installation

Add to your Claude Code skills directory:

# Add to your Claude Code skills
git clone https://github.com/kayba-ai/recursive-improve

Getting Started

Guides for using skills like recursive-improve.

Security Report

Verified

Last scanned: โ€”

{
  "status": "PASSED",
  "issues": []
}

README.md

recursive improve

Discord Twitter Follow kayba.ai

make your agents recursively self-improve

90% of Claude's code is now written by Claude. Recursive self-improvement is already happening at Anthropic. What if you could do the same for your own agents?

Closing the Loop

You have an agent. It works, most of the time. But it could be better. Solving harder problems, handling more edge cases, wasting fewer tokens. What if it could improve itself, recursively, every time it runs?

Right now, it can't. Your agent is stateless. Every run starts from scratch. The only way to improve it is to manually improve it. There is no compounding of improvements.

recursive-improve closes this loop:

recursive improvement loop

Your agent runs. Every LLM call is captured. Your coding agent analyzes the traces, identifying common failure patterns across runs, and applies targeted fixes. You run it again. It's better.


Get Started

1. Install

uv tool install "recursive-improve[all] @ git+https://github.com/kayba-ai/recursive-improve.git"

Then in your agent's project directory:

cd /path/to/your/agent
recursive-improve init

This creates the /recursive-improve skill files and the eval/traces/ directory.

2. Add tracing to your agent

Add the tracing dependency to your project:

uv add "recursive-improve @ git+https://github.com/kayba-ai/recursive-improve.git"

Two lines. Your agent code stays unchanged, but now your agents execution traces get saved locally.

import recursive_improve as ri

ri.patch()  # auto-captures openai, anthropic, litellm calls

with ri.session("./eval/traces") as run:
    result = my_agent("book a flight to Paris")
    run.finish(output=result, success=True)

Already have traces? Drop them in eval/traces/ and skip to step 4.

3. Run your agent a few times to generate traces

4. Run the improvement loop

Open Claude Code or Codex in your project directory:

/recursive-improve

5. Re-run your agent

Clear old traces and run your agent again so the benchmark measures your improved code:

rm -f eval/traces/*.json
# run your agent the same way as step 3

6. Benchmark

Measure whether your changes actually solved the problems:

/benchmark

Results are stored in eval/benchmark_results.json and auto-compared against the previous run on the same dynamic metrics that were generated for your agent.

CLI alternative: recursive-improve benchmark --label "v1-baseline" and recursive-improve benchmark list

7. Dashboard

Start the interactive dashboard to visualize your improvement cycles:

recursive-improve dashboard          # default: http://localhost:8420
recursive-improve dashboard -p 8080  # custom port

Each improvement cycle lives on its own branch. The dashboard shows before/after metrics for every cycle. See exactly what improved, merge the wins, discard the rest.

Dashboard

8. Run it overnight

/ratchet

An autoresearch-style autonomous loop. It asks you what to optimize, then repeats: improve โ†’ run agent โ†’ eval โ†’ keep or revert. Only improvements survive. Check eval/ratchet_summary.md when you wake up.

[!TIP] Want deeper analysis? Kayba offers managed recursive agent improvement at scale, tailored to your agent.


How It Works

When you run the /recursive-improve skill, it walks through a structured pipeline:

  1. Build context: detects your agent's architecture, tools, and system prompt
  2. Analyze traces: reads your traces, surfaces failure patterns, missed opportunities, recurring errors
  3. Measure: runs built-in detectors (loops, give-ups, errors, recovery) and generates custom domain-specific evaluations from your insights, then computes baselines
  4. Plan: triages each insight into discard / code fix / prompt fix, prioritized by impact
  5. Review: presents the plan for your approval before anything changes
  6. Fix: implements approved changes on a dedicated branch

Every fix traces back to a specific insight, linked to a specific metric.


Architecture

your agent  โ”€โ”€>  ri.patch() + ri.session()  โ”€โ”€>  eval/traces/*.json
                                                        โ”‚
                                                        โ–ผ
                                                  /recursive-improve
                                                        โ”‚
                                                        โ–ผ
                                              improved agent code  โ”€โ”€>  repeat
                                                        โ”‚
                                                        โ–ผ
                                                    benchmark  โ”€โ”€>  recursive-improve dashboard

                              โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                              โ”‚  /ratchet (autonomous loop)   โ”‚
                              โ”‚  improve โ†’ run โ†’ eval โ†’       โ”‚
                              โ”‚  keep or revert โ†’ repeat      โ”‚
                              โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
  • ri.patch(): monkey-patches OpenAI, Anthropic, and LiteLLM clients to capture every call
  • ri.session(): context manager that writes structured trace JSON files
  • /recursive-improve: Claude Code / Codex skill that analyzes traces and applies fixes
  • recursive-improve benchmark: snapshot metric quality, store, and compare over time
  • recursive-improve dashboard: web UI to visualize runs and compare branches
  • /ratchet: autonomous keep-or-revert loop that runs /recursive-improve repeatedly overnight

Star this repo if you find it useful!

Built with โค๏ธ by Kayba and the open-source community.

Frequently Asked Questions

What is recursive-improve?โŒ„

recursive-improve is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by kayba-ai. ๐Ÿชž Make your agents recursively self-improve. It has 250 GitHub stars.

Is recursive-improve safe to use?โŒ„

Yes. recursive-improve passed SkillsLLM's automated security scan โ€” a dependency vulnerability audit plus prompt-injection heuristics โ€” with no high-severity issues. You can read the full report in the Security Report section on this page.

How do I install recursive-improve?โŒ„

Clone the repository with "git clone https://github.com/kayba-ai/recursive-improve" and add it to your Claude Code skills directory (see the Installation section above).

What programming language is recursive-improve written in?โŒ„

recursive-improve is primarily written in Python. It is open-source under kayba-ai on GitHub, so you can review or fork the full source.

Are there alternatives to recursive-improve?โŒ„

Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh recursive-improve against similar tools.

Comments (0)

No comments yet. Be the first to share your thoughts!

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

โญ 242,219โ‘‚ 36,702JavaScript
AI Agentsai-agentsanthropicclaude-code
View details โ†’
15

An agentic skills framework & software development methodology that works.

โญ 234,966โ‘‚ 20,863Shell
AI Agentsai-agentsbrainstorming
View details โ†’

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

โญ 185,940โ‘‚ 28,768JavaScript
AI Agentsai-agentsanthropicclaude-code
View details โ†’

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

โญ 128,868โ‘‚ 8,826Rust
AI Agentsclaude-codeai-tools
View details โ†’

claude-code

by anthropics

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

โญ 120,031โ‘‚ 19,897Shell
AI Agents
View details โ†’

Developers Also Liked

Based on votes and bookmarks from developers who liked this skill

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

โญ 242,219โ‘‚ 36,702JavaScript
AI Agentsai-agentsanthropicclaude-code
View details โ†’
15

An agentic skills framework & software development methodology that works.

โญ 234,966โ‘‚ 20,863Shell
AI Agentsai-agentsbrainstorming
View details โ†’

n8n

by n8n-io

12

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

โญ 201,881โ‘‚ 60,308TypeScript
MCP Serversapisai-tools
View details โ†’

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

โญ 185,940โ‘‚ 28,768JavaScript
AI Agentsai-agentsanthropicclaude-code
View details โ†’

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

โญ 128,868โ‘‚ 8,826Rust
AI Agentsclaude-codeai-tools
View details โ†’
recursive-improve โ€” AI Skill for Claude Code | SkillTip