retrospect
Skill4 starsChanged 6 months agoApache-2.0View on GitHub
Session retrospective that scans the current conversation for agent failures, user corrections, and alignment gaps, then proposes patches to CLAUDE.md or skills. Use when: after a difficult session, after repeated corrections, to improve agent behavior, to analyze what went wrong, to close the learning loop after autopilot/fix-pr. Trigger phrases: "retrospect", "what went wrong", "session retro", "learn from this", "what should we improve", "session review", "capture learnings", "post-mortem this session".
- Deletes or force-pushes
- Commits and pushes
3 other projects use a version of this.
Adopted by
Most recently taken up by
- mblauberg/provenanttheir own version, first seen Nov 8, 2026
- grove/promise-to-prooftheir own version, first seen Oct 12, 2026
- ngc-shj/claude-code-configtheir own version, first seen Aug 31, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- grove/promise-to-proof★ 4same name
- mblauberg/provenant★ 1same name
- ngc-shj/claude-code-config★ 1same name
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 repository57 other files it gives its agents.
- autopilotSkill
- build-python-librarySkill
- build-temporalSkill
- canon-design-reviewSkill
- canon-pr-reviewSkill
- canon-reviewSkill
- ccr-modelsSkill
- ccr-runSkill
- chartSkill
- ci-health-reportSkill
- code-quality-trendsSkill
- competitive-matrixSkill
- councilSkill
- create-skillSkill
- deep-debug-ensemble-v1Skill
- deep-debugSkill
- deep-designSkill
- deep-ideaSkill
- deep-planSkill
- deep-qa-ensemble-v1Skill
- deep-qaSkill
- deep-researchSkill
- dependency-auditSkill
- deploy-status-reportSkill
- develop-board-gameSkill
- diagramSkill
- docxSkill
- dora-lite-reportSkill
- find-skillSkill
- flaky-test-diagnoserSkill
- gap-finderSkill
- gen-crash-testSkill
- gen-smokeSkill
- goal-managerSkill
- init-github-repoSkill
- loop-until-doneSkill
- magic-fetchSkill
- ml-pipeline-reportSkill
- monitorSkill
- napSkill
- pipeline-health-reportSkill
- platform-friction-detectorSkill
- pptxSkill
- prod-readinessSkill
- prompt-clash-ensembleSkill
- prompt-clashSkill
- slack-digestSkill
- slidesSkill
- specSkill
- sprint-retroSkill
- tableSkill
- team-temporalSkill
- timelineSkill
- update-stop-gateSkill
- user-activity-reportSkill
- vc-gauntletSkill
- xlsxSkill
The file
We split this skill into the rules it gives an agent
8 rules. 0 are common, 5 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
5
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 89
Early exit: If SCAN finds zero signals across all priorities, report "No findings" and stop.
- Distinctive: line 90
If only P5 signals exist (no failures), skip to PRESCRIBE for positive learnings.
- Distinctive: line 112
Verify enforcement actually evaluated the rule: If the failure looks like it should have been caught by an existing T1-T3 mechanism, you …
- Very specific: line 114
T2 (PreToolUse hook): check the hook's log file (typically under ~/.claude/hooks/*.log or in the hook's stderr) for the failing tool call.
- Very specific: line 115
T3 (pre-commit): check the commit's pre-commit output (git log --grep=fixup or rerun pre-commit run --all-files).
- Distinctive: line 117
Assess recurrence: Always / Likely / Sometimes / Unlikely
- Very specific: line 181
When adding to autonomy-rules.md, find the existing stall category that best fits the failure pattern and add a sub-bullet.
- Distinctive: line 228
After autopilot: Run retrospect to close the learning loop
“Common” is measured: kept by at least 6 in 10 of the 3 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
Session Retrospect
Scan the current conversation for alignment failures, classify root causes, and propose durable instruction patches. This is NOT a team retro — it analyzes agent behavior in THIS session and produces fixes that prevent recurrence across all future sessions.
Workflow
SCAN → CLASSIFY → DIAGNOSE → PRESCRIBE → APPLYPhase 1: SCAN — Detect Failure Signals
Sweep the conversation for signals at six priority levels. Gather evidence before asking questions.
P1 — Explicit corrections (highest confidence): User directly identified a problem:
- Correction language: "no", "not that", "wrong", "incorrect", "that's not what I meant"
- Halt commands: "stop", "don't do that", "undo", "revert"
- Repeated instructions (user re-explained something already said)
P2 — Agent self-corrections:
- "let me try again", "I see the issue", "I made a mistake"
- Same tool called 3+ times with varying parameters (floundering)
- Approach abandoned mid-execution and pivoted
P3 — Structural failures:
- Tool calls that returned errors
- Required skill not invoked when it should have been
- Verification step omitted (tests, build, diff check)
- Premature completion claims without evidence
- Unauthorized scope expansion (touched unrelated files)
- Silent degradation after tool failure (switched to guessing)
P4 — Implicit misalignment (verify before reporting):
- User tone shift toward more directive language
- User took over work the agent was performing
- User asked questions the agent should have anticipated
- Agent used weak heuristics when authoritative tools were available
P5 — Positive learnings (preserve, not fix):
- New conventions or patterns discovered during implementation
- Validated approaches that should be documented
- API quirks or system behaviors learned through investigation
- Workflow improvements that worked well
P6 — Review findings (pattern analysis):
- Issues caught by deep-qa, /review, or PR reviewers that the agent missed during implementation
- For each cluster: why did this class of error reach the review?
SCAN output: Numbered list of events, each with: event description, priority (P1-P6), source (conversation turn or tool call).
Early exit: If SCAN finds zero signals across all priorities, report "No findings" and stop. If only P5 signals exist (no failures), skip to PRESCRIBE for positive learnings.
Phase 2: CLASSIFY — Root Cause Taxonomy
For each P1-P4 and P6 signal, assign a root cause:
| Category | The agent failed because... | Typical signal |
| Missing Context | No instruction exists for this situation | Reasonable general decision, but project convention exists |
| Undiscovered Context | Instruction exists but wasn't found/loaded | Skill/CLAUDE.md section exists but wasn't triggered |
| Ignored Context | Instruction was loaded but not followed | Clear instruction in context, agent contradicted it |
| Incorrect Context | Instructions contained wrong information | Agent followed instructions exactly, but they were outdated |
| Ambiguous Instructions | Instruction was followed but misinterpreted | Multiple reasonable interpretations, agent picked wrong one |
| Incorrect Task Framing | Agent chose wrong work mode | Asked for review, agent started implementing |
| Premature Assumption | Agent should have asked but guessed | Had uncertainty, proceeded without clarifying |
| Tool/System Failure | External system failed | API timeout, permission denied, MCP unavailable |
Phase 3: DIAGNOSE — Trace Causation and Select Fix Level
For each classified failure:
- Trace the chain: What instruction, skill, or tool was involved? Quote the exact text.
- Verify enforcement actually evaluated the rule. If the failure looks like it should have been caught by an existing T1-T3 mechanism, you MUST check the corresponding log before declaring "already covered" or "no new patch needed":
- T1 (autonomy-rules):
tail -300 ~/.claude/hooks/stop-gate.log— find the entry for the failing turn and quote theverdict=andreason=fields. Ifverdict=legitimate_completionor the rule wasn't even evaluated, the rule has a loophole — fix the rule, don't claim coverage. - T2 (PreToolUse hook): check the hook's log file (typically under
~/.claude/hooks/*.logor in the hook's stderr) for the failing tool call. - T3 (pre-commit): check the commit's pre-commit output (
git log --grep=fixupor rerunpre-commit run --all-files). - The principle: the existence of a rule is documentation-level evidence. The classifier evaluated the rule and ruled correctly is enforcement-level evidence. Retrospect must operate on enforcement-level evidence — otherwise you produce false-confidence patches that don't fix the actual bug.
- T1 (autonomy-rules):
- Assess recurrence: Always / Likely / Sometimes / Unlikely
- Select fix level using the enforcement hierarchy below.
Enforcement hierarchy (prefer the highest tier that fits):
| Tier | Mechanism | Effect | When to use |
| T0 — Tool-shape wrapper | Bash wrapper script in ~/bin/ (e.g., safe-destruct) | Restructures the tool surface so violation is physically impossible | Destructive ops, evidence-gathering, expensive operations — preferred when the violation pattern has a clean wrap point. The most bulletproof tier; prefer over T1 when feasible. |
| T1a — JIT rule card | New file at ~/.claude/rule-cards/<kebab-name>.md with frontmatter (name, description, triggers, tier: default|triggered, severity) | Pre-emptively injected into agent context via UserPromptSubmit hook at moment of risk — primes attention BEFORE the violation | Behavioral rules where pre-emptive priming prevents the violation entirely (e.g., "verify technical claims before asserting", "don't fire-and-forget async"). Cheaper and earlier than T1b. |
| T1b — Stop classifier rule | autonomy-rules.md entry | Blocks turn-end when classifier detects violation | Behavioral rules whose detection is irreducibly semantic — what the cards miss. Residue layer. |
| T2 — PreToolUse gate | Python hook in .claude/hooks/ registered in settings.json | Blocks specific tool calls matching syntactic pattern | Concrete tool-level guards: "don't edit generated files", "don't push to main", "rm -rf without backup marker". Use the marker-file pattern (local-test-gate.py, destructive-bash-gate.py) for stateful checks. |
| T3 — Pre-commit hook | .pre-commit-config.yaml entry | Blocks commits matching pattern | Code-level rules: lint, format, secret detection |
| T4 — Skill update | Edit SKILL.md checklist/workflow | Guides behavior when skill is invoked | Skill-scoped workflow improvements |
| T5 — CLAUDE.md / SOUL.md | Prescriptive text | Read at session start, no enforcement | Context, conventions, preferences (NOT behavioral rules) |
| T6 — Memory entry | Project or user memory file | Read when relevant, no enforcement | User preferences, project context, reference pointers |
The rule: every behavioral fix (P1-P4) MUST have a T0-T3 mechanism. Prefer the HIGHEST tier that fits — a tool-shape wrapper (T0) makes the violation impossible; a rule card (T1a) primes attention before the risk; an autonomy-rules entry (T1b) catches the residue at turn-end. T5-T6 are documentation — they describe intent but cannot prevent violations. A retrospect that produces only T5-T6 patches for behavioral failures is incomplete.
SOUL.md and memory are appropriate for:
- User preferences and context (T6)
- Conventions and knowledge that inform judgment (T5)
- Supplementary documentation alongside an enforcement mechanism
They are NOT appropriate as the sole fix for:
- "Always do X" rules (needs T1 gate)
- "Never do Y" rules (needs T1 gate or T2 hook)
- "Check Z before W" rules (needs T1 gate)
Phase 4: PRESCRIBE — Generate Patches
For each diagnosed failure that warrants a fix, generate a specific patch.
For each behavioral fix (P1-P4), generate a paired patch:
- Enforcement patch (T1-T3) — the mechanism that blocks the violation
- Documentation patch (T5-T6, optional) — context for humans reading the rules
The enforcement patch is the deliverable. The documentation patch is supplementary.
Patch format:
## Fix [N]: [Title]
**Root cause:** [Category] — [one-line summary]
**Recurrence:** [Always/Likely/Sometimes/Unlikely]
**Enforcement tier:** T[1-3]
**Enforcement target:** [file path for gate/hook/pre-commit]
**Documentation target:** [file path for SOUL/memory, or "none"]
### Enforcement change
[The autonomy-rules.md entry, hook code, or pre-commit config]
### Documentation change (optional)
[SOUL.md or memory entry providing context]
### Rationale
[Why this enforcement prevents recurrence]Choosing the right autonomy-rules category (T1):
When adding to autonomy-rules.md, find the existing stall category that best fits
the failure pattern and add a sub-bullet. Common mappings:
- "Didn't verify before acting" → Guessing instead of reading
- "Dismissed a problem without evidence" → Evidence-free dismissal
- "Wrote code without reading context" → Edit-without-understanding
- "Masked a symptom instead of fixing root cause" → Symptom-masking fixes
- "Used weak check instead of real test" → Proxy verification
- "Stopped early with known gaps" → Procrastination / premature good enough
- "Documented rule instead of enforcing it" → Memory-as-enforcement
- "Asserted a technical fact without verifying it" → (af) Unverified-technical-assertion. The fact-ledger at
~/.claude/fact-ledger/<session_id>.jsonl(written by~/.claude/hooks/fact-ledger.pyPostToolUse) provides deterministic evidence of what was verified this session. The Stop classifier reads the ledger and treats claims without matching entries as stalls. If retrospect finds an unverified-assertion failure, prefer T1a (rule card with the relevant trigger keywords) over T1b — pre-emption is cheaper than residue-checking.
Safety checks before applying:
- Does this weaken any existing safety requirement? If yes, flag explicitly.
- Is the autonomy-rules entry general enough to catch variants, not just the exact incident?
- Could false positives from the gate cause legitimate work to be blocked?
For P5 positive learnings, use simplified format: Title, Target, Change, Rationale (no enforcement needed).
Phase 5: APPLY — Execute Patches
Apply in enforcement-first order, preferring the highest tier that fits.
For solo-owned repos: every PR below is a midpoint, not the deliverable — finish with gh pr merge --squash --delete-branch so the change lands on main and takes effect. Stopping at gh pr create triggers the PR-creation-without-merge stall: the new rule/hook/wrapper is inert until merged.
- T0 wrappers — create a Bash wrapper at
~/bin/<name>that restructures the tool surface (e.g., auto-snapshot before destruction, auto-record evidence). Register an exception in the corresponding T2 gate so wrapper invocations pass through. Commit + PR + merge. - T1a rule cards — write a new card at
~/.claude/rule-cards/<kebab-name>.mdwith frontmatter (name,description,triggers,tier,severity). Theinject-rule-cards.pyhook auto-discovers new cards on next prompt — no registration step needed. Commit + PR + merge. - T1b classifier rules — edit
autonomy-rules.mdfor residue-only rules that the cards can't pre-empt. Resolve symlinks:readlink -f ~/.claude/autonomy-rules.md. Commit + PR + merge. - T2 gates — create/edit hook scripts in
.claude/hooks/, updatesettings.json. For stateful checks, use the marker-file pattern (local-test-gate.py,destructive-bash-gate.py). Commit + PR + merge. - T3 pre-commit — update
.pre-commit-config.yaml. Commit + PR + merge. - T4 skills — edit SKILL.md files. Commit + PR + merge.
- T5-T6 documentation — SOUL.md, CLAUDE.md, memory entries. Optional supplements.
Post-apply summary:
## Retrospect Summary
### Failures analyzed: [N]
### Enforcement patches applied: [N]
### Documentation patches applied: [N]
| # | Failure | Root Cause | Enforcement (T1-T3) | Documentation (T4-T6) | Status |
|---|---------|-----------|---------------------|----------------------|--------|
| 1 | [desc] | [category] | [gate/hook/none] | [soul/memory/none] | Applied/Deferred |Integration Points
- After autopilot: Run retrospect to close the learning loop
- After fix-pr: Capture CI debugging patterns
- After deep-qa: Analyze P6 findings — why did review catch things the agent missed?
- On idle notification: Aimee harness can trigger retrospect automatically
- Manual: User types
/retrospectanytime
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.

