retrospective

retrospective is a command for coding agents from MartyBonacci/specswarm. It costs 76 tokens per session (3,904 once invoked), scanned A, original, MIT.

A command that reviews a completed feature or chunk of work and saves its lessons as durable project memory files.

In plain words
What is it for?
Use it after finishing a feature to review git history, task notes, verification results, and recorded interventions, then update the project's memory index.
Why use it?
It prevents useful corrections, decisions, and lessons from disappearing when a coding session ends.

Command

Part of the ss plugin — 10 skills, 34 commands, 6 agents, 4 hooks shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/martybonacci/specswarm/retrospective
Clone the repo
git clone --depth 1 https://github.com/MartyBonacci/specswarm

Or install ss, the plugin that ships this one along with the rest of its 10 skills, 34 commands, 6 agents, 4 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for retrospective

README.md
[![agentmods](https://agentmods.dev/badge/commands/martybonacci/specswarm/retrospective.svg)](https://agentmods.dev/commands/martybonacci/specswarm/retrospective)
Your own site
<a href="https://agentmods.dev/commands/martybonacci/specswarm/retrospective"><img src="https://agentmods.dev/badge/commands/martybonacci/specswarm/retrospective.svg" alt="Measured on agentmods" height="20"></a>
Per session 76 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,904 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00076 $0.03904
Opus 5 $0.00038 $0.01952
Sonnet 5 $0.00015 $0.00781
Haiku 4.5 $0.00008 $0.00390

Measured 5d ago against content hash 906f9a837499, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

retrospective scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/ss/commands/retrospective.md · 378 lines

How it starts

The opening of the file, as written. The whole thing — 378 lines — stays where its author put it; the contents beside it link to each section on GitHub.

SpecSwarm Chunk Retrospective

Auto-distills the lessons from a completed feature/chunk into 1–3 durable memory entries. Combats the failure mode where a Claude Code session ends and its accumulated wisdom (corrections, decisions, drifts caught) disappears — only memory files persist.

The subagent (chunk-retrospective) reads structured signals from the chunk and writes new feedback_*.md / project_*.md / intervention_*.md files directly to the project's memory directory. This command then updates MEMORY.md per file.

Recommended workflow: run this BEFORE /ss:ship, so the new memory files are part of the squash commit.

Phase 1: Resolve feature + parent branch

PLUGIN_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
# shellcheck disable=SC1091
source "${PLUGIN_DIR}/lib/features-location.sh"
# shellcheck disable=SC1091
source "${PLUGIN_DIR}/lib/references-loader.sh"
# shellcheck disable=SC1091
source "${PLUGIN_DIR}/lib/intervention.sh"
# shellcheck disable=SC1091
[ -f "${PLUGIN_DIR}/lib/notify.sh" ] && source "${PLUGIN_DIR}/lib/notify.sh"

# Parse args
FEATURE_NUM=""
PARENT_OVERRIDE=""
DRY_RUN=false

while [ $# -gt 0 ]; do
  case "$1" in
    --parent)  PARENT_OVERRIDE="$2"; shift 2 ;;
    --dry-run) DRY_RUN=true;          shift ;;
    -h|--help)
      cat <<EOF
Usage: /ss:retrospective [FEATURE_NUM] [options]

Auto-retrospective for a completed SpecSwarm feature.

Options:
  --parent BRANCH    Override parent branch (default: build-loop.state, then main/master)
  --dry-run          Show what would be sent to the agent; don't dispatch or write

Examples:
  /ss:retrospective
  /ss:retrospective 002
  /ss:retrospective --parent develop
  /ss:retrospective --dry-run
EOF
      exit 0
      ;;
    *)
      if [ -z "$FEATURE_NUM" ]; then FEATURE_NUM="$1"; fi
      shift
      ;;
  esac
done

REPO_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || pwd)

# Resolve feature
if [ -z "$FEATURE_NUM" ]; then
  # Try current branch (NNN-slug)
  BRANCH=$(git rev-parse --abbrev-ref HEAD 2>/dev/null || echo "")
  FEATURE_NUM=$(echo "$BRANCH" | grep -oE '^[0-9]{3}' || echo "")
fi

if [ -z "$FEATURE_NUM" ]; then
  # Fall back to latest feature dir
  get_features_dir "$REPO_ROOT"
  FEATURE_NUM=$(find "$FEATURES_DIR" -maxdepth 1 -type d -name '[0-9][0-9][0-9]-*' 2>/dev/null \
    | sort | tail -1 | xargs -n1 basename 2>/dev/null \
    | grep -oE '^[0-9]{3}' || echo "")
fi

if [ -z "$FEATURE_NUM" ]; then
  echo "❌ No feature number provided and no feature dirs found." >&2
  exit 2
fi

if ! find_feature_dir "$FEATURE_NUM" "$REPO_ROOT"; then
  echo "❌ Feature $FEATURE_NUM not found under $FEATURES_DIR" >&2
  exit 2
fi
FEATURE_ID=$(basename "$FEATURE_DIR")

# Resolve parent branch
PARENT_BRANCH="$PARENT_OVERRIDE"
if [ -z "$PARENT_BRANCH" ]; then
  STATE="${REPO_ROOT}/.specswarm/build-loop.state"
  if [ -f "$STATE" ]; then
    PARENT_BRANCH=$(grep -E '^parent_branch=' "$STATE" 2>/dev/null | head -n1 | cut -d= -f2- | tr -d '"' || echo "")
  fi
fi
if [ -z "$PARENT_BRANCH" ]; then
  for candidate in main master; do
    if git -C "$REPO_ROOT" rev-parse --verify "$candidate" >/dev/null 2>&1; then
      PARENT_BRANCH="$candidate"
      break
    fi
  done
fi
PARENT_BRANCH="${PARENT_BRANCH:-main}"

echo "🔍 Retrospective target"
echo "  feature:        $FEATURE_ID"
echo "  feature_dir:    $FEATURE_DIR"
echo "  parent_branch:  $PARENT_BRANCH"
echo ""

Read the full file on GitHub · 378 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 378 lines · 76 tokens per session scan A 906f9a837499

Subscribe to this mod's changes

retrospective is a command published in the GitHub repository MartyBonacci/specswarm (65 stars, last pushed 1mo ago), licensed MIT. It adds 76 tokens to every session and 3,904 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.