Self-Improvement Loop

Self-Improvement Loop is a skill for Claude Code from ralfyishere/rules-with-receipts. It costs 111 tokens per session (1,640 once invoked), scanned A, original, MIT.

A working method for turning corrections, failed attempts, and repeated problems into reusable lessons for future tasks.

In plain words
What is it for?
It is for reviewing what went wrong, recording a concise lesson, applying it on the next attempt, and checking lessons after substantial multi-step work.
Why use it?
It helps prevent the same mistake or dead-end approach from being repeated after an answer is corrected or a task fails.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

Good fit It is for reviewing what went wrong, recording a concise lesson, applying it on the next attempt, and checking lessons after substantial multi-step work.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ralfyishere/rules-with-receipts/self-improvement-loop
Install

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.

Any agent
npx skills add ralfyishere/rules-with-receipts --skill self-improvement-loop
Clone the repo
git clone --depth 1 https://github.com/ralfyishere/rules-with-receipts

Made for: Claude Code.

Wrote 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.

agentmods badge for Self-Improvement Loop

README.md
[![agentmods](https://agentmods.dev/badge/skills/ralfyishere/rules-with-receipts/self-improvement-loop.svg)](https://agentmods.dev/skills/ralfyishere/rules-with-receipts/self-improvement-loop)
Your own site
<a href="https://agentmods.dev/skills/ralfyishere/rules-with-receipts/self-improvement-loop"><img src="https://agentmods.dev/badge/skills/ralfyishere/rules-with-receipts/self-improvement-loop.svg" alt="Measured on agentmods" height="20"></a>
Per session 111 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,640 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00111 $0.01640
Opus 5 $0.00056 $0.00820
Sonnet 5 $0.00022 $0.00328
Haiku 4.5 $0.00011 $0.00164

Measured 8d ago against content hash cf6e13eb19df, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

Self-Improvement Loop 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 8d 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.

.claude/skills/self-improvement-loop/SKILL.md · 94 lines

How it starts

The opening of the file, as written. The whole thing — 94 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Self-Improvement Loop

Purpose

A correction that only fixes the current output is a discount on future mistakes left unclaimed. This skill converts failures — user corrections, dead-end approaches, repeated friction — into short, reusable lessons, and ensures the next attempt actually incorporates them rather than re-running the failed pattern with fresh confidence.

When to use this skill

  • The user corrects you: content, approach, tone, scope, format. Every correction encodes a rule they expected you to already know.
  • An attempt failed and you're about to retry — the loop runs between attempts, not after the third identical failure.
  • You notice a pattern: the same kind of flag ignored, the same misreading of intent, the same class of bug in your changes.
  • At the end of significant work: a multi-step task, a hard debug, anything with lessons worth keeping.

When NOT to use this skill

  • Mid-flow on trivial slips (a typo you immediately fixed). The loop is for patterns and real failures, not every micro-error.
  • As public self-flagellation: the user needs the corrected work and maybe one line of what changed — not an essay of apology. The review is mostly internal; its output is behavior.
  • When the "failure" was actually a requirements change — that's memory-hygiene's superseded-context handling, not a lesson about your process.

Operating procedure

Step 1 — On any correction or failure, stop before retrying. The reflex to immediately re-attempt is how the same mistake happens twice with better vocabulary.

Step 2 — Run the lightweight after-action review (four lines; internal by default):

Goal:      what was I trying to produce?
Actual:    what happened / what did the user push back on?
Root:      why - the earliest point where the path went wrong?
Lesson:    one sentence, phrased as a rule for NEXT time.

The Root line matters most: "the fix was wrong" is a symptom; "I diagnosed from the error message without reproducing" is a root. Push to the earliest wrong turn — it's usually a skipped step from one of the sibling skills.

Read the full file on GitHub · 94 lines

Changes

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.

  1. 8d ago First seen · 94 lines · 0 tokens per session scan A cf6e13eb19df

Subscribe to this mod's changes

Self-Improvement Loop is a skill published in the GitHub repository ralfyishere/rules-with-receipts (2 stars, last pushed 1mo ago), licensed MIT. It adds 111 tokens to every session and 1,640 once invoked, about $0.0006 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-31.

Related

Other skills, from other repositories

happiness-skill

A Chinese-language guide to happiness based on reducing unmet wants, focusing on the present, and treating happiness as a trainable skill.

kangarooking/cangjie-skill · 136 tokens

setup-matt-pocock-skills

A setup skill that configures engineering skills for a repository, including its issue tracker, labels, and documentation layout. A repository is the project folder managed by version control.

devcxl/mattpocock-skills-zh · 43 tokens

frontend-design

A design guide for building polished web interfaces such as pages, dashboards, forms, navigation, and reusable UI components. It covers HTML, CSS, JavaScript, and common frontend frameworks.

AnastasiyaW/codex-claude-code-config · 264 tokens

alterlab-cobrapy

Build and analyze genome-scale constraint-based metabolic models with COBRApy — flux balance analysis (FBA), flux variability analysis (FVA), gene and reaction knockouts, flux sampling, and SBML model I/O. Use when simulating metabolic networks, predicting growth or knockout phenotypes, or running systems-biology and…

AlterLab-IEU/AlterLab-Academic-Skills · 91 tokens

alterlab-depmap

Query the Cancer Dependency Map (DepMap) for cancer cell line gene dependency scores (CRISPR Chronos), drug sensitivity data, and gene effect profiles. Use when identifying cancer-specific genetic vulnerabilities, finding synthetic lethal interactions, checking whether a gene is essential in given cell lines, or…

AlterLab-IEU/AlterLab-Academic-Skills · 77 tokens

alterlab-qutip

Simulates open quantum systems with QuTiP, the Quantum Toolbox in Python, solving Lindblad master equations (mesolve), Monte Carlo trajectories (mcsolve), and unitary dynamics (sesolve). Use when studying master-equation or Lindblad dynamics, decoherence, dissipation, quantum optics, cavity QED, or open-system time…

AlterLab-IEU/AlterLab-Academic-Skills · 134 tokens