Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
bump: major
---

### Changed

- **`/session-flow:retro trends` is now `/session-flow:audit-sessions trends`.** Retro no longer has a `trends` mode: asked for one, or for scores across sessions, it names `/session-flow:audit-sessions trends` and stops without analyzing a session. The new action runs the same process, the score history analysis and the delivery metrics from `/work-items:measure-delivery`, and reads the same score history file, which retro's session and quick modes still write. Update anything that still runs `/session-flow:retro trends`: saved prompts (routines, scheduled tasks, `/loop`) and `Skill(...)` permission rules.
10 changes: 6 additions & 4 deletions plugins/session-flow/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,13 +222,12 @@ to direct `git` / `gh`.
Structured end-of-session retrospective: extracts transcript metrics via a bundled stdlib-only
parser (multi-session-aware: it walks the handoff chain), assesses quality across five dimensions
against the consuming repo's own conventions, checks Claude Code auto-memory for feedback
regressions, and codifies user-approved learnings. Health scores persist across sessions for trend
analysis. With the `retro_lenses` option at `3`, the analysis runs as three parallel review
regressions, and codifies user-approved learnings. Health scores persist across sessions, and
`/session-flow:audit-sessions trends` analyzes them. With the `retro_lenses` option at `3`, the analysis runs as three parallel review
passes merged before scoring.

```shell
/session-flow:retro # full 5-phase analysis (default)
/session-flow:retro trends # cross-session score history and delivery metrics
/session-flow:retro quick # abbreviated, for limited context
```

Expand All @@ -249,14 +248,17 @@ applies a finding. The `style` action reads the stored excerpts of your own type
preferences two or more sessions show, and hands each one you confirm to `/corrections:codify` for
a user-scope file, never a repository file. The `correction` action has the session's model judge
which stored short turns corrected the agent and reports them in a separate, unranked `Judged`
section beside the measured findings.
section beside the measured findings. The `trends` action reads the health scores `retro` records
and shows how they move across sessions, with delivery metrics beside them when the work-items
plugin is installed.

```shell
/session-flow:audit-sessions # collect, then sweep every session
/session-flow:audit-sessions sweep --since 2026-09-01 # a date window
/session-flow:audit-sessions --scope project --write-report # this repository, saved report
/session-flow:audit-sessions style --scope machine # preferences seen in 2+ sessions, to corrections:codify
/session-flow:audit-sessions correction --since 2026-09-01 # model-judged corrections, reported unranked
/session-flow:audit-sessions trends # cross-session score history and delivery metrics
```

### audit-friction
Expand Down
11 changes: 8 additions & 3 deletions plugins/session-flow/probes/audit-sessions.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
"skill": "session-flow:audit-sessions",
"plugin": "session-flow",
"skill_dir": "plugins/session-flow/skills/audit-sessions",
"ranking_note": "Authored from the before descriptions at commit 871a753a97a3d9db8dcfbcc217aad49495a3fd08, frozen before the rewrite; protocol per /playbooks:skill-authoring ## Measurement. Competitors are the single-session retros, the friction audit, and the improvement and speed sweeps in other plugins.",
"ranking_note": "Authored from the before descriptions at commit 871a753a97a3d9db8dcfbcc217aad49495a3fd08, frozen before the rewrite; protocol per /playbooks:skill-authoring ## Measurement. Competitors are same-plugin siblings only (plugins/skill-quality/probes/template.md): the single-session retros, the friction audit and recall. pos-train-07 (trends across several retros) moved here from probes/retro.json when cross-session score trends moved to /session-flow:audit-sessions trends.",
"competitors": [
"session-flow:retro",
"session-flow:running-retro",
"session-flow:audit-friction",
"improvement:find",
"performance:go-faster"
"session-flow:recall"
],
"queries": [
{
Expand Down Expand Up @@ -47,6 +46,12 @@
"expect_trigger": true,
"request": "Find the sessions where I had to restate a preference more than twice."
},
{
"id": "pos-train-07",
"split": "train",
"expect_trigger": true,
"request": "Show me trends across my last several retros."
},
{
"id": "pos-val-01",
"split": "validation",
Expand Down
17 changes: 8 additions & 9 deletions plugins/session-flow/probes/retro.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
"skill": "session-flow:retro",
"plugin": "session-flow",
"skill_dir": "plugins/session-flow/skills/retro",
"ranking_note": "Authored from the before descriptions at commit 871a753a97a3d9db8dcfbcc217aad49495a3fd08, frozen before the rewrite; protocol per /playbooks:skill-authoring ## Measurement. Competitors are running-retro, audit-sessions, audit-friction, handoff and the scrutinize discipline skill.",
"ranking_note": "Authored from the before descriptions at commit 871a753a97a3d9db8dcfbcc217aad49495a3fd08, frozen before the rewrite; protocol per /playbooks:skill-authoring ## Measurement. Competitors are same-plugin siblings only (plugins/skill-quality/probes/template.md): running-retro, audit-sessions, audit-friction and handoff. The former pos-train-05 (trends across several retros) is now neg-train-05: cross-session score trends moved to /session-flow:audit-sessions trends, so retro should no longer fire on it.",
"competitors": [
"session-flow:running-retro",
"session-flow:audit-sessions",
"session-flow:audit-friction",
"session-flow:handoff",
"discipline:scrutinize-dont-coast"
"session-flow:handoff"
],
"queries": [
{
Expand All @@ -35,12 +34,6 @@
"expect_trigger": true,
"request": "Codify the lessons from this session into durable notes."
},
{
"id": "pos-train-05",
"split": "train",
"expect_trigger": true,
"request": "Show me trends across my last several retros."
},
{
"id": "pos-train-06",
"split": "train",
Expand Down Expand Up @@ -101,6 +94,12 @@
"expect_trigger": false,
"request": "Where is my permission friction coming from?"
},
{
"id": "neg-train-05",
"split": "train",
"expect_trigger": false,
"request": "Show me trends across my last several retros."
},
{
"id": "neg-val-01",
"split": "validation",
Expand Down
31 changes: 23 additions & 8 deletions plugins/session-flow/skills/audit-sessions/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
---
description: "Audit every Claude Code session on this machine for wasted time and tokens against a reference baseline, routing each finding to its fix. Use when: 'audit my sessions', 'which sessions burned the most tokens', or corrections keep repeating. One session's retro: /session-flow:retro."
argument-hint: "[sweep…] [--unattended] [--scope machine|project] [--since <day>] [--until <day>] [--write-report]"
description: "Audit every Claude Code session on this machine for wasted time and tokens against a reference baseline, routing each finding to its fix, plus session score trends over time. Use when: 'audit my sessions', 'which sessions burned the most tokens', 'show trends', or corrections keep repeating. One session's retro: /session-flow:retro."
argument-hint: "[sweep|trends…] [--scope machine|project] [--since <day>] [--until <day>] [--write-report]"
user-invocable: true
disable-model-invocation: false
metadata:
workflow-stage: retro
summary: Cross-session audit of transcripts with routed, never-applied findings
---

**Arguments.** `[sweep…] [--unattended] [--scope machine|project] [--since <day>] [--until <day>] [--write-report]`. Full form: [sweep|sweep-only|now|ticket|style|correction] and the options above. e.g., /audit-sessions, /audit-sessions sweep --since 2026-09-01, /audit-sessions --scope project --write-report, /audit-sessions now, /audit-sessions ticket --pattern 'PROJ-\d+', /audit-sessions sweep-only --since 2026-09-01, /audit-sessions style --scope machine, /audit-sessions correction --since 2026-09-01
**Arguments.** `[sweep|trends…] [--scope machine|project] [--since <day>] [--until <day>] [--write-report]`. Full form: [sweep|sweep-only|now|ticket|style|correction|trends] [--unattended] and the options above. e.g., /audit-sessions, /audit-sessions sweep --since 2026-09-01, /audit-sessions --scope project --write-report, /audit-sessions now, /audit-sessions ticket --pattern 'PROJ-\d+', /audit-sessions sweep-only --since 2026-09-01, /audit-sessions style --scope machine, /audit-sessions correction --since 2026-09-01, /audit-sessions trends

## Purpose

Expand All @@ -17,7 +17,8 @@ change what causes it. The sweep measures no correction count and no trend over
`correction` lens has this session's model judge which stored short turns were corrections, and
reports them apart from the measured findings, unranked. To see
whether you are getting faster, run it twice with different `--since`/`--until` windows and compare
the two reports by hand. Two bundled stdlib scripts do the counting; this skill runs them,
the two reports by hand. The `trends` action does show a trend over time, from a different
source: the session health scores `/session-flow:retro` records, with delivery metrics beside them. Two bundled stdlib scripts do the counting; this skill runs them,
presents the report, and routes each finding to the skill that would act on it. It never applies a
finding itself. The `style` pass reads the same store for preferences you type in more than one
session and hands each one you confirm to `/corrections:codify`.
Expand All @@ -28,12 +29,13 @@ a code or config review, and not Claude Code's built-in `/insights` (see "Bounda
## Arguments

Read `$ARGUMENTS` whole. `--unattended`, anywhere in the arguments, is the caller declaring that nobody is present
(see "Boundary" below); take it out before reading the rest. Six actions: `sweep`, which is also what a bare invocation does,
(see "Boundary" below); take it out before reading the rest. Seven actions: `sweep`, which is also what a bare invocation does,
`sweep-only`, the consumer mode below, `now` ("Current session" below), `ticket` ("Ticket
rollup" below), `style` ("Style pass" below) and `correction` ("Correction lens" below). `--scope`,
rollup" below), `style` ("Style pass" below), `correction` ("Correction lens" below) and `trends`
("Score trends" below). `--scope`,
`--since`, `--until` and `--write-report` pass through to `sweep.py` unchanged (dates are
`YYYY-MM-DD`, UTC); `sweep-only` and `correction` refuse `--write-report`, `style` takes `--scope`
and `--since` only, and `now` takes no option. `ticket` requires `--pattern '<regex>'`, takes
and `--since` only, and `now` and `trends` take no option. `ticket` requires `--pattern '<regex>'`, takes
`--branch '<name>'`, `--scope`, `--since` and `--until`, and refuses `--write-report`; stop when
`ticket` has no pattern. Stop and name this accepted set on any other token; never guess.

Expand Down Expand Up @@ -61,6 +63,11 @@ Exits 0, 1 and 2 mean what Step 2 says.
the Bash tool.
- The store and reports live under `D/audit-sessions/`; their layout, retention and schema
versioning are in [reference/store-layout.md](reference/store-layout.md).
- **Score history** (read by `trends`): `D/scores/<project-slug>.md`, the file
`/session-flow:retro` session and quick modes append to. `<project-slug>` is the project's
absolute path, in its Windows drive form when `pwd -W` gives one, with every character outside
`[A-Za-z0-9]` replaced by `-`. When no score file exists at that slug, use the name of the
`~/.claude/projects/` directory that holds the current session's JSONL as the slug.
- **Uninstall deletes the store.** Say so before the first collect on a machine: the store is the
only lasting copy of these numbers, because Claude Code removes old transcripts on its own
schedule and a deleted store cannot be rebuilt for sessions already removed.
Expand Down Expand Up @@ -323,14 +330,22 @@ a model. Run Step 1 first, pass `--scope` yourself as in the style pass's step 3
the measured findings. Each one suggests `/corrections:codify` for the person to run, marked `(not installed)` when
the catalog lacks it.

## Score trends: `trends`

`trends` shows how this project's session health scores move across sessions, with the team's
delivery metrics beside them. It takes no option, runs neither Step 1 nor Step 2, and reads no
store: its only inputs are the score history under "Paths" and `/work-items:measure-delivery` when
that skill is available, so the first-collect disclosure under "Paths" does not apply. Read
[actions/trends.md](actions/trends.md) and follow its process.

## Boundary, the built-in `/insights` command

This skill keeps a durable store, flags sessions over the shipped thresholds and routes each
finding; `/insights` is a separate report the person runs. We treat them as complementary:
If /insights is available in your session (gate basis: this skill never assumes it resolves; the
**Pointer** record below), suggest that the person run it alongside this skill. It
is reserved for the person, so this skill never runs it. When the caller passes `--unattended`, record the `/insights` suggestion in the run's output and do not ask the person;
without that flag, make the suggestion to the person.
without that flag, make the suggestion to the person. For `trends`, make the suggestion at the end of the run.

- **Pointer**: for what `/insights` reports, see <https://code.claude.com/docs/en/commands>, the
`/insights` row.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# Trends Mode: Cross-Session Performance Analysis
# Trends: Cross-Session Performance Analysis

Analyze historical session health scores to identify patterns, improvements, and areas needing
attention, and show the team's delivery metrics beside them when the work-items plugin is installed.
No current-session analysis; purely retrospective across sessions.

## Data source

Score history persisted by session/quick mode: the file SKILL.md "Paths" names, `<project-slug>.md`.
Score history persisted by `/session-flow:retro` session and quick modes: the score history file
SKILL.md "Paths" names, `<project-slug>.md`.

Format: `| Date | Session | Type | Workflow | Technical | Alignment | Efficiency | Errors | Overall |`

Expand Down Expand Up @@ -63,9 +64,10 @@ under that heading. When the skill runs and stops on an error, put its error lin
when it stops because `origin/HEAD` is unset, also name `--branch` as the fix the person can rerun
it with. The step is done when the `Delivery` heading holds the table, the not-read line or the error line.

## What this mode does NOT do
## What this action does NOT do

- No current-session analysis, no transcript metrics
- No collect or sweep: the session store under `D/audit-sessions/` is not read
- No memory writes or rule edits
- No skill/follow-up candidate generation

Expand Down
36 changes: 36 additions & 0 deletions plugins/session-flow/skills/audit-sessions/evals/evals.json
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,42 @@
"Runs neither collect.py nor sweep.py",
"Does not guess a session id or take one from the store"
]
},
{
"id": 13,
"name": "trends-mode-routing",
"prompt": "/session-flow:audit-sessions trends. Show me how my session scores have moved across recent sessions.",
"expected_output": "The trends action reads the cross-session score history from plugin state (${CLAUDE_PLUGIN_DATA}/scores/<project-slug>.md), presenting the trend rather than analyzing the current session in isolation. It runs no collect and no sweep.",
"files": [],
"expectations": [
"The skill runs the trends action (cross-session score history), not a sweep",
"It reads score history from plugin state (${CLAUDE_PLUGIN_DATA}), not from a file inside the consumer's repo",
"It does not run collect.py or sweep.py"
]
},
{
"id": 14,
"name": "trends-reads-delivery-metrics-when-available",
"prompt": "/session-flow:audit-sessions trends. The work-items plugin is installed, so /work-items:measure-delivery is available.",
"expected_output": "The trends action presents the cross-session score analysis, or the 'No historical scores found' line when there is no history, then invokes /work-items:measure-delivery through the Skill tool and shows its delivery table and trend lines under a separate Delivery heading, with the window, branch and deploy signal, naming no person.",
"files": [],
"expectations": [
"The skill invokes /work-items:measure-delivery rather than computing delivery metrics itself",
"The delivery table appears under its own heading with the window, branch and deploy signal, apart from the session scores",
"No author, committer or other person is named in the delivery section"
]
},
{
"id": 15,
"name": "trends-names-missing-measure-delivery",
"prompt": "/session-flow:audit-sessions trends. The work-items plugin is not installed in this setup.",
"expected_output": "The trends action presents the score analysis, or the 'No historical scores found' line when there is no history, and states that delivery metrics were not read because /work-items:measure-delivery is not available, without inventing delivery numbers or computing them another way.",
"files": [],
"expectations": [
"The output says delivery metrics were not read and names /work-items:measure-delivery as unavailable",
"No delivery numbers are invented or computed from git history by the skill itself",
"The score analysis, or the 'No historical scores found' line, still appears before the Delivery heading"
]
}
]
}
Loading
Loading