Ouroboros
Claude Code that improves itself
Ouroboros runs silently in the background of every Claude Code session. When significant code changes happen, it debates itself โ Proposer/Critic/Judge โ and refines its own working rules based on what actually works.
No configuration. No commands. It just runs.
What it does
Debate Engine
Every significant code change triggers a three-way critique:
- Proposer โ makes the case for the approach
- Critic โ challenges it, finds weaknesses
- Judge โ synthesizes into a concrete recommendation
The outcome updates the adversarial rulebook. Better decisions compound over time.
Adversarial Rulebook
A self-modifying set of code quality rules. Rules that lead to good outcomes get reinforced. Rules that don’t get flagged for revision. The system learns what works in this codebase.
Amnesia Manager
Strategic memory compression. Ouroboros tracks what context is worth keeping across sessions and what can be safely dropped. Signal-to-noise stays high even in long-running projects.
Fork Manager
Parallel approach comparison. When there are multiple valid solutions, Ouroboros can spin up isolated forks, compare outcomes, and recommend the winner.
Installation
Ouroboros is installed per-project, not globally. It integrates with Claude Code’s settings system.
| |
This:
- Copies the system prompt to
.claude/ - Registers session hooks in
.claude/settings.json - Initializes state files in
.ouroboros/
From that point on, every Claude Code session in that project has Ouroboros active.
Architecture
.ouroboros/
โโโ config.json # System bounds
โโโ system_prompt.md # Always-active context
โโโ observer/ # Central state + task queue
โโโ scripts/ # Debate, rules, amnesia, forks
โโโ debate/ # Debate engine state
โโโ adversarial/ # Self-improving critique rules
โโโ amnesia/ # Memory compression policies
โโโ telemetry/ # Outcomes and metrics
โโโ forks/ # Parallel strategy comparisons
Free and open source
Ouroboros is MIT licensed. Install it, fork it, modify it.
Development notes and architecture decisions documented at headlessmode.com/journal.