From retrospect
The single skill for all reflective self-improvement, memory, and instruction-architecture work in Claude Code. Invoked directly with flags: /retrospect — quick session retrospective, surfaces signal from recent activity. /retrospect --deep — full architecture audit: conflicts, dead skills, duplicate rules, bloat. /retrospect --apply — write approved patches to CLAUDE.md, skills, or hooks (shows diff first). /retrospect --learn <target> — extract patterns from a file, PR, commit range, or directory. /retrospect --evolve — propose new skills from repeated manual behavioral patterns. /retrospect --memory — inspect stored entries across all memory layers. /retrospect --memory failure — inspect just the failure layer. /retrospect --memory stats — entry counts per layer. /retrospect --skills — audit all skill files in this repo for quality issues. /retrospect --skills .claude/skills/ — audit skills in a specific path. /retrospect --ui — launch the local web UI at http://localhost:3456. /retrospect --continue <id> — resume from a saved workflow checkpoint. Invoke for ANY of these situations: Session wrap-up: /retrospect, "what did I learn", "reflect on the session", "session summary", "what should I remember from this", "capture what we learned". Failures and fixes: "what went wrong", "analyze failures", "am I repeating mistakes", "why does this keep happening", "we keep making the same mistake", "you always forget to", "I've told you this before". Agent architecture: "improve my agent setup", "is my skill good", "can you make this skill better", "detect duplicate instructions", "check for conflicts", "audit my instructions", "is my CLAUDE.md bloated", "find dead skills", "my instructions are contradictory", "improve agent architecture". Learning from artifacts: "learn from this file", "extract patterns", "learn from this PR", "what can you learn from this codebase", "analyze this repo for patterns". Skill improvement: "improve this skill", "find skills to improve", "analyze skills", "create a PR for this skill", "this skill could be better", "the skill description is bad", "the skill never triggers". Memory: "show memories", "what do you remember", "list learnings", "inspect memory", "clear session memory", "what's in repo memory", "show failure patterns". Apply improvements: "apply recommendations", "apply pending changes", "write the CLAUDE.md rule", "commit the learning to CLAUDE.md". Workflow evolution: "generate a new skill", "evolve based on history", "suggest new skills from my behavior", "this workflow is repeated, make it a skill", "automate this pattern". Also triggers automatically when hooks capture learning signals worth surfacing.
How this skill is triggered — by the user, by Claude, or both
Slash command
/retrospect:retrospectThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
You help Claude Code get better over time. When something happens — a session ends, a mistake repeats, a pattern emerges, a skill could be cleaner — you capture what matters, route it correctly, and propose targeted improvements. You are selective and precise: not everything deserves to be saved, and where something lands matters as much as what it says.
You help Claude Code get better over time. When something happens — a session ends, a mistake repeats, a pattern emerges, a skill could be cleaner — you capture what matters, route it correctly, and propose targeted improvements. You are selective and precise: not everything deserves to be saved, and where something lands matters as much as what it says.
This is the first and most important question for every learning. Apply it before routing anything:
| Scope | Where it lands |
|---|---|
| Universal — true in any repo, for any user, forever | User memory or meta memory |
| This repo — applies here, wouldn't travel to another project | CLAUDE.md or repo memory |
| Multi-harness — repo uses Cursor + Claude Code + Copilot | Relevant instruction file for each harness |
| Structural gap — missing skill, hook, or hard rule | File edit (if confidence ≥ 85%) |
| This session — situational, unlikely to recur | Session memory or skip it |
The most common routing mistake: treating repo conventions as universal truths, or burying a universal insight in a single repo's memory. Before routing, ask: would this apply in a completely different codebase written in a different language? If yes — global. If no — local.
Global learnings should be abstract. "LangGraph nodes catch exceptions internally" is a repo-level pattern. "State machine nodes should be self-healing: catch errors internally and signal failure through state rather than propagating exceptions" is a universal insight worth keeping in meta memory.
Repo learnings can be specific. "In this repo, use (obj.get('key') or {}).get('sub') to chain pydantic model_dump output" is the right level of detail for repo memory — precise enough to be actionable.
Before writing anything persistent, be honest about confidence:
When you've seen a pattern 3+ times across multiple sessions → confidence goes up. First time seeing it → confidence stays low unless it's a critical security/safety issue.
| Argument | Mode |
|---|---|
| (none) | Quick session retrospective |
--deep | Full architecture scan — conflicts, dead skills, bloat — modes/deep-analysis.md |
--apply | Write approved patches to instruction files — modes/apply-mode.md |
--learn <target> | Extract learnings from a file, PR, or repo — modes/learn.md |
--evolve | Propose new skills from repeated behavioral patterns — modes/evolve.md |
--memory [layer] | Inspect what's stored in memory layers — modes/memory.md |
--skills [path] | Audit skills in this repo and propose improvements or PRs — modes/skills.md |
--ui | Launch the local web UI at http://localhost:3456 — see modes/ui.md |
--continue <id> | Resume from .retrospect/checkpoints/<id>.json |
Routing decisions — see routing-guide.md.
Ensure .retrospect/ is gitignored in the current repo. This must run once before any other step:
git rev-parse --show-toplevel 2>/dev/null
If a git repo root is found, check whether **/.retrospect already appears in .gitignore at that root:
**/.retrospect to .gitignore (create the file if it doesn't exist). No confirmation needed — this is always safe.$ARGUMENTS (do this before anything else)Inspect $ARGUMENTS. Match the first token to the table below. If it matches, stop reading this file and follow only the linked mode document. The mode file owns all further sub-argument parsing.
$ARGUMENTS starts with | Follow |
|---|---|
| (empty) | Continue to Quick Mode below |
--deep | modes/deep-analysis.md |
--apply | modes/apply-mode.md |
--learn | modes/learn.md — remainder of $ARGUMENTS is <target> |
--evolve | modes/evolve.md |
--memory | modes/memory.md — remainder of $ARGUMENTS is [layer] |
--skills | modes/skills.md — remainder of $ARGUMENTS is [path] |
--ui | modes/ui.md |
--continue | Continue mode — see inline instructions directly below this table |
--continue <id> — Resume from checkpoint<id> from $ARGUMENTS (the token after --continue)..retrospect/checkpoints/<id>.json.<id>." List .retrospect/checkpoints/ if it exists.{ "id", "created_at", "mode", "step", "state", "pending_reflections" }.step inside the mode identified by mode (e.g., if mode: "apply" and step: 2, jump to Step 2 of modes/apply-mode.md).pending_reflections into the working context before resuming.$ARGUMENTS is empty)Fast, focused, selective. Gather context → identify what's actually signal → propose where each learning belongs.
Step 1 — Gather what happened
Read what exists, skip what doesn't:
.retrospect/session-summary.json — hook-captured session summary.retrospect/events.log — raw trigger events.retrospect/reflections.json — prior reflections (confidence ≥ 0.7)git diff HEAD~3..HEAD --stat — recent file changesStep 1b — Map the instruction landscape
Before routing any learning, understand which instruction files exist in this repo and for this user. This determines where a learning should land — the right target is as important as the content.
| Harness | What to detect |
|---|---|
| Claude Code | CLAUDE.md at project root, .claude/CLAUDE.md, ~/.claude/CLAUDE.md (global) |
| Claude Code skills | find . -name SKILL.md — skills active in this workspace |
| Claude Code hooks | find . -name hooks.json — what events are wired |
| Claude Code memory | ~/.claude/projects/*/memory/ — auto-memory files |
| Cursor | .cursorrules, .cursor/rules/*.mdc |
| Windsurf | .windsurfrules, .windsurf/rules/ |
| GitHub Copilot | .github/copilot-instructions.md |
| Devin | DEVIN.md, .devin/ |
| OpenHands | .openhands_instructions |
| Aider | .aider.conf.yml, CONVENTIONS.md |
Why this matters:
Step 2 — Find the signal
Not every session has learnings worth capturing. Look for:
If nothing stands out — say so. Don't manufacture learnings to fill the output.
Step 2b — Check for skill candidates
While scanning for signal, also watch for patterns that warrant a new or updated skill — not just a memory entry or CLAUDE.md rule. A skill candidate is a repeatable workflow with 2+ steps that a user manually executes across sessions. Ask yourself:
For each candidate, immediately assess its scope:
~/.claude/skills/<name>/SKILL.md.claude/skills/<name>/SKILL.md in the repoIf you find at least one candidate, surface it in the output as a dedicated ### Skill Suggestions section (see Step 4). Do not bury it in the improvements table — it is a different category of recommendation.
Step 3 — Apply the core principle
For each signal, ask: how general is this? Then call mcp__retrospect__reflect and mcp__retrospect__route_learning to structure and route it.
Step 4 — Present findings
Keep it tight. One short sentence per observation. Confidence matters — show it:
## Retrospect: [date]
### Signals
- [what was observed and why it's signal, not noise]
### Proposed Improvements
| Target | Change | Confidence | Why |
|--------|--------|-----------|-----|
| CLAUDE.md | Add: "..." | 88% | Appeared 3× this session |
| repo-memory | Store: "..." | 74% | Correction from user, first time |
### Skill Suggestions
> Only present this section if at least one candidate was found in Step 2b. Omit entirely if none.
**[skill-name]** · [user-scope | repo-scope]
Trigger: "[the phrase or situation that would invoke this]"
Evidence: [N occurrences — what you saw]
Install path: [~/.claude/skills/<name>/SKILL.md | .claude/skills/<name>/SKILL.md]
Run `/retrospect --evolve` to generate a full proposal with preview.
### Next Steps
[/retrospect --apply] to write the ≥85% ones.
[/retrospect --evolve] if skill suggestions were found above.
[/retrospect --deep] if you want a full architecture audit.
Nothing significant found? That's fine — a clean session is good news.
In all modes:
.retrospect/reflections.json, never overwrite itGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.
npx claudepluginhub barnuri/retrospect-skill --plugin retrospect