Recursive Self-Improvement Framework for AI Coding Agents Using Claude Code

✍️ OpenClawRadar📅 Published: March 28, 2026🔗 Source
Recursive Self-Improvement Framework for AI Coding Agents Using Claude Code
Ad

A developer has open-sourced a framework that enables AI coding agents to recursively improve themselves using Claude Code. The system was developed after months of research into how model providers implement recursive agent optimization.

How It Works

The framework provides a structured approach to agent improvement:

  • Add tracing to your agent with 2 lines of code (or skip to step 3 if you already have traces)
  • Run your agent multiple times to collect execution traces
  • Run /recursive-improve in Claude Code
  • The system analyzes traces, finds failure patterns, plans fixes, and presents them for approval
  • Apply fixes, run agent again, and verify improvement with /benchmark against baseline
  • Repeat cycles to continue improvement

Autonomous Option

For fully autonomous operation (similar to Karpathy's autoresearch):

  • Run /ratchet to execute the entire improvement loop automatically
  • The system improves, evaluates, and keeps or reverts changes
  • Only improvements survive
  • Can run overnight to wake up to a better agent
Ad

Performance Results

Tested on a real-world enterprise agent benchmark (tau2) with the skill running fully on autopilot:

  • 25% performance increase after a single improvement cycle

Technical Background

The original research involved building a recursive language model architecture with sandboxed REPL for trace analysis at scale, multi-agent pipelines, and other components. The developer discovered that most people building agents don't need this complexity and that Claude Code provides sufficient capability for recursive self-improvement.

The framework tells your coding agent: here are the traces, here's how to analyze them, here's how to prioritize fixes, and here's how to verify them.

Open-source repository: https://github.com/kayba-ai/recursive-improve

📖 Read the full source: r/ClaudeAI

Ad

👀 See Also