Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add instructions/betterforall/self-improving-agents/claude-mdgit clone --depth 1 https://github.com/BetterForAll/self-improving-agentsWrote 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.
[](https://agentmods.dev/instructions/betterforall/self-improving-agents/claude-md)<a href="https://agentmods.dev/instructions/betterforall/self-improving-agents/claude-md"><img src="https://agentmods.dev/badge/instructions/betterforall/self-improving-agents/claude-md.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.01702 | $0.01702 |
| Opus 5 | $0.00851 | $0.00851 |
| Sonnet 5 | $0.00340 | $0.00340 |
| Haiku 4.5 | $0.00170 | $0.00170 |
Grade A, and why
self-improving-agents CLAUDE.md 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 5d ago.
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.
How it starts
The opening of the file, as written. The whole thing — 160 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Self-Improving Agents -- Project Context for Claude Code
Project Overview
This repo demonstrates 4 levels of self-improving code agents, from the simplest possible loop to a competitive adversarial arena. Each level adds one key idea. All demos use real LLM calls (Gemini 2.5 Flash) with multiple task types.
A side-by-side comparison of approaches to autonomous code improvement.
Background & History
I built a self-improving review loop for his Graph RAG project (BetterForAll/graph-rag-ui, private) starting February 1, 2026 -- 5 weeks before Karpathy's AutoResearch (March 6-7, 2026) and 6 weeks before Meta's HyperAgents paper (March 17, 2026, arxiv 2603.19461).
My original approach (in graph-rag-ui) introduced several techniques that later appeared independently in those papers:
- Asymmetric context windows -- small focused worker, 1M-token evaluator
- Structured issue taxonomy -- categorized feedback with severity + fix suggestions
- Step-by-step pipeline logging -- queryable JSON logs instead of raw context
- Fully autonomous from a single Cursor instruction -- no human in the loop
Repo Structure
tasks/ Shared task definitions (real files, not strings)
snake/ Snake game AI (deterministic: score) + visual player
support/ Customer support Q&A (LLM-as-judge: quality)
email_validation/ Email validation (adversarial: accuracy)
task_runner.py Central module: load_task, write_solution, run_solution
checkpoint.py Shared checkpoint/resume (atomic writes, all levels)
autoresearch/ Level 1: AutoResearch Loop
run.py The main loop (--task snake|support|email_validation)
llm.py Gemini 2.5 Flash wrapper
experiment.py Run experiments with real-time JSON logging
feedback-loop/ Level 2: Feedback Loop
run.py Orchestrates worker + reviewer
worker.py Proposes improvements (small context, focused)
reviewer.py Structured JSON feedback (full context, sees everything)
llm.py Gemini wrapper
hyperagent/ Level 3: HyperAgent Loop (true code-rewriting)
run.py Generation loop with 3-stage validation
llm.py Gemini wrapper
seed/ Original agent code (immutable reference)
task_agent.py Seed task agent
meta_agent.py Seed meta-agent
agent_code/ Live working copies (rewritten by meta-agent)
generations/ Versioned snapshots (gen_000/, gen_001/, ...)
arena-loop/ Level 4: Arena Loop (adversarial + self-modifying)
run.py Arena loop with tournament selection
code_agent.py Mini-HyperAgent code agents (can mutate propose())
test_agent.py Test hardening agents (adversarial inputs)
arena.py Tournament selection + strategy evolution
llm.py Gemini wrapper
CONCEPT.md Full architectural writeup (GAN analogy, roadmap)
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.
- 5d ago First seen · 160 lines · 1,702 tokens per session scan A 48fb21b4512b
self-improving-agents CLAUDE.md is an instructions file published in the GitHub repository BetterForAll/self-improving-agents (183 stars, last pushed 4mo ago), licensed MIT. It adds 1,702 tokens to every session, about $0.0085 per session on Opus 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.
Other instructions, from other repositories
harness-sdk AGENTS.md
AGENTS.md instructions for strands-agents/harness-sdk, covering agent development guide - strands agents monorepo, context, monorepo layout, where the "why" lives: team/ and writing code.
NEEDLE AGENTS.md
AGENTS.md instructions for jedarden/NEEDLE, covering needle codex guide, project overview, working safely, rust compatibility and code conventions.
NEEDLE CLAUDE.md
Claude Code instructions for jedarden/NEEDLE, covering needle project conventions, msrv, module dependency graph, code style and testing.
harness-sdk CLAUDE.md
Claude Code instructions for strands-agents/harness-sdk, a project described as: Build an agent harness and control it end-to-end. Open-source SDK for production AI agents in Python & TypeScript - any model, any cloud.
MassGen AGENTS.md
AGENTS.md instructions for massgen/MassGen, covering claude.md, openspec instructions, planning, instruction file parity and debugging assumptions.
MassGen CLAUDE.md
Claude Code instructions for massgen/MassGen, covering claude.md, openspec instructions, planning, instruction file parity and debugging assumptions.