r/ClaudeCode • • 19h ago

Built with Claude I built a free Claude Code plugin that writes rules from your chats. A second Claude checks each one, 11 of the first 60 failed

Post image

My CLAUDE.md kept growing. Every time Claude messed something up I added a rule, and a few weeks later the same kind of mistake came back anyway. Some of my rules also contradicted each other without me noticing. At some point I realised I never checked if a rule would actually have caught the mistake it was written for. So I built something that checks.

It's a plugin called Proven Lessons. When a chat ends (or before a compaction) it reads the transcript in the background and proposes skills and memory rules. Each rule that came from a real failure then goes to a second claude -p call. That call only sees the rule, the failure, and a moment from the same chat where things were fine, and it doesn't know which is which. It says if the rule catches the failure, misses it, or also flags the good moment. If it misses, the rule gets one rewrite and one more check. Then Claude asks me which ones to save, and nothing is saved without a tick. Saved skills and rules go in a small ledger. Later runs check if the same failure came back, and once a month it can suggest retiring skills you haven't used in 60 days (they're moved to a folder, nothing is deleted).

Community skills and rules are great and I use them too. This is for the rules that come from your own repeated mistakes. It also reads the skills you already have, so it doesn't propose what they already cover, and it shows which of them you never actually use.

It's free, MIT, Python stdlib only, and runs through your own claude CLI, so nothing goes to any other service. Tested on macOS so far. https://github.com/eqenrico-hub/proven-lessons

My numbers from the first 3 real chats (one of them very long): 103 proposals, 60 came from a real failure. 49 of those 60 caught their failure on the first check, 6 missed it, 5 also flagged the good moment. So almost 1 in 5 of the rules Claude proposed wouldn't have done their job. The rewrite fixed 4 of the 6 that missed.

It doesn't check rules against each other yet, so contradictions are still on you. That's next on my list, there's a plan in the ROADMAP.md in the repo.

Claude Code wrote most of the Python and I reviewed it. The design decisions are mine: the blind check, nothing saved without a pick, and the harvest never runs generated code. One thing I learned the hard way: SessionEnd also fires for headless claude -p calls, and my own apps make a lot of those. Before I added a check for it I got 191 harvest runs in under two hours, all on my apps' prompts.

Similar tools exist (claude-reflect, task-observer, darwin-skill). As far as I can tell they capture your corrections or optimise whole skills. What's different here is the blind check of each rule against the failure it came from, and a ledger that tells you if that failure came back. They do things mine doesn't, like syncing with AGENTS.md or capturing corrections in real time, so they can run side by side.

If you try it, tell me where the check gets it wrong: a rule it passes that clearly wouldn't have stopped the mistake, or a good rule it fails.

0 Upvotes

0 comments sorted by