Session Review (#131)
Role: orchestrator. Mines ground-truth session transcripts and routes
suggestions into existing machinery — it suggests, never auto-applies, and
preserves every human gate.
Every .claude/metrics/*.jsonl/.json schema referenced below (including
pending-review.jsonl and the boundary-level boundary-events.jsonl block/
warn/bypass/intervention causes, #859) is documented in full at
${CLAUDE_PLUGIN_ROOT}/knowledge/telemetry-schema.md — read it before
reasoning about a stream's fields ad hoc.
You have been invoked with the /session-review command.
Orchestrator constraints
- Never read raw transcripts yourself. All heavy parsing is the
deterministic extractor's job; you read only its KB-sized digest. Spending
model tokens to study token spend defeats the purpose. The one exception is
the gated raw-log tier (Step 3b — the raw-log semantic tier): even there you never read a raw log — you
dispatch one isolated sub-agent per flagged log and keep only its metrics-only
findings.
- Suggest, never apply. Output a ranked report and hand off; do not edit
agents, skills, or config. Human gates stay intact.
- Metrics only. The digest and report contain counts/ratios/names — never
prompt or code content.
Argument: $ARGUMENTS
--cwd <path>: project whose transcripts to mine (default: current project).--transcript <file>: analyze a specific transcript instead of auto-resolving.--out <report>: report path (default:.dev-team-reports/session-review-<date>.md).--cross-machine: opt into cross-machine telemetry sync + rollup (#1480). Absent by default — a plain/session-reviewanalyzes only this machine's local digest. See Step 1.
Steps
Pre-flight — session_report.py ships; only cross-machine mode does not (#1779, closed by #2046/#2047)
Core extraction (Steps 0, 2, 3, 4, 5, 6 below) runs entirely from
${CLAUDE_PLUGIN_ROOT}/scripts/session_report.py --profile maintainer — a
shipped script, present on every install, not only this monorepo's own
dev checkout (until #2046/#2047, this ran the old repo-root extractor
[ADR 0036 supersedes], deliberately monorepo-only tooling never shipped
inside the plugin — see ADR 0032's Category 2 — which is why this section
used to guard the whole skill on a dev-checkout check).
Only two paths remain genuinely monorepo-only, both already opt-in and
off by default: --cross-machine (Step 1, telemetry-sync.sh) and the
raw-log semantic tier it gates (Step 3b, eval_rawlog.py) — both are
repo-root scripts/ tooling by design (ADR 0032 Category 2:
self-referential to this marketplace repo's own cross-machine telemetry
database, not something a downstream install has a database FOR). If
--cross-machine is present in $ARGUMENTS and the repo-root scripts/
tree is absent (an installed plugin cache with no source checkout), tell
the user plainly: "cross-machine sync and the raw-log semantic tier require
the agentic-dev-team monorepo dev checkout — continuing local-only." Then
proceed with the local-only steps exactly as if --cross-machine had been
omitted.
0. Queued Findings — surface pending-review queue before fresh analysis
Before running fresh analysis, check whether background analysis has produced
findings that are waiting for review.
- Check
.claude/metrics/pending-review.jsonlfor entries wherereviewed_atis absent.
Count them and note their queued_at timestamps.
- If one or more unreviewed entries exist, display a Queued Findings section:
```
## Queued Findings (N unreviewed)
| # | queued_at | source | findings |
|---|-----------|--------|----------|
| 1 | <ts> | <src> | <count> |
```
Then offer: *"Run /feedback-learning to approve or reject each queued finding
before proceeding with fresh analysis."*
- If
.claude/metrics/pending-review.jsonldoes not exist, or all entries have
reviewed_at, skip this section silently and proceed.
- If any JSONL lines are malformed, skip those lines, emit a one-line warning
(WARN: skipped N malformed line(s) in pending-review.jsonl), and continue
with the valid entries.
`pending-review.jsonl` Schema
Full field reference: ${CLAUDE_PLUGIN_ROOT}/knowledge/telemetry-schema.md
(pending-review.jsonl section). Summary — each line is a JSON object:
{
"queued_at": "2026-06-01T12:00:00Z",
"source": "session-learning-trigger",
"session_id": "abc-123",
"findings": [
{
"lever": "instruction-rule",
"evidence": "3 occurrences in last 5 sessions",
"target_artifact": "agents/orchestrator.md",
"proposed_change": "Add constraint: always load context-loading-protocol first",
"route": "feedback-learning"
}
]
}
Optional fields added by /feedback-learning after disposition:
reviewed_at(ISO-8601 UTC) +approved_by— written on approvalrejected_at(ISO-8601 UTC) +rejected_by— written on rejection
1. Cross-machine Telemetry — opt-in only (#178, #1480)
Local-only is the default. A plain /session-review never touches the
cross-machine telemetry repo — skip this step entirely (go straight to Step 2)
unless --cross-machine is present in $ARGUMENTS. This keeps a normal
invocation about this developer's own working patterns on this machine, not
conflated with every other machine's sessions.
Only when --cross-machine is given: check whether a **telemetry
repository** (the cross-machine "database", Delta D) is configured:
bash "${CLAUDE_PLUGIN_ROOT}/../../scripts/telemetry-sync.sh" --check
- Exit 0 → a repo is configured. Run the sync to push this machine's digest
and pull the others, then continue:
```bash
bash "${CLAUDE_PLUGIN_ROOT}/../../scripts/telemetry-sync.sh"
```
- Exit 3 → no repo configured. Ask the user for the telemetry repo
location (a git URL), e.g. *"Where should cross-machine telemetry be stored?
Paste a private git repo URL, or say 'skip' to review this machine only."*
- If they give a URL, write it to
~/.claude/.dev-team/telemetry.jsonas
{ "remote": "<url>" } (create the dir if needed), confirm, then run the
sync command above. Point them at