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

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-improvein 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
/benchmarkagainst baseline - Repeat cycles to continue improvement
Autonomous Option
For fully autonomous operation (similar to Karpathy's autoresearch):
- Run
/ratchetto 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
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
👀 See Also

Building a Self-Updating Writing Style Guide for AI-Assisted Content
A team building a voice extraction platform called Noren has developed a 117-line Markdown style guide that rewrites itself after every published piece, using Claude to enforce rules and banning AI-sounding words like 'cadence' and 'optimize'.

Clawion: OpenClaw wrapper with Claude Max support and GitHub integration
Clawion is an OpenClaw wrapper that supports Claude Max without requiring an API key. Setup involves picking a template, connecting Telegram, and deploying a code companion with GitHub integration for automated PR creation.

OpenClaw CoreBrain Plugin: Persistent Memory for AI Coding Agents
A new plugin called CoreBrain addresses OpenClaw's memory issues by storing information outside the context window in a knowledge graph and auto-injecting it before every query, eliminating the need for tool calls and optional memory invocation.

SLayer: An Open-Source Semantic Layer for AI Agents That Learns from Queries
SLayer is a lightweight, embeddable semantic layer that lets AI agents query databases, manage models, and learn from interactions via MCP, REST, CLI, or Python.