lessons
Skill2 starsChanged 35 days agoApache-2.0View on GitHub
Self-healing memory loop. USE WHEN route-prompt.sh injects CORRECTION DETECTED directive, OR when you need to manually log a lesson from a non-correction signal (a CI failure that wasn't caught, a real bug landed in main). Greps lessons.md + skill Gotchas, updates or appends an entry, auto-promotes at recurrence thresholds, logs to lessons-changelog.md. NOT FOR routine work , only invoke when there's a durable rule worth capturing.
15 other projects use a version of this.
Adopted by
Most recently taken up by
- annsa-ai/business-of-agentstheir own version, first seen Nov 29, 2026
- gilebehnam/whalorytheir own version, first seen Nov 22, 2026
- GravionLabs/skillstheir own version, first seen Nov 15, 2026
- svandragt/lessonstheir own version, first seen Nov 15, 2026
- scolladon/crafttheir own version, first seen Nov 15, 2026
- OpenSWE/log-decisionstheir own version, first seen Nov 1, 2026
Used with
Projects with it also use distill-prompt, super-advisor and 1 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
OpenSWESkilldistill-prompt
Distill this conversation's underlying goal into one reusable prompt that reaches the same final outcome in a fresh session.
Also in 3 projects that use this
OpenSWESkillsuper-advisor
Pair a worker agent, in a terminal multiplexer (tmux, Herdr) or an ADE (Paseo, Orca, T3 Code), with one advisor, a stronger model that answers questions on the user's behalf to unblock the worker and leads it to its next task, by accepting its prompt suggestion or sending it text: a worker "still waiting on your go" gets `go`. Invoked by the user (`/super-advisor`), and by you in one case only, before the first step of the work and whatever the plan's size, when a grilling session has ended with its frontier empty, the user's confirmation has you execute the plan now, no advisor pair is live, and the confirmation did not decline one.
Also in 3 projects that use this
gootfSkilllog-decisions
Append-only DECISIONS.md journal at the project root for consequential calls the spec didn't settle. Use when you (or the user) make a non-trivial call worth a durable record — an ambiguity you interpreted, a tradeoff, a deviation, or a hard-to-undo action.
Also in 3 projects that use this
Other versions15 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 15
- sampleXbro/agentsmesh★ 31same name
- moberghr/mtk-agent-toolkit★ 8same name
- OpenSWE/log-decisions★ 4same name
- OpenSWE/skills★ 4same name
- swe-workflow/log-decisions★ 4same name
- apinizer/agentnizer-cookbook★ 2same name
- ChewbaccaRoars/pathfinder-skills★ 2same name
- derekcedarbaum2/content-machine★ 2same name
- scolladon/craft★ 2same name
- 3xian/lessons★ 1same name
5 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository41 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- 12-principles-of-animationSkill
- aip-namingSkill
- architectSkill
- babysit-abortSkill
- babysit-prSkill
- babysit-tickSkill
- baseline-uiSkill
- commit-pushSkill
- complex-refactorSkill
- critiqueSkill
- deadSkill
- devstackSkill
- go-backendSkill
- goSkill
- go-strictSkill
- greptileSkill
- impl-checkSkill
- inspect-dbSkill
- inspect-deploySkill
- inspect-runtimeSkill
- interaction-designSkill
- issue-planSkill
- mergeSkill
- new-resourceSkill
- plan-featureSkill
- preflightSkill
- pr-reviewSkill
- review-fixSkill
- reviewSkill
- shipSkill
- simplifySkill
- task-execution-protocolSkill
- teamSkill
- tui-component-browserSkill
- tui-design-labSkill
- tui-designSkill
- verifySkill
- wrap-upSkill
- write-docsSkill
The file
We split this skill into the rules it gives an agent
11 rules. 0 are common, 7 are distinctive, and 4 are very specific to this project.
0
Common
Most of the 14 edited versions we read keep these.
7
Distinctive
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 30
Search all four locations in parallel:
- Distinctive: line 44
If you find a matching entry, go to Step 3a (update).
- Distinctive: line 51
Add any new keywords (union, dedup)
- Distinctive: line 52
If the symptom/fix needs refinement, edit those lines
- Very specific: line 56
If the match was in lessons-archive.md, this is a *resurrection*: move the entry back to lessons.md, add Resurrected: YYYY-MM-DD, log …
- Distinctive: line 60
If the same keyword cluster appears in 2+ active entries:
- Very specific: line 63
Use the latest Last seen
- Distinctive: line 65
Delete the absorbed entries
- Very specific: line 90
Read the new Recurrence value.
- Very specific: line 101
Check the destination's cap (skill ## Gotchas ≤10 items, AGENTS.md Critical rules ≤10 items).
- Distinctive: line 107
Do not delete the lessons.md entry immediately , the rotation hook will archive it 7 days later (audit trail).
“Common” is measured: kept by at least 6 in 10 of the 14 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
/lessons , Compounding-engineering auto-loop
This skill is the formal workflow Claude follows when the correction-detection hook fires. The hook injects a short pointer; this skill holds the detailed procedure so the hook prompt stays small.
When this runs
route-prompt.sh injects a directive when the user's prompt matches correction signals: "no", "stop", "actually", "wrong", "missed", "forgot", "again", "you should have", "didn't I tell you", "we discussed this". The directive points here.
Claude then runs this skill's procedure silently , the user does not see logging activity, only the answer to their actual question. The logging happens after the user-facing reply, as a separate tool sequence.
The procedure
Step 1 , Identify what the correction is about
Extract the core lesson in one sentence. Example: user says "I told you new RPCs need permission.go" → lesson = "new MCP tool methods require an entry in internal/auth/permission.go or they return PermissionDenied".
Then pick:
- 3-6 keywords that capture the rule (e.g.
JSON-RPC, permission.go, PermissionDenied, deny-by-default) - Compliance flag ,
trueif it touches the event log, scope enforcement, append-only invariants, or any safety-critical area.falseotherwise. - Scope ,
skill-specific(name the skill) /cross-cutting(AGENTS.md) /subagent-specific(name the agent) /project-context(name the agent-docs file)
Step 2 , Grep before write
Search all four locations in parallel:
grep -i -l "<keyword1>" agent-docs/lessons.md .claude/skills/*/SKILL.md AGENTS.md .claude/agents/*.md
grep -i -l "<keyword2>" agent-docs/lessons.md .claude/skills/*/SKILL.md AGENTS.md .claude/agents/*.md
# ...etcAlso grep the archive:
grep -i -l "<keyword>" agent-docs/lessons-archive.mdIf you find a matching entry, go to Step 3a (update). If multiple matches across files, go to Step 3b (merge). If nothing matches (including archive), go to Step 3c (append).
Step 3a , Update existing entry
Edit the matching entry:
- Increment
Recurrence: N→Recurrence: N+1 - Refresh
Last seen: YYYY-MM-DD - Add any new keywords (union, dedup)
- If the symptom/fix needs refinement, edit those lines
Then go to Step 4 (promotion check).
If the match was in lessons-archive.md, this is a resurrection: move the entry back to lessons.md, add **Resurrected**: YYYY-MM-DD, log resurrect to changelog, then promotion check.
Step 3b , Merge multiple matches
If the same keyword cluster appears in 2+ active entries:
- Pick the entry with highest
Recurrenceas the survivor - Union all
Keywordslists - Use the latest
Last seen - Concatenate
Symptom+Fixwith a**Merged from**: LSN-a, LSN-bline - Delete the absorbed entries
- Log
mergeto changelog with all involved LSN ids
Step 3c , Append new entry
Generate a new ID: LSN-YYYY-MM-DD-NNN where NNN is the next sequential number for today (grep LSN-$(date +%Y-%m-%d) and increment).
Append at the end of the ## Active entries section in lessons.md:
### LSN-YYYY-MM-DD-NNN , <one-line summary>
- **First seen**: YYYY-MM-DD
- **Last seen**: YYYY-MM-DD
- **Recurrence**: 1
- **Keywords**: kw1, kw2, kw3
- **Compliance**: true | false
- **Symptom**: <one or two sentences>
- **Fix**: <one or two actionable sentences>
- **Promoted to**: _(empty)_Log append to changelog.
Step 4 , Promotion check (auto, no user prompt)
Read the new Recurrence value. Check the thresholds from agent-docs/lessons.md:
| Compliance | Scope | Threshold |
| true | skill-specific or cross-cutting | ≥ 2 |
| false | skill-specific | ≥ 3 |
| false | cross-cutting | ≥ 4 |
| any | subagent or project-context | ≥ 3 |
If threshold met:
- Identify the destination file based on Scope.
- Check the destination's cap (skill
## Gotchas≤10 items, AGENTS.md Critical rules ≤10 items). - If at cap: auto-merge the two least-recent items at the destination into one consolidated bullet, freeing a slot. Log the merge.
- Append the lesson to the destination's
## Gotchas(or Critical rules) as a one-line bullet starting with**<short rule>**. Keep it tight , the destination is not a copy of lessons.md. - Fill
**Promoted to**: <destination-file-path>on the lessons.md entry. - Log
promoteto changelog.
Do not delete the lessons.md entry immediately , the rotation hook will archive it 7 days later (audit trail).
Step 5 , Log to changelog
Append one line to agent-docs/lessons-changelog.md:
2026-05-21T09:42:13Z | append | LSN-2026-05-21-003 | new MCP tool methods need permission.go entry
2026-05-21T09:42:13Z | promote | LSN-2026-05-21-003 → .claude/skills/new-resource/SKILL.md(Multi-action sequences get multiple lines.)
Step 6 , Reply to the user about the actual correction
The user asked something or corrected you. They want an answer or fix , they don't want a logging narration. Answer/fix first, then say (optionally) "Noted , logged for future reference." in one short sentence. Never paste the LSN id or the schema at the user.
Edge cases
Many corrections in one prompt , pick the most actionable one and log it. The others get their turn the next time they recur.
The correction contradicts an existing rule , log it AND log a conflict line to changelog. Set Promoted to: CONFLICT , <existing-rule-location> so the next session knows to reconcile. The pruning script will surface conflicts.
The user explicitly says "don't log this" or "ignore" , don't log. Trust the user.
Keywords too generic (e.g. "test", "fix") , refuse to log under generic keys. Require 2+ specific keywords (file names, function names, concept terms). If the correction is too vague, ask the user to clarify before logging.
Compliance flag uncertain , default to true. Better to mark something immortal incorrectly than to lose a safety-critical rule.
Gotchas
- Do NOT narrate logging to the user , they corrected you; they want the fix, not your bookkeeping.
- Do NOT log every "no" , only log when the correction reveals a durable rule. "No, use red instead of blue" is not a rule. "No, you didn't update permission.go" is a rule.
- Do NOT skip the grep step , duplicate entries are the #1 cause of bloat. Updating an existing entry is always cheaper than appending a new one.
- Do NOT manually invoke
/lessonsfrom the conversation , if you find yourself doing this, the hook is broken. Investigate the hook, not the workaround. - Do NOT touch lessons-archive.md or lessons-changelog.md directly , only
lessons-rotate.shand this skill (via the standard procedure) write to them. Hand-edits break the audit trail.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

