/session-flow:retro [session [--pattern '<regex>']|quick|ci-runs <run>…] [--sink <dir>] [--unattended]from session-flow
Runs a structured retrospective of a Claude Code session or CI lane runs from sealed transcripts: metrics, quality across 5 dimensions, feedback-memory regression check, and codified learnings.
Ships in session-flow. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Arguments. [session [--pattern '<regex>']|quick|ci-runs <run>…] [--sink <dir>] [--unattended]. Full ci-runs form: ci-runs [quick] (<run url or id>… | --lane <workflow stem> --last <n> | [--lane <stem>] --since <day> [--until <day>] [--outcome <o>] [--model <m>]) [--sink <dir>] [--unattended] ["<your view of the result>"]. e.g., /retro, /retro session, /retro session --pattern 'PROJ-\d+', /retro quick, /retro quick --unattended, /retro ci-runs <run url>, /retro ci-runs 4471, /retro ci-runs --lane pr-verify --last 3, /retro ci-runs quick --since 2026-11-01 --outcome error --sink /srv/lane-transcripts "it approved a change it should have stopped"
Take session-id, branch, status, recent-commits at -5, and changed-files.
Probe commands, the one-command-per-call and treat-failure-as-unknown rules, and the $-expansion
rationale for gathering at run time rather than pre-computing:
${CLAUDE_PLUGIN_ROOT}/reference/gather.md.
The self-improvement loop. Answers: "What happened, what did we learn, and how do we prevent the same mistakes next time?"
Three concepts this skill enforces:
What this skill is not: not a code review (design judgment on current work), not outcome
verification (does the change match intent), and not Claude Code's built-in /insights
(cross-session usage analytics); this is structured quality analysis with codification.
Resolve at runtime, never hardcode machine-specific paths:
Eval session data. When EVAL_RETRO_SESSION_DATA_DIR is set and not empty,
SESSION_DATA_DIR is that directory (a relative value resolves against the working directory).
Neither the transcript-source resolver nor the session-file ls lookup below runs, and a
transcript or memory/ folder missing there counts as absent, with no docs fetch for it. The
variable exists only so a plugin-eval run can hand the skill a session data directory; when it
is unset, the steps below apply unchanged.
Session data root. <config dir>/projects/<project-slug>/. Each <config dir> is one line
the transcript-source resolver prints, the local sources of the transcript_sources_file
option in file order (unset, or still reading ${user_config.…}: pass '', which prints this
host's configuration directory). <project-slug> is the project's absolute path with every
character outside [A-Za-z0-9] replaced by -:
python3 "${CLAUDE_PLUGIN_ROOT}/scripts/transcript_sources.py" local-config-dir \
--sources-file '${user_config.transcript_sources_file}'
PROJECT_SLUG=$(pwd -W 2>/dev/null || pwd) # Windows drive form when available
PROJECT_SLUG=$(printf '%s' "$PROJECT_SLUG" | sed 's/[^A-Za-z0-9]/-/g')
SESSION_DATA_DIR is <config dir>/projects/<PROJECT_SLUG> for the first printed directory
where it exists. When the slug misses in every one, locate the current session's JSONL:
ls '<config dir>/projects'/*/"${CLAUDE_CODE_SESSION_ID}.jsonl" for each printed directory.
Exit 2 names a malformed sources file: say so and stop.
Transcript: <SESSION_DATA_DIR>/<session-id>.jsonl; subagents:
<SESSION_DATA_DIR>/<session-id>/subagents/
Auto-memory (feedback regression check): <SESSION_DATA_DIR>/memory/. Present only when the
consumer uses Claude Code auto-memory; degrade gracefully when absent
Pointer: when the computed transcript or auto-memory path misses, fetch Where transcripts are stored and auto memory's Storage location live.
Score history (plugin state): ${CLAUDE_PLUGIN_DATA}/scores/<project-slug>.md. Survives
plugin updates, never lands in the consumer's repo
Parser: ${CLAUDE_PLUGIN_ROOT}/scripts/parse_transcript.py, run per
${CLAUDE_PLUGIN_ROOT}/reference/transcript-parser.md
Lane transcript sink (ci-runs only): --sink <dir>, else the lane_transcript_sink
option under "Session settings". Neither set: stop and ask for --sink. There is no default
location. Its layout is the lane-transcripts contract
(docs/contracts/lane-transcripts/README.md in this plugin's marketplace repository); the
resolver is ${CLAUDE_PLUGIN_ROOT}/scripts/lane_legs.py
Lane score history (ci-runs only): ${CLAUDE_PLUGIN_DATA}/scores/lanes/<lane>.md, one
file per lane
| Signal | Mode | Context file |
|---|---|---|
End of session, bare /session-flow:retro, post-merge | session | context/session.md, full 5-phase analysis |
| "quick retro", short session, limited context | quick | context/quick.md, abbreviated pass |
ci-runs, or CI lane runs to look back on | ci-runs | context/ci-runs.md, the session phases over sealed lane legs; quick after ci-runs is its depth, not quick mode |
Score history across sessions names no retro mode. Before reading any mode, stop on a bare "how am
I doing", a request for scores, or a trends argument, and name /session-flow:audit-sessions trends;
"how did I do this session", a question about this one session, still runs a retro.
That action reads the history this skill writes and adds delivery metrics; this skill analyzes no
session for it.
A retro of one pull request (its sessions, its review comments) names no retro mode: stop and name
/session-flow:audit-sessions pr --number <n> --repo '<owner/repo>'.
A codify argument, "codify reviews" or "mine review comments" names no retro mode: one recurring
mistake, or the lessons in recent merged pull requests' review comments, go to
/corrections:codify (if enabled) (its reviews action reads the review comments). Name that skill and stop; when it is not enabled, say that no enabled
skill codifies one mistake or mines review comments, and stop.
A retro of a standards or instruction file (which of its rules hold, which have checks) names no
retro mode: stop and name /corrections:codify rules <file> (if enabled); when it is not, say that no enabled skill turns a file's rules into checks, and stop.
--unattended, anywhere in $ARGUMENTS, is the caller declaring that nobody is present: take it
out first. It only gates the user-only built-ins (/export, /insights): an unattended run neither suggests nor runs them. The bare
word unattended is neither this flag nor a mode: stop and name --unattended. A --pattern '<regex>' pair is taken out next and
kept for session mode's ticket section; it selects session when no mode is named, and with
another mode named, stop and say --pattern is session mode's only. A first token of ci-runs
selects ci-runs mode, which reads every remaining token itself (context/ci-runs.md,
"Arguments"); --sink and the run selectors outside it are not this skill's, so stop and name
ci-runs. Read the mode from the remainder. If it specifies a
mode, use it. Otherwise infer from context; when the session is long or
degraded, or compaction has occurred, prefer quick; ambiguous → session. Read the mode's context
file before proceeding.
Follow the selected context file. Each mode has its own phases, outputs, and interactive checkpoints.
| File | Load when |
|---|---|
| reference/ecosystem-improvement-catalog.md | Before filling session mode's Phase 3 recommendation table, and any other time a finding has to be mapped to an ecosystem target. It owns the project-vs-personal placement decision tree and the per-target recommendation format for memory, rules, hooks, skills, agents, MCP servers, and settings. |
The user options session and ci-runs modes read, as rendered for this run (a literal, unexpanded
placeholder, or an empty value, means unset): retro_lenses = ${user_config.retro_lenses};
lane_transcript_sink = ${user_config.lane_transcript_sink}. context/session.md "Review lenses"
resolves retro_lenses against the repository's docs/conventions/session-flow.yaml, which wins.
After the retrospective:
| Condition | Suggestion |
|---|---|
| End-of-session, retro complete | Suggest any wrap-up steps the consuming repo defines |
| Session mode, follow-ups queued | Suggest filing them in the consumer's work-item tracker |
When the sibling handoff skill's save-points exist (the resolved <memory_dir>/handoffs/,
default .work/handoffs/; or the consuming repo's documented location), the retro spans the
whole session chain, not just the current session: the
parser's --chain-from walks previous_handoff frontmatter pointers
backwards from the newest handoff file, adds every hop whose handoff file is gone but whose archive file
remains, and aggregates metrics across every chained transcript. Its handoff_journey gives each
hop's Direction changes, This session and Observations, read from the archive files where a section
moved; reconstruct each hop's journey from it. See context/session.md
Phase 1.
State the discovery basis, and never present a low-coverage chain retro silently. The walk
follows previous_handoff pointers, so it stops at the first session that wrote no handoff file,
a chain linked by hand-pasted continuation prompts instead of save-points can end after one hop.
The parser reports what it saw in chain_coverage (requested / found / available / ratio,
where available is the requested chain, plus under --chain-from the other transcripts that
mention the handoff's topic; project_transcripts counts the whole project directory apart from
the ratio). When ratio is below ~0.5, say
so before presenting: name the found and available counts, and offer --sessions with the ids
enumerated explicitly. A retro authored from a fifth of the evidence must not read like a complete
one. Offer each fork_candidates entry the same way: a fork shares records with the chain but no
handoff points at it, so the walk never reaches it.
Offer a durable copy when the session was worth retrospecting. The transcripts this retro reads
are retention-swept (cleanupPeriodDays), and the conversation itself has no durable artifact.
cleanupPeriodDays adjusts.Native suggestions are on unless native_suggestions resolves off: the team docs/conventions/session-flow.yaml value wins over the per-user value ${user_config.native_suggestions} (a literal unexpanded token means unset); with none set they are on. A value other than on or off is named and that layer dropped: a valid higher layer still wins, otherwise on, never a lower layer's value. When off, skip the sentence below and the /insights offer under Routing, and write nothing in their place, not even a note that it was skipped or why.
If /export is available in your session (gate basis: Verification record: /export below) and native suggestions are on (native_suggestions, Configuration), suggest that the person run it for a durable conversation copy at <memory_dir>/exports/<YYYYMMDDTHHMMSSZ>-<topic>.txt after verifying the memory root's self-ignore guard (a .gitignore containing *; create it and announce it when absent). This skill never invokes /export itself. --unattended: make no suggestion and write Withheld suggestion (unattended): /export in the output.
/export/export to the person and never run it: it is a built-in interactive command the Skill tool does not list and headless runs refuse. A command that is not available to the person is left out of the menu.export → session-flow:retro entry of docs/native-surfaces.md in this plugin's marketplace repository holds the headless refusal, the invocation mode, and the trigger that reopens this decision./export can run headless or take a format or redaction flag, fetch the /export row of Commands § All commands live./insights commandBoth look back at how sessions went, so "how did I do" can land on either.
/insights (built-in command): a cross-session usage report; this skill never runs it. What
it reports: the records in
reference/native-insights.md.Routing. When the person asks about patterns across many sessions, offer it to the person: If /insights is available in your session (gate basis: ungated, though
some hosts lack it; records in reference/native-insights.md) and native suggestions are on (native_suggestions, Configuration), you
can run it instead of or alongside this skill for a cross-session usage report. Make the offer at the end of the run. Prefer this skill for what one
session taught and for codifying it. When the caller passes --unattended, the run makes no
offer and writes Withheld suggestion (unattended): /insights in the output.
Mutation gate. This skill writes only approved codifications. It never runs /insights on the
person's behalf.
Availability is never assumed. This section states what to do when the person can run
/insights, never that it is present. What the report covers and where it is unavailable are read
live from the records in reference/native-insights.md.
ci-runs reads that sink there${CLAUDE_PLUGIN_DATA}; only user-approved codifications (rule edits, memory entries) land
outside itThis skill's own context/session.md, context/quick.md and
context/ci-runs.md, beside this SKILL.md, write the plugin's root directory as <plugin-root>, which is
${CLAUDE_PLUGIN_ROOT}. Put that path in place of the placeholder before running a command or
writing it into a brief: a ${…} token in a spoke reaches the Bash tool unsubstituted.
<the mistake>".<regex>'.
Session mode calls it when given --pattern (context/session.md, "Ticket section").CLAUDE.md,
AGENTS.md or rules-file line, the guidance tier of
reference/enforcement-ladder.md) names its proof in the PR:
an eval case, or a deletion watch with a date (/harness-config:unhobble (if enabled)). A mechanical finding goes to /corrections:codify (if enabled), which proves its own check, run once the user picks it at
Phase 4${CLAUDE_PLUGIN_DATA}/retro/learning.md with the Write tool and pass it through the publish
redactor, ${CLAUDE_PLUGIN_ROOT}/scripts/publish.py's publisher:
python3 "${CLAUDE_PLUGIN_ROOT}/scripts/publish.py" --sources-file '${user_config.transcript_sources_file}' --redact-identifiers '${user_config.redact_identifiers}' < "${CLAUDE_PLUGIN_DATA}/retro/learning.md".
Land its stdout, never the draft. Exit 2 (nothing published) means land nothing and say why.
Auto-memory entries stay on this machine and skip it.context/ci-runs.md (opens in a new tab)context/quick.md (opens in a new tab)context/session.md (opens in a new tab)evals/evals.json (opens in a new tab)reference/ecosystem-improvement-catalog.md (opens in a new tab)reference/enforcement-ladder.md (opens in a new tab)reference/native-insights.md (opens in a new tab)scripts/parse-concern-value.sh (opens in a new tab)scripts/yaml-subset.awk (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub melodic-software/claude-code-plugins --plugin session-flow20 skills in this plugin
/audit-frictionAudit frictionAudit Claude Code sessions for permission and autonomy friction (denials, approval prompts, hook blocks, hand-offs), traced to cause in one decision brief. Use when the agent keeps asking or handing off, auto mode denies, or re-measuring after permission fixes./audit-sessionsAudit sessionsAudit every Claude Code session on this machine or behind a pull request for wasted time and tokens against a baseline, routing findings to fixes, plus score trends over time. Use when: 'audit my sessions', 'which sessions burned the most tokens', 'retro this PR', trends, or repeating corrections. Not for one session: /session-flow:retro./clean-stopOther plugins' skills for the same job