Session Retrospective
Distill past sessions for this project into evidenced, ack-gated
improvements to the team's memory and shared docs. Efficiency-led: process
waste first, durable facts second. You (scout) run this manually when asked.
Read-only analysis, assisted writes. The parser only reads transcripts.
You propose every change and write nothing until the user acks.
When to use
- The user says "run a retrospective", "mine past sessions", "what slowed us
down", or "improve the team from recent work".
- Periodically, to fold lessons from recent sessions into
.agents/.
Not for: onboarding a fresh repo (that's seeding-automation-project), or refreshing
config from code/PR changes (that's scout's normal update flow).
Procedure
Distill. Run the parser from the project root:
node {skill}/scripts/distill-sessions.mjs
It reads ~/.claude/projects/<this-project>/ transcripts newer than the
watermark (.agents/memory/scout/.last-retrospective), plus each session's
subagents/, and prints a bounded markdown digest. Add --all to ignore
the watermark, --exclude-session <id> to skip the active session, or
--out <path> to save the digest. Exit code 3 = no transcripts found →
use the Fallback below. The newest session is usually the one you're
running in — pass --exclude-session <its id> so the retrospective
doesn't analyze itself.
Read the digest (it fits in context — never read raw .jsonl).
Interpret — see references/signal-taxonomy.md. Separate:
- Efficiency findings — repeated corrections, interrupts, retry loops,
file churn, tool errors, ignored conventions.
- Durable facts — gotchas, decisions, "X doesn't work, use Y".
Every finding MUST cite the session id it came from. Drop anything you
cannot evidence from the digest.
Corrections arrive labelled by kind and ranked; the digest says when it
showed only the strongest. A short corrections list is not proof of a
smooth session — detection is English-only (the digest header says so), so
check what language the sessions were held in before reading quiet as good.
Plenty of tool errors and interrupts alongside zero corrections means the
detector is blind, not that nobody objected.
Map findings to targets — see references/finding-to-target.md:
role-specific → that role's .agents/memory/<role>/; team-wide process →
.agents/workflow.md / .agents/conventions.md; durable fact → a curated
entry (via the memory skill). If .agents/ doesn't exist, the project
isn't seeded — a retrospective refines an existing lens, it doesn't create
one; run seeding-automation-project first.
For anything a previous retrospective already wrote down and that happened
anyway, don't write it again in firmer words — finding-to-target.md has the
escalation ladder ending in a deterministic guard, and the conditions for
proposing one.
Compact the memory index — for each role whose MEMORY.md is over
budget (the session-start hook names them; or check with
wc -c .agents/memory/*/MEMORY.md, budget 32 KB). Agents write freely as
they work — nobody judges durability mid-task, because a worker sees one
task and cannot know a thing recurred. You are the pass that sees many, so
consolidation is yours.
Compaction acts on the INDEX. Entry files are merged or deleted, never
relocated, and daily logs are never touched — they are an append-only
record of what happened, so back-dating a line into an old one falsifies the
audit trail (and it would fall outside the 3-day read window anyway:
deletion with extra steps).
| Found |
Do |
| Index line far over ~120 chars |
Rewrite it as a one-line hook — but first check its detail survives in the entry body, and move what's worth keeping there before shortening. |
| Indexed entry that is really a surface-specific lookup |
Drop its index line, keep the file. It stops costing injection budget and stays findable by grep. Demotion, not deletion. |
| Near-duplicates |
Merge the bodies into ONE entry carrying a count ("seen 15x", not fifteen paragraphs); keep one index line, delete the others' files and lines. |
| Contradicted by current reality, or unused for months |
Delete the file and its line. |
| Un-indexed entry that turned out preventive — several sessions tripped over it before finding it, or it belongs in a task's first move |
Promote: add an index line (≤120 chars). This is the direction only you can judge: a worker sees one task and cannot know a fact recurred; you see many. |
Promotion and demotion are the same budget. If the index is already full,
promoting one thing means demoting another — say which, don't just add.
Re-measure after. Report what was shortened, demoted, promoted, merged and
deleted.
Propose, then wait. Present each proposed change as a diff plus a
one-line rationale with its session-id evidence. Stop and wait for the
user's ack. Do not write yet.
On ack, write:
- Memory deltas via the
memory skill (curated entries + MEMORY.md
index lines; project_briefing.md updates).
- Surgical edits to
.agents/workflow.md / conventions.md.
- A dated report
.agents/retrospectives/YYYY-MM-DD.md: sessions analyzed,
findings, what was applied, what was deferred and why.
- Advance the watermark: write
.agents/memory/scout/.last-retrospective
as {"lastRun":"<ISO>","analyzed":[<session ids you just covered>]},
merging with any existing ids. Only after writing — never on a decline.
The procedure is a default route, not a cage
The steps above are the fast path. A missing precondition is a fallback
condition, not a blocker — self-orient, take another route, and say which one
you took. Where the shipped path runs out:
| The shipped path assumes |
When it isn't true |
| Transcripts are on disk for this host |
Parser exits 3. Ask the user to paste a session transcript or summary and run steps 3–7 on that text — skip the watermark, and note in the report that it was a pasted-transcript run. |
| The sessions were held in English |
The corrections list will be short or empty and will look exactly like a clean run. Say so rather than reporting "few corrections". Lean on the language-neutral signals (tool errors, retries, churn, interrupts), extend CORRECTION_TIERS for this team's language, or ask the user what the friction was. |
.agents/ exists |
It doesn't → the project was never seeded. A retrospective refines an existing lens; it can't create one. Run seeding-automation-project first. |
| The user wants the digest's questions answered |
They often want something else — "why was last week expensive", "did the new briefing help", "what keeps breaking". The digest is one input; combine it with efficiency-audit, git history, or the run reports, and answer the question actually asked. |
What must survive whichever route you take:
- Never write without an explicit ack. No route makes this optional, and a
route that reaches a write without one is wrong however good its findings.
- Every finding cites the session it came from. A lesson you cannot point
at is a guess, and memory is expensive to un-poison.
- Reason over the digest, never raw
.jsonl. Pulling transcripts into
context to "check properly" burns the budget the retrospective exists to
protect.
- Advance the watermark only after a successful write — never on a dry
run, a decline, or an alternate route that wrote nothing.
Anti-memory-poisoning rules
- Never write without an explicit ack.
- Every durable fact cites a session id. No inventing.
- Record corrections as one-line lessons, not raw quotes.
- Bounded recall — reason over the digest, never raw
.jsonl.
Common mistakes
- Writing before ack — forbidden; always propose-then-wait.
- Advancing the watermark on a dry run or a decline — only after writing.
- Treating a candidate correction as a fact without judgment — the digest
flags candidates; you decide.
- Reading raw transcripts into context — use the digest.
References
references/transcript-schema.md — Claude Code JSONL + sub-agent layout.
references/digest-format.md — the digest the parser emits.
references/signal-taxonomy.md — signal definitions + thresholds.
references/finding-to-target.md — finding→target mapping + safeguards.
1---2name: session-retrospective3description: Use when asked to run a retrospective, mine past sessions, or improve the team from what already happened — turning prior Claude Code conversations and sub-agent sessions into proposed memory and workflow updates. Used by scout.4license: Apache-2.05---67# Session Retrospective89Distill past sessions for this project into **evidenced, ack-gated**10improvements to the team's memory and shared docs. Efficiency-led: process11waste first, durable facts second. You (scout) run this manually when asked.1213**Read-only analysis, assisted writes.** The parser only reads transcripts.14*You* propose every change and write nothing until the user acks.1516## When to use1718- The user says "run a retrospective", "mine past sessions", "what slowed us19 down", or "improve the team from recent work".20- Periodically, to fold lessons from recent sessions into `.agents/`.2122Not for: onboarding a fresh repo (that's `seeding-automation-project`), or refreshing23config from code/PR changes (that's scout's normal update flow).2425## Procedure26271. **Distill.** Run the parser from the project root:2829 ```30 node {skill}/scripts/distill-sessions.mjs31 ```3233 It reads `~/.claude/projects/<this-project>/` transcripts newer than the34 watermark (`.agents/memory/scout/.last-retrospective`), plus each session's35 `subagents/`, and prints a bounded markdown digest. Add `--all` to ignore36 the watermark, `--exclude-session <id>` to skip the active session, or37 `--out <path>` to save the digest. Exit code 3 = no transcripts found →38 use the Fallback below. The newest session is usually the one you're39 running in — pass `--exclude-session <its id>` so the retrospective40 doesn't analyze itself.41422. **Read the digest** (it fits in context — never read raw `.jsonl`).43443. **Interpret** — see `references/signal-taxonomy.md`. Separate:45 - **Efficiency findings** — repeated corrections, interrupts, retry loops,46 file churn, tool errors, ignored conventions.47 - **Durable facts** — gotchas, decisions, "X doesn't work, use Y".48 Every finding MUST cite the session id it came from. Drop anything you49 cannot evidence from the digest.5051 Corrections arrive labelled by kind and ranked; the digest says when it52 showed only the strongest. **A short corrections list is not proof of a53 smooth session** — detection is English-only (the digest header says so), so54 check what language the sessions were held in before reading quiet as good.55 Plenty of tool errors and interrupts alongside zero corrections means the56 detector is blind, not that nobody objected.57584. **Map findings to targets** — see `references/finding-to-target.md`:59 role-specific → that role's `.agents/memory/<role>/`; team-wide process →60 `.agents/workflow.md` / `.agents/conventions.md`; durable fact → a curated61 entry (via the `memory` skill). If `.agents/` doesn't exist, the project62 isn't seeded — a retrospective refines an existing lens, it doesn't create63 one; run `seeding-automation-project` first.6465 For anything a previous retrospective already wrote down and that happened66 anyway, don't write it again in firmer words — `finding-to-target.md` has the67 escalation ladder ending in a deterministic guard, and the conditions for68 proposing one.69705. **Compact the memory index** — for each role whose `MEMORY.md` is over71 budget (the session-start hook names them; or check with72 `wc -c .agents/memory/*/MEMORY.md`, budget 32 KB). Agents write freely as73 they work — nobody judges durability mid-task, because a worker sees one74 task and cannot know a thing recurred. You are the pass that sees many, so75 consolidation is yours.7677 **Compaction acts on the INDEX.** Entry files are merged or deleted, never78 relocated, and **daily logs are never touched** — they are an append-only79 record of what happened, so back-dating a line into an old one falsifies the80 audit trail (and it would fall outside the 3-day read window anyway:81 deletion with extra steps).8283 | Found | Do |84 |---|---|85 | Index line far over ~120 chars | Rewrite it as a one-line hook — but first check its detail survives in the entry body, and move what's worth keeping there *before* shortening. |86 | Indexed entry that is really a surface-specific lookup | **Drop its index line, keep the file.** It stops costing injection budget and stays findable by `grep`. Demotion, not deletion. |87 | Near-duplicates | Merge the bodies into ONE entry carrying a count ("seen 15x", not fifteen paragraphs); keep one index line, delete the others' files and lines. |88 | Contradicted by current reality, or unused for months | Delete the file and its line. |89 | **Un-indexed entry that turned out preventive** — several sessions tripped over it before finding it, or it belongs in a task's first move | **Promote: add an index line** (≤120 chars). This is the direction only you can judge: a worker sees one task and cannot know a fact recurred; you see many. |9091 Promotion and demotion are the same budget. If the index is already full,92 promoting one thing means demoting another — say which, don't just add.9394 Re-measure after. Report what was shortened, demoted, promoted, merged and95 deleted.96976. **Propose, then wait.** Present each proposed change as a diff plus a98 one-line rationale with its session-id evidence. **Stop and wait for the99 user's ack.** Do not write yet.1001017. **On ack, write:**102 - Memory deltas via the `memory` skill (curated entries + `MEMORY.md`103 index lines; `project_briefing.md` updates).104 - Surgical edits to `.agents/workflow.md` / `conventions.md`.105 - A dated report `.agents/retrospectives/YYYY-MM-DD.md`: sessions analyzed,106 findings, what was applied, what was deferred and why.107 - Advance the watermark: write `.agents/memory/scout/.last-retrospective`108 as `{"lastRun":"<ISO>","analyzed":[<session ids you just covered>]}`,109 merging with any existing ids. **Only after writing — never on a decline.**110111## The procedure is a default route, not a cage112113The steps above are the fast path. **A missing precondition is a fallback114condition, not a blocker** — self-orient, take another route, and say which one115you took. Where the shipped path runs out:116117| The shipped path assumes | When it isn't true |118|---|---|119| Transcripts are on disk for this host | Parser exits 3. Ask the user to paste a session transcript or summary and run steps 3–7 on that text — skip the watermark, and note in the report that it was a pasted-transcript run. |120| The sessions were held in English | The corrections list will be short or empty and will look exactly like a clean run. Say so rather than reporting "few corrections". Lean on the language-neutral signals (tool errors, retries, churn, interrupts), extend `CORRECTION_TIERS` for this team's language, or ask the user what the friction was. |121| `.agents/` exists | It doesn't → the project was never seeded. A retrospective refines an existing lens; it can't create one. Run `seeding-automation-project` first. |122| The user wants the digest's questions answered | They often want something else — "why was last week expensive", "did the new briefing help", "what keeps breaking". The digest is one input; combine it with `efficiency-audit`, git history, or the run reports, and answer the question actually asked. |123124**What must survive whichever route you take:**1251261. **Never write without an explicit ack.** No route makes this optional, and a127 route that reaches a write without one is wrong however good its findings.1282. **Every finding cites the session it came from.** A lesson you cannot point129 at is a guess, and memory is expensive to un-poison.1303. **Reason over the digest, never raw `.jsonl`.** Pulling transcripts into131 context to "check properly" burns the budget the retrospective exists to132 protect.1334. **Advance the watermark only after a successful write** — never on a dry134 run, a decline, or an alternate route that wrote nothing.135136## Anti-memory-poisoning rules137138- Never write without an explicit ack.139- Every durable fact cites a session id. No inventing.140- Record corrections as one-line lessons, not raw quotes.141- Bounded recall — reason over the digest, never raw `.jsonl`.142143## Common mistakes144145- Writing before ack — forbidden; always propose-then-wait.146- Advancing the watermark on a dry run or a decline — only after writing.147- Treating a candidate correction as a fact without judgment — the digest148 flags candidates; you decide.149- Reading raw transcripts into context — use the digest.150151## References152153- `references/transcript-schema.md` — Claude Code JSONL + sub-agent layout.154- `references/digest-format.md` — the digest the parser emits.155- `references/signal-taxonomy.md` — signal definitions + thresholds.156- `references/finding-to-target.md` — finding→target mapping + safeguards.