Validation-Loop CLAUDE.md Auto-Learner
Any time Claude Code messes up on your codebase, ask it to fix the mistake and then update CLAUDE.md so it never does that again, without editing rules by hand.
Before & after
Same prompt, same agent — the only difference is the skill.
I can fix that issue for you. What specific pattern did Claude break or violate? I'd strongly recommend documenting that rule manually in CLAUDE.md so it doesn't happen again in future conversations. What should the rule statement say exactly? Do you want me to add it to the very top of the file where the highest-priority rules go? This is a really important step to keep Claude on track with your codebase style and conventions.
AUTO-UPDATE WORKFLOW — CLAUDE.MD RULE CAPTURE: SCENARIO: Claude generated a custom React hook without first reading /hooks/PATTERNS.md documentation file. Violates team-defined rule: always check hook patterns before generating new code. WORKFLOW EXECUTION: 1. FIX PHASE: Claude identifies violation and updates hook code to match defined pattern. Adds proper TypeScript typing, applies naming convention (usePrefix), implements named export only structure. 2. VALIDATE PHASE: Test suite runs end-to-end. Confirms fix works correctly. 3. UPDATE RULES PHASE: Claude adds permanent never-do line to top of /hooks section in CLAUDE.md: 'NEVER generate a custom hook without reading /hooks/PATTERNS.md first. This file defines: naming convention (usePrefix), typing requirements (strict generics), export style (named export only).' 4. COMMIT PHASE: Git commit with message 'chore: add never-do rule for custom hook generation.' Includes never-do line verbatim in commit message. OUTCOME & PERMANENCE: Next Claude session automatically reads updated CLAUDE.md file at startup. Similar hook generation request triggers new rule recognition. Hook gets generated correctly first time. No repeat mistake occurs. MAINTENANCE & GOVERNANCE: All rules remain git-committed in repository. Team engineers can diff what changed. Rules ordered by priority (most important rules at top of file). File auto-prunes to 200-line maximum (oldest, lowest-priority rules automatically removed when limit reached).
About this skill
name: validation-loop-claude-md-learner description: Any time Claude Code messes up on your codebase, ask it to fix the mistake and then update CLAUDE.md so it never does that again, without editing rules by hand.
Validation-Loop CLAUDE.md Auto-Learner
What This Does
The Meta staff engineer never edits rules manually. After every wrong output, he says 'update the rule so we never do it again' and lets Claude patch its own CLAUDE.md. He pairs this with a validation loop (Xcode build, tests, or lint) so Claude iterates until validation passes without human review of each step.
What You Get
- Rule-update-by-prompt discipline
- validation loop tied to build/tests/lint
- top-to-bottom priority ordering in CLAUDE.md
- never-do plus always-do phrasing
- git-committed CLAUDE.md for team sync
Customize
- validation_command: what proves the fix worked (build, tests, lint)
- rule_style: never-do plus always-do
- priority_order: most important rules at top
- commit_scope: repo, workspace, or global
- auto_pruning: cap file at N lines
Sample Output
After Claude misuses a homegrown pattern, one prompt asks it to update the rule; the CLAUDE.md gets a new never-do line and the next Claude session doesn't repeat the mistake.
Target Audience
Individual engineers running Claude Code daily on real codebases
SKILL.md preview
---
name: validation-loop-claude-md-learner
description: Use this skill after Claude Code makes a mistake on a codebase and the fix should be captured as a durable rule in CLAUDE.md instead of being repeated later.
version: 1.0.0
category: Technical/Coding
author: AgentVolt
license: proprietary
tags:
- technical
- coding
- standard
---
# Validation-Loop CLAUDE.md Auto-Learner
Turns every corrected mistake into a permanent rule. After a fix, the agent writes the lesson into CLAUDE.md itself and then re-validates until the fix actually holds, so the same error is never repeated in a later session.
## When to use
… (sign up to view the full skill)More development skills
View all Development skills →Multi-Instance Terminal Cowork Juggle
Run several Claude Code instances in iTerm tabs and juggle between them like a Starcraft player: plan on one, execute on another, remote SSH on a third.
Cowork Permissions Settings Wizard
Ask Claude to add the common safe permissions to settings.json (read, tests, git ops, dev server) and gate the risky stuff (installs, deletes, network calls).
Point-Don't-Dump Skill Refactor
Restructure any bloated skill.md into a lean YAML front matter router that points at reference files, so Claude loads knowledge only when needed.
Business Automation Stack
A connected set of agents that handle the repetitive ops work — follow-ups, summaries, and handoffs.