session-retro

Wraps up a session: checks for uncommitted, unpushed or unmerged work, open PRs and running tasks, gives a Done / Not done / Needs you status, and proposes a few lessons, rules or skill ideas to keep, applying only what you approve.

Group
Session and communication
Kind
Action
Writes
Approved items only: brain notes, rule diffs, the plan, auto-memory
Asks before
Each item, by number; every cleanup command

When it runs

At the end of a session, when the Stop hook asks for it, or when you ask to wrap up. Unlike the built-in /recap one-line summary, it checks git state and routes each lesson to where it belongs. Say it in your own words, for example:

What it does

It works from the conversation in context and from read-only commands, and writes nothing until you approve a specific item.

  1. Checks the state. Uncommitted changes, commits not pushed upstream, branches not merged into the base, your open PRs (skipped, and said so, without a working gh), and the background shells and agents it started that are still running. Outside a git repository it skips the git checks and says so.
  2. Proposes cleanup. Worktrees and branches whose work is merged into the base branch, and stashes this session created, with the exact commands. It never proposes the current branch or the local base branch, and names the base it compared against; when origin/HEAD is unset it proposes no branch removal and suggests git remote set-head origin -a.
  3. Prints the status block. Done (with evidence), Not done (and why), Needs you (decisions, credentials, manual steps, approvals).
  4. Proposes findings. At most three per heading, each labelled persistent (true in the next task) or this-task; only persistent ones go to the vault, auto-memory or instruction files. Preferences go to auto-memory or the user-level CLAUDE.md, lessons beyond the project to the vault through brain-capture, project facts to the project's AGENTS.md/CLAUDE.md or an ADR. The headings:
    • Lessons that outlive the task, with their destination.
    • Rule candidates from corrections you made, as a minimal diff; it first searches the file's history and, if the change reverses an earlier commit, shows that commit and asks.
    • Check candidates: a mistake made at least twice that a lint rule, test, script or hook can detect.
    • Plan update (the Backlog: files are not plans): delete a finished plan and move its open items to the backlog, or a new status line and a Next session: 3 notes action.
    • Docs: doc edits for this session's unreviewed commits that made a doc false, and an offer of docs-sync when the state docs predate them.
    • developer-os feedback: a misfiring skill, hook or rule as a drafted issue, without client or project names, with the gh issue create command for you to run.
    • Skill or hook candidates: a request you made at least twice, with a name, trigger phrases (in your own wording) and the type.
  5. Applies what you choose. You answer by number. Lessons go through brain-capture, rule and plan changes as a shown diff, auto-memory as one fact per file. Where the repository keeps a rules history table, each approved rule change gets a row.

Example output

session-retro
Done: <what was finished and verified, with evidence>
Not done: <what remains, and why>
Needs you: <decisions, credentials, manual steps, approvals>

Which items should I apply?

Boundaries

Stops when

It has shown the status block and findings and asked "Which items should I apply?". Started by the Stop hook, that question ends the turn; with nothing to report (clean git state, nothing running, no findings) it ends the turn with no output at all. After you answer, it applies the approved items and reports each file it changed.

Never

  • Open or search session transcript files.
  • Write, edit or delete any file before you approve that item.
  • Commit, push, merge, or delete a branch, worktree or stash without your explicit approval of that command.
  • Run gh issue create or file anything outside the machine.
  • Build a proposed skill or hook.