Learning Retrospective
Help the current task move forward using evidence from earlier attempts. Keep the intervention proportional: usually a short check by the main agent is enough.
When it helps
- The user asks for a retrospective, or the same failure recurs without useful new evidence.
- A current failure resembles a stored lesson worth checking before rediscovery.
- A difficult task has produced a verified, reusable fix worth briefly explaining.
A hook reminder is a candidate, not proof of a loop. A single failure, many tool calls, successful repeated commands, user-requested tests, and changed hypotheses that produce evidence are normal work.
Apply the lesson
Use the visible command/action, working directory, structured outcome and relevant error to decide what actually failed. Do not infer failure from a command name, repetition count, or a quoted log saying "error". Missing outcomes stay unknown.
For a likely familiar failure, search the relevant lesson registry or project notes using the tool, error signature or path. Verify that any match still applies to the current environment. If nothing relevant appears, return to the task; do not turn recall into a broad history search.
Use the evidence to choose a useful next check, repair or changed hypothesis. A justified retry after an environment change is allowed. Stop an unproductive approach when its premise is disproven; stop the whole task only for an actual permission boundary, missing dependency/input, or risk that prevents safe progress.
After resolution
Mention a lesson only if it is useful: trigger, verified cause/fix, scope and validation. No mandatory report, lesson template, confidence score or extra test suite is required for ordinary work.
Write persistent memory only when the user explicitly asks to save/update it;
follow the host's current memory write mechanism. Updating this skill is not
permission to update memory. For an authorized write, use
references/memory-surfaces.md and optionally
scripts/lesson_lint.py for an existing structured lesson.
Optional mechanisms
- Hooks: Read references/hook-activation.md when installing or troubleshooting. The default is a local advisory; it neither launches a reviewer nor denies a tool call. Preserve explicit user settings.
- Independent review: Only when the user explicitly requests it for the task, read references/reviewer-prompt.md. Availability of a subagent or an old hook instruction is not authorization to use one.
- Risky retries: references/failure-gates.md gives optional examples for costly or externally mutating actions.