Capture what matters. Ignore noise. Promote proven patterns. Automate all of it.
.learnings/LEARNINGS.md — corrections, env configs, reusable fixes, architecture decisions.learnings/ERRORS.md — tool/command failures with fixes.learnings/FEATURE_REQUESTS.md — missing capabilities worth tracking.learnings/ARCHIVE.md — entries scored out during retention sweeps (never injected into context, but searchable)Before logging anything, the candidate must pass at least ONE filter:
FilterWeightDescriptionCorrectionALWAYSOmar explicitly corrected the agentRecurrenceHIGHSame issue hit 2+ times (check existing entries)Cost-to-rediscoverHIGHWould take >2 tool calls to figure out againBlast radiusMEDIUMAffects multiple skills, projects, or workflowsDecay riskMEDIUMNon-obvious env/config detail that changes rarely
If NONE match → do not log. This replaces any arbitrary line-count threshold.
Never log:
LEARNINGS.md:
markdown
- [YYYY-MM-DD] [Category]: [Actionable takeaway]
Categories: Correction, Env, Workflow, Testing, Skills, Git, Architecture
ERRORS.md:
markdown
- [YYYY-MM-DD] [Tool]: [What failed] → [Fix]
Mark fixed items with [fixed]. Delete stale entries during retention sweeps.
Instead of a hard line cap, score each entry periodically:
SignalScoreReferenced or applied in last 30 days+3Matches active project context+2Direct correction from Omar+2Has prevented a repeat error+3Env/config still valid+1Superseded by newer entry−5>90 days old, never referenced−3
Action:
.learnings/ARCHIVE.mdRun this sweep during heartbeat maintenance (every ~3 days) or when LEARNINGS.md feels noisy.
These fire without user prompting:
Post-task scan: After multi-step tasks, check for retried commands, error→workaround sequences, or avoidable file reads. If found, evaluate against write gate and log if it passes.
Session-start sweep: On .learnings/LEARNINGS.md read, flag entries >90 days old for retention scoring.
Promotion detector: After logging, scan for entries with the same [Category] tag appearing 3+ times. If found, auto-suggest a one-liner promotion to:
SOUL.mdAGENTS.mdTOOLS.mdCross-session pattern detection: When memory_search returns a daily note describing a workaround, check if .learnings/ already has it. If not and it passes the write gate, log it.
Before logging, scan existing entries for near-duplicates. If the lesson already exists, only update it if the new version is sharper or more general.
Every entry must help a future session avoid wasted work in under one glance.