AGENT SKILL

running-retro

Mid-session retro checkpoint: a subagent files findings from the transcript so far into a running ledger, never applied; `arm` runs it after the session ends. Use when: 'running retro', 'checkpoint this session', 'watch this session in the background', or on a /loop.

License 许可
MIT
最近更新
2026-11-15
Stars
★ 30
Forks
7

01 前言 Front Matter

metadata
{ "summary": "In-flight retro checkpoint appended to a running ledger", "workflow-stage": "retro" }
description
Mid-session retro checkpoint: a subagent files findings from the transcript so far into a running ledger, never applied; `arm` runs it after the session ends. Use when: 'running retro', 'checkpoint this session', 'watch this session in the background', or on a /loop.
argument-hint
[topic|arm]
user-invocable
true
disable-model-invocation
false

02 资源文件 7

03 SKILL.md 正文

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

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: ${CLAUDE_PLUGIN_ROOT}/reference/gather.md.

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, which proposes and never applies. Tracker filing is offered, never performed automatically.

Siblings. Pick the right one

  • /session-flow:retro. End-of-session full retrospective: five scored dimensions, feedback regression check, codification of approved learnings. running-retro is its live, cumulative counterpart, without scoring or codification.
  • /session-flow:handoff, a save-point that ends the session for /clear. running-retro is 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. (The arm action and its opt-in SessionStart hook are the exception: they arm a detached observer to run the checkpoint after the session ends; see "Arming a detached observer" below.)

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):

  • Session data dir + transcript + subagents dir. Resolve per the retro skill's "Paths" (${CLAUDE_PLUGIN_ROOT}/skills/retro/SKILL.md); transcript is <SESSION_DATA_DIR>/<session-id>.jsonl, subagents <SESSION_DATA_DIR>/<session-id>/subagents/.
  • Parser (absolute path). Resolve ${CLAUDE_PLUGIN_ROOT}/skills/retro/scripts/parse_transcript.py to its absolute form and pass that; the invocation + Python-3.10+ interpreter detection live in retro's Phase 1.1 (${CLAUDE_PLUGIN_ROOT}/skills/retro/context/session.md). Point the subagent there, do not restate them.
  • Handoff-chain pointers, if this session resumed from a handoff, pass the chain so the subagent's parser run spans the whole transcript chain, subject to the continuity gate in retro's Phase 1.0 (${CLAUDE_PLUGIN_ROOT}/skills/retro/context/session.md).
  • Prior running-retro ledger, if this session's ledger (or its chain) carries a 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.
  • Repo convention docs, the consuming repo's CLAUDE.md, the relevant .claude/rules/ files, 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).
  • The subjective-state note from step 1.

3. Delegate the analysis

Spawn a general-purpose subagent with the delegation prompt from context/checkpoint.md. 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.

4. Append to the running ledger

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

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, resolve $PY as the arm block below does, then run:

"$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 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 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 contract's runtime guards from the binding (the once-per-session self-ignore guard on the resolved memory root; never edit the consumer's root .gitignore).

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, then OFFER the forward routes; act only on the ones the user picks:

  • Codify a durable learning → /corrections:codify "<the learning>" when the corrections plugin is installed, otherwise /session-flow:retro, whose session mode codifies approved learnings (running-retro never edits CLAUDE.md, rules, or memory itself).
  • File follow-up work → offer the consumer's work-item tracker; never file automatically. For each Skill-fit gap finding, first fill its existing issue field: search the owning plugin's open issues through /work-items:track search (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.
  • Build the new-skill candidate → read /playbooks:skill-authoring for the authoring doctrine and draft against it, then gate the result on /skill-quality:check, when those are enabled; otherwise 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.)
  • Nothing actionable → say so and continue the task.

Post-checkpoint checklist

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

  • [ ] Subjective-state note written before delegating (step 1)
  • [ ] Analysis delegated to a fresh subagent with resolved absolute inputs (step 2-3)
  • [ ] Redaction swept the subagent findings AND the ledger append (both hops. Step 3 and step 4)
  • [ ] Findings appended to this session's single ledger file (located by session_id match, not a new per-checkpoint file; self-ignore guard verified on the first memory-tier write)
  • [ ] plugin_usage stamped into the ledger frontmatter, or the failed stamp noted (step 4)
  • [ ] Routes offered, nothing auto-applied (step 5); the task continues in this same session

Arming a detached observer (arm)

When $ARGUMENTS is arm (or the user asks to watch/observe this session in the background), do NOT run the in-session checkpoint above. Instead launch the detached observer for the current session: a substrate that outlives the session, tails its transcript out-of-band at zero context cost, detects end by mtime-idle, and (unless analysis is disabled) runs this same checkpoint method headless afterwards, appending its findings to this session's ledger. The substrate, lifecycle, config, untrusted-data boundary, and the deferred native Observer-Agents alternative live in ${CLAUDE_PLUGIN_ROOT}/reference/observer.md. Read it, do not restate it. To arm the current session, resolve the inputs and run the launcher:

First resolve these into shell variables the block below reads. A skill runs in-session, so read config from the rendered ${user_config.observer_*} values (an unexpanded token or empty = the default), never from the CLAUDE_PLUGIN_OPTION_* env vars the hook uses (where each form resolves: Plugin manifest reference § User configuration and § Where each variable resolves):

  • OBS_MODEL ← ${user_config.observer_analysis_model}; OBS_EFFORT ← ${user_config.observer_analysis_effort}. Leave either empty for its default: the observer reads it from the plugin's .claude-plugin/plugin.json userConfig
  • OBS_IDLE ← ${user_config.observer_idle_seconds} (default 900); OBS_MAX ← ${user_config.observer_max_seconds} (default 86400)
  • OBS_ANALYSIS ← ${user_config.observer_analysis_enabled} (default true), an operator who set it false to avoid autonomous spend must NOT get a claude -p run from a manual arm
  • OBS_BARE ← ${user_config.observer_analysis_bare} (default false)
  • DECLARED_MEMORY_DIR ← a memory_dir the consuming repo documents in prose (its CLAUDE.md / rules). Retro's rung-2 inference; empty otherwise. Being in-session, the manual arm CAN honor this (and cross-session continuity below); the headless hook uses the .work default and cannot infer a prose-documented root.
  • PREV_LEDGER / PREV_SID ← for cross-session continuity, if this session resumed from a handoff chain or an earlier running-retro ledger: resolve the prior ledger and its session id under retro's Phase 1.0 continuity gate (same as the checkpoint flow's step 2). A detached/headless observer cannot make that judgment safely (blindly linking the newest handoff could splice an unrelated session), so the SessionStart hook leaves these empty and a later in-session checkpoint reconciles them.

The launcher resolves the ledger dir to an absolute path, so a relative memory_dir still lands in the consumer repo, not the plugin cache.

PLUGIN_ROOT="${CLAUDE_PLUGIN_ROOT}"
TRANSCRIPT="$SESSION_DATA_DIR/${CLAUDE_CODE_SESSION_ID}.jsonl"   # SESSION_DATA_DIR per retro's "Paths"
MEMORY_DIR="${DECLARED_MEMORY_DIR:-.work}"
PLUGIN_DATA="${CLAUDE_PLUGIN_DATA}"
WORK_DIR="${PLUGIN_DATA:-${TEMP:-${TMPDIR:-/tmp}}}/session-flow-observer"

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

args=(--transcript "$TRANSCRIPT" --work-dir "$WORK_DIR" --ledger-dir "$MEMORY_DIR/running-retros"
  --session-id "$CLAUDE_CODE_SESSION_ID" --plugin-root "$PLUGIN_ROOT"
  --previous-running-retro "${PREV_LEDGER:-}" --previous-session-id "${PREV_SID:-}"
  --model "${OBS_MODEL:-}" --effort "${OBS_EFFORT:-}"
  --idle-seconds "${OBS_IDLE:-900}" --max-seconds "${OBS_MAX:-86400}")
[[ "${OBS_ANALYSIS:-true}" != "false" ]] && args+=(--analysis)
[[ "${OBS_BARE:-false}" == "true" ]] && args+=(--bare)
"$PY" "$PLUGIN_ROOT/skills/running-retro/scripts/arm_observer.py" "${args[@]}"

This is the SAME launcher the opt-in SessionStart hook (observer_enabled) uses; manual arm works whether or not the auto-arm is on, and is the primary entry. The launcher prints the observer pid and returns at once; it never blocks the 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 detached observer (arm) is the push/end-of-life counterpart. When checking when a /loop task stops firing, fetch scheduled tasks, Limitations live.

What this skill does NOT do

  • Does not score the session. The five scored dimensions are /session-flow:retro's.
  • Does not codify learnings, capture + route only; codification is /session-flow:retro or /corrections:codify.
  • Does not auto-file tracker issues, skill-fit gaps included; it offers routing; the user decides.
  • Does not /clear or end the session, unlike handoff; the session continues.
  • Does not run builds, tests, or a code review, and does not write into the consumer's repo 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.

Gotchas

  • The subjective-state note is mandatory. Skipping it discards the one input the subagent cannot reconstruct from disk.
  • Pass resolved absolute paths to the subagent, its fresh context expands no plugin variables and inherits none of this conversation's paths.
  • Redact on both hops, the subagent's findings pass AND the ledger write; memory-tier output outlives the session.
  • One ledger file per session, appended. Discover this session's file by matching session_id 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.
  • Non-terminating. A checkpoint is an observation, not a stop point; do not treat it like a handoff.

04 同仓库更多 Skills

melodic-software
melodic-software/claude-code-plugins

track

Backlog reads through the bound tracker: search open and closed items, view one item with its comments and state history. Use when another skill searches or reads tracker items.

★ 30
melodic-software
melodic-software/claude-code-plugins

reviewer-media

Reviewer media for one pull request: decides whether it needs a narrated walkthrough, builds the storyboard from /review:explain-change's digest, has /explainer-video:produce render it and hands the manifest to /source-control:pull-request media. Use when asked for 'reviewer media', 'a walkthrough video for this PR', 'a produced video of this change', or when pull-request ready or monitor hands a PR over.

★ 30
melodic-software
melodic-software/claude-code-plugins

route

Model and effort per agent role (orchestrator, worker, verifier, retrieval) for a multi-agent run, resolved through the bundled defaults and the user, team and personal override config layers into fenced JSON with single-agent and fan-out variants and the layer behind each value. Use when asked 'which model for the subagents', 'route the roles' or 'model routing', or before a skill passes a role's model on a spawn.

★ 30
melodic-software
melodic-software/claude-code-plugins

route

Model and effort per agent role (orchestrator, worker, verifier, retrieval) for a multi-agent run, resolved through the bundled defaults and the user, team and personal override config layers into fenced JSON with single-agent and fan-out variants and the layer behind each value. Use when asked 'which model for the subagents', 'route the roles' or 'model routing', or before a skill passes a role's model on a spawn.

★ 30
melodic-software
melodic-software/claude-code-plugins

principles

Module-design vocabulary for architecture findings, and the checks built on it. Use when: 'what is a deep module', 'what is a seam', 'deep vs shallow module', 'what is the deletion test', 'leverage and locality', 'module design vocabulary', 'which word do we use for X in architecture findings'. Scanning a codebase for friction is /architecture:improve.

★ 30
melodic-software
melodic-software/claude-code-plugins

write

Structured five-field bug report (title, steps to reproduce, expected vs actual, justified severity, suggested fix location) from an informal description, read-only. Use when the user names a defect they observed, or asks for one written up ('report a bug', 'file a bug', 'write this up as a bug').

★ 30