| name | lesson |
| description | Record a lesson learned after fixing a bug or discovering a pattern. Updates domain memory files and checks for contradictions. Use after resolving non-trivial issues. |
Record a Lesson Learned
After fixing a bug, resolving an incident, or discovering an important pattern, record it for future sessions.
Steps
-
Classify the domain. Determine which memory file this belongs to:
- Pipeline/cron/Lambda/workers โ
memory/pipeline-ops.md
- Data quality/known bugs โ
memory/data-quality.md
- UI/frontend/navigation โ
memory/ui-navigation.md
- MCP server/CLI โ
memory/mcp-server.md
- Cross-cutting/general โ
memory/lessons-learned.md
- If it's a critical safety rule โ also add to
MEMORY.md (keep under 200 lines)
-
Check for contradictions. Read the target memory file and check:
- Does this contradict an existing entry? โ Update the old entry, don't duplicate.
- Does this make an existing entry obsolete? โ Remove or update it.
- Is there already an entry for this? โ Strengthen it with new detail, don't duplicate.
-
Write the entry. Format:
- **Short description (YYYY-MM-DD):** What happened, what the fix was, and the general rule to follow going forward.
- Always include the date.
- State the rule (what to do), not just the story (what happened).
- Keep it to 1-2 lines. Link to files/docs if details are needed.
-
Check staleness nearby. While editing, scan neighboring entries:
- Any entry with a date older than 30 days โ verify it's still accurate or mark
(verify).
- Any entry referencing a file path โ quick-check the file still exists.
- Any entry with stats/counts โ mark as
(snapshot, may be stale) if not already marked.
-
Report. Tell the user what was added, what was updated, and any stale entries found.
Examples
Good entry:
- **Lambda timeout on large books (2026-03-13):** Books with >500 pages can exceed Lambda 15min timeout. Split into chunks of 400 pages max. See `src/lib/lambda-queue.ts:128`.
Bad entry (no date, no rule):
- Fixed the Lambda timeout issue.
When NOT to use this
- Trivial fixes (typos, one-line changes) โ not worth recording
- Session-specific context โ use handoffs instead
- Speculative conclusions from reading one file โ verify first