Borrowing it
Nothing to install: this file belongs to BetterForAll/self-improving-agents. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/BetterForAll/self-improving-agents/main/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/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<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="Reviewed on agentmods" width="80" 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.1 | $0.01702 | $0.01702 |
| Opus 5.5 | $0.00681 | $0.00681 |
| Sonnet 5.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 2mo 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.
- 2mo 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 (149 stars, last pushed 7mo ago), licensed MIT. It adds 1,702 tokens to every session, about $0.0068 per session on Opus 5.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.
self-improving-agents CLAUDE.md compared with instructions from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| self-improving-agents CLAUDE.mdBetterForAll/self-improving-agents | Instructions file | 149 | 7mo ago | MIT | A | 1,702 | Claude Code |
| vscode buildNext.instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 9,719 | GitHub Copilot |
| next.js AGENTS.mdvercel/next.js | Instructions file | 143k | yesterday | MIT | A | 7,461 | Codex, OpenCode |
| langchain AGENTS.mdlangchain-ai/langchain | Instructions file | 149k | yesterday | MIT | A | 4,680 | Codex, OpenCode |
| vscode oss-third-party-notices.instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 5,516 | GitHub Copilot |
| vscode copilot-instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 3,093 | GitHub Copilot |
| deepseek-harness AGENTS.mddeepseek-ai/deepseek-harness | Instructions file | 274k | 2d ago | MIT | A | 4,313 | Codex, OpenCode |