Running retro

From melodic-software/claude-code-plugins · View interactive version

Running retro is an AI agent skill from the GitHub repository melodic-software/claude-code-plugins. Mid-session retro checkpoint: a subagent files findings from the transcript so far into a running ledger, never applied. Use when: 'running retro', 'checkpoint this session', or on a /loop.

How to use this skill

Skill file

Arguments. [topic]. e.g., /running-retro, /running-retro phase-3

Context. Gather first

Take session-id, branch, status, and recent-commits at -5. 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:

CODE0.

Purpose

The self-improvement loop, run while the work is still in flight, not after it. Answers, at a

mid-session checkpoint: "How is this session actually going, what is drifting, and what should

change before it costs more?" Each checkpoint appends to a cumulative running ledger for the

session, so observations accumulate across a long session or a /loop interval rather than waiting

for a single end-of-session pass.

It captures and routes findings; it does not apply them. Codification (editing CLAUDE.md,

rules, or memory) stays with /session-flow:retro's approval checkpoint, and turning one recurring

mistake into a check or a line with /corrections:codify (if enabled), which proposes and never applies. Tracker filing is offered, never

performed automatically.

Siblings. Pick the right one

regression check, codification of approved learnings. running-retro is its live, cumulative

counterpart, without scoring or codification.

non-terminating: it observes and the session keeps going.

Zero-arm. Nothing to set up in advance

No arming at session start for the default in-session checkpoint. A checkpoint reads the session

transcript on disk (<session-id>.jsonl) with /session-flow:retro's parser rather than parsing

anew. When checking what that transcript records, fetch

Work with sessions

live. Invoke a checkpoint any time. With observer_enabled on, the session-flow observer also

writes live findings to this same ledger and analyzes ended sessions that got none; see

CODE0.

The checkpoint flow

1. Subjective-state note (main agent, the one thing disk cannot capture)

Before delegating, write 2-3 lines of your own in-flight state: what you are uncertain about,

what feels off, where you are stuck or repeating, any correction you sense coming. The transcript on

disk holds what happened, not the acting agent's present read of it; this note seeds the analysis.

Ground the note in the instrument when one is present. When the context-usage plugin is

enabled, resolve this session's zone word per its reader contract (the contract owns the

snapshot path, staleness rule, and bands, read them there; this note carries only the resulting

word, no band values) and include it in the note. Absent plugin, absent snapshot, or unknown: say

so in the note rather than substituting an estimate. If context-usage's evidence-degraded marker

exists for this session, record that too. It outranks a healthy-feeling self-read.

2. Resolve inputs for the subagent

The analysis runs in a fresh subagent, which we treat as seeing none of this conversation,

the skills invoked, or files read (pointer: Create custom subagents § What loads at startup).

So resolve every input to a concrete value and pass it in the delegation prompt, never a

${CLAUDE_PLUGIN_ROOT} token (where that token expands:

<https://code.claude.com/docs/en/plugins/manifest-reference#where-each-variable-resolves>):

(${CLAUDE_PLUGIN_ROOT}/skills/retro/SKILL.md), with the configuration-directory override

applied when it is set (Where transcripts are stored);

transcript is <SESSION_DATA_DIR>/<session-id>.jsonl, subagents

<SESSION_DATA_DIR>/<session-id>/subagents/. Confirm it with one Read of the transcript's first

line and nothing else: never list, glob or search for it. When that Read fails or is denied, pass

transcript: unreadable in the subagent's Transcript slot and not available in its Subagents

dir slot, fill its User's account slot with

what the user and this conversation say happened (corrections, skills invoked or bypassed),

add the unreadable transcript to the subjective-state note, and carry on through step 5: the

analysis then runs on that account, and its findings still go to the ledger.

${CLAUDE_PLUGIN_ROOT}/reference/transcript-parser.md, which holds its invocation and the

Python 3.10+ interpreter check, to their absolute forms and pass both. Point the subagent at that

file; do not restate it.

subagent's parser run spans the whole transcript chain, subject to the continuity gate in that

same file.

previous_running_retro pointer, resolve that prior ledger's absolute path and pass it so the

subagent carries forward earlier checkpoints' findings (the "running" = cumulative guarantee). This

is the ledger's own continuity chain, walked by reading the ledger files, not the parser's

--chain-from, so a session continued from an earlier checkpoint without a handoff still keeps

its prior findings.

and any convention READMEs, so the subagent judges convention/workflow drift against the repo's

documented rules. These are trusted local reads; transcript content is not (see checkpoint.md's

trust boundary).

to its absolute form and pass it in the template's Analysis spec slot.

3. Delegate the analysis

Spawn a general-purpose subagent with the delegation prompt from

CODE0. It

carries the parser-first-then-selective-read method, the finding categories, the resolution-route

classification, and the mandatory redaction pass on the returned findings. The subagent returns

a compact findings block only; the verbose transcript stays in its context.

Before appending, drop any returned finding that repeats one of this session's ## Live check

sections in the ledger (the observer's): reference it by its heading instead, with its status

(open, confirmed, disputed or resolved).

4. Append to the running ledger

The ledger lives at <memory_dir>/running-retros/ (default .work/running-retros/), resolved

against the repository's main checkout (the parent of `git rev-parse --path-format=absolute

--git-common-dir`) so a session in a linked worktree shares its ledger with the observer and keeps

it when the worktree is removed.

One ledger file per session, appended. Discover before creating. Name it

<TS>-running-retro-<topic>.md (TS = date -u +%Y%m%dT%H%M%SZ, topic = argument or inferred),

created on this session's first checkpoint with frontmatter session_id: $CLAUDE_CODE_SESSION_ID. On

every later checkpoint do not create a second file: locate this session's existing ledger by globbing

<memory_dir>/running-retros/*-running-retro-*.md and matching the one whose frontmatter session_id

equals the current $CLAUDE_CODE_SESSION_ID, then re-read it from disk and append a new

## Checkpoint <TS> section. Create a new file only when no such match exists.

Stamp the plugin usage. After each append, run:

PY=""; for c in python3 python; do command -v "$c" >/dev/null 2>&1 \
  && "$c" -c 'import sys;sys.exit(0 if sys.version_info>=(3,10) else 1)' 2>/dev/null && { PY="$c"; break; }; done
"$PY" "${CLAUDE_PLUGIN_ROOT}/skills/running-retro/scripts/stamp_plugin_usage.py" \
  --ledger "<ledger>" --session-id "$CLAUDE_CODE_SESSION_ID" --session-data-dir "$SESSION_DATA_DIR"

It sets the frontmatter key plugin_usage to one line of JSON, {"skills": {"<plugin>:<skill>": <count>}},

counted over the whole session by the parser, replacing the last stamp. A non-zero exit leaves the

ledger as it was: note it and go on. The observer's catch-up analysis stamps its own appends the same way.

The ledger is a public artifact. Its directory, its name glob and its session_id and

plugin_usage frontmatter keys are the contract other plugins read (/plugin-quality:audit session (if enabled)

finds the ledger by session_id and reads plugin_usage), so a change to any of them changes that

contract.

Chaining across /clear. When this session resumed a prior one through a handoff chain (retro's

Phase 1.0 continuity gate), record previous_running_retro (the prior session's ledger path) and

previous_session_id in this ledger's frontmatter. These are ledger-continuity pointers this skill

walks to present the cumulative running history; they are not parser input, the parser's

--chain-from consumes handoff files only (it reads session_id / previous_handoff), never

running-retro ledgers. Honor the memory root's runtime guards (the once-per-session self-ignore

guard on the resolved memory root; never edit the consumer's root .gitignore), steps 2 and 3 of

CODE0 "Full-path write procedure",

read with the Read or Grep tool, not a shell command.

Redact before writing. Re-sweep the findings for secrets, tokens, credentials, connection

strings, and PII, replacing each with a shape marker (<REDACTED: API key>). This repeats the

subagent's own pass: the ledger outlives the session and travels to other sessions and machines.

5. Offer routing, never auto-apply

Present the checkpoint findings, each skill-fit gap with an Owner: field or an Owner column

naming <plugin>:<skill> or no owner found, then offer the forward routes; act only on the ones

the user picks:

learnings (running-retro never edits CLAUDE.md, rules, or memory itself). A request, in the

invocation or later, to write a learning into CLAUDE.md, .claude/rules/ or memory gets this

route as its answer: record the learning in the ledger, offer the route, and leave those files

untouched, with any tool.

For each Skill-fit gap finding, first fill its existing issue field: search the owning

plugin's open issues through /work-items:track search (if enabled) (the tracker seam; name no provider

command), when the work-items plugin is enabled, and record the match or none found. When

it is not enabled, or the owner is no owner found, leave not searched and say so. List the gap, owning skill, evidence, proposed change and existing

issue together, and file only the ones the user says yes to, skipping any that already has an

issue. Skill-fit findings are never auto-filed.

and draft against it, then gate the result on /skill-quality:check (if enabled);

when those plugins are not enabled, say the candidate has no authoring route here and leave it recorded. Read the

doctrine before drafting rather than inventing a shape from scratch. (It is a knowledge surface:

it takes no arguments and performs no actions, so it informs the drafting rather than doing it.)

Post-checkpoint checklist

Tick each in the response so the exit shape is verifiable:

new per-checkpoint file; self-ignore guard verified on the first memory-tier write)

asked (step 5); the task continues in this same session

Cadence

Manual checkpoint by default. Composes with /loop for periodic checkpoints across a long session;

running-retro ships no scheduler of its own. It is non-terminating. After routing, the underlying

task continues in this same session. The observer (observer_enabled) is the automatic

counterpart. When checking when a /loop task stops firing, fetch

scheduled tasks, Limitations live.

What this skill does not do

/corrections:codify (if enabled).

beyond the memory-tier ledger and any routing the user approves.

Next

/session-flow:retro

It scores the session and codifies the learnings this checkpoint only captured.

Related

Gotchas

cannot reconstruct from disk.

and inherits none of this conversation's paths.

outlives the session.

in frontmatter before writing (never create a second file per checkpoint); re-read from disk before

appending, never rewriting from a possibly-stale in-context copy. Cross-/clear history is linked

by the previous_running_retro pointer, which the skill walks, not the parser.

handoff.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.